Skip to content

feat(studio): Add the option to clone Customizer Jobs - #873

Merged
htolentino-nvidia merged 2 commits into
mainfrom
studio-clone-customizer-job/htolentino
Jul 24, 2026
Merged

feat(studio): Add the option to clone Customizer Jobs#873
htolentino-nvidia merged 2 commits into
mainfrom
studio-clone-customizer-job/htolentino

Conversation

@htolentino-nvidia

@htolentino-nvidia htolentino-nvidia commented Jul 23, 2026

Copy link
Copy Markdown
Contributor
image

Summary by CodeRabbit

  • New Features

    • Added a unified quick-actions menu for customization jobs, including clone and evaluate options.
    • Cloning a job now prepopulates the “new customization” form with the selected job’s settings.
    • The customization form now supports starting from provided preset values.
  • Bug Fixes

    • Improved cancellation feedback by disabling the “Cancelling…” menu item while the cancel request is in progress.

@htolentino-nvidia
htolentino-nvidia requested review from a team as code owners July 23, 2026 20:15
@github-actions github-actions Bot added the feat label Jul 23, 2026
Signed-off-by: Henrique Tolentino <htolentino@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f2496f32-56cd-4fe1-968e-411862281be7

📥 Commits

Reviewing files that changed from the base of the PR and between 58b8870 and 7a66ad9.

📒 Files selected for processing (7)
  • web/packages/studio/src/components/NewCustomizationForm/index.tsx
  • web/packages/studio/src/routes/CustomizationJobDetailsRoute/DetailActions.test.tsx
  • web/packages/studio/src/routes/CustomizationJobDetailsRoute/DetailActions.tsx
  • web/packages/studio/src/routes/CustomizationJobDetailsRoute/index.tsx
  • web/packages/studio/src/routes/NewCustomizationRoute/index.tsx
  • web/packages/studio/src/routes/utils.ts
  • web/packages/studio/src/util/forms/customization.ts
🚧 Files skipped from review as they are similar to previous changes (7)
  • web/packages/studio/src/routes/utils.ts
  • web/packages/studio/src/routes/CustomizationJobDetailsRoute/DetailActions.test.tsx
  • web/packages/studio/src/routes/CustomizationJobDetailsRoute/index.tsx
  • web/packages/studio/src/routes/NewCustomizationRoute/index.tsx
  • web/packages/studio/src/util/forms/customization.ts
  • web/packages/studio/src/components/NewCustomizationForm/index.tsx
  • web/packages/studio/src/routes/CustomizationJobDetailsRoute/DetailActions.tsx

📝 Walkthrough

Walkthrough

Changes

Customization job cloning

Layer / File(s) Summary
Job-to-form conversion
web/packages/studio/src/util/forms/customization.ts
Adds jobToFormFields, which maps backend-specific job specs into form values, strips nested nulls, and applies defaults.
Details quick-actions menu
web/packages/studio/src/routes/CustomizationJobDetailsRoute/DetailActions.tsx, web/packages/studio/src/routes/CustomizationJobDetailsRoute/index.tsx, web/packages/studio/src/routes/CustomizationJobDetailsRoute/DetailActions.test.tsx
Replaces conditional action buttons with a quick-actions menu containing clone, evaluate, and cancel actions, including updated cancellation states and tests.
New customization initialization
web/packages/studio/src/routes/NewCustomizationRoute/index.tsx, web/packages/studio/src/components/NewCustomizationForm/index.tsx, web/packages/studio/src/routes/utils.ts
Reads cloneFromJob navigation state, passes converted values into the form, and uses the shared model query parameter constant.

Sequence Diagram(s)

sequenceDiagram
  participant DetailActions
  participant NewCustomizationRoute
  participant jobToFormFields
  participant NewCustomizationForm
  DetailActions->>NewCustomizationRoute: navigate with cloneFromJob
  NewCustomizationRoute->>jobToFormFields: convert cloneFromJob
  jobToFormFields-->>NewCustomizationRoute: return initialValues
  NewCustomizationRoute->>NewCustomizationForm: pass initialValues
Loading

Possibly related PRs

Suggested reviewers: steramae-nvidia

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding clone support for Customizer Jobs in Studio.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch studio-clone-customizer-job/htolentino

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/packages/studio/src/routes/CustomizationJobDetailsRoute/DetailActions.test.tsx (1)

93-93: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Wrong role — assertion no longer verifies absence.

Cancel Job is now a menuitem (per lines 36, 73), but this still queries role button. It always passes trivially since Cancel Job was never a button, so it stops catching a regression where the action wrongly renders.

🐛 Proposed fix
-    expect(screen.queryByRole('button', { name: 'Cancel Job' })).not.toBeInTheDocument();
+    expect(screen.queryByRole('menuitem', { name: 'Cancel Job' })).not.toBeInTheDocument();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@web/packages/studio/src/routes/CustomizationJobDetailsRoute/DetailActions.test.tsx`
at line 93, Update the Cancel Job absence assertion in the relevant
DetailActions test to query the menuitem role, matching the action’s current
rendering semantics. Keep the existing “not.toBeInTheDocument()” expectation so
the test detects unintended rendering of Cancel Job.
🧹 Nitpick comments (1)
web/packages/studio/src/routes/CustomizationJobDetailsRoute/DetailActions.test.tsx (1)

18-96: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

No coverage for the Clone action's navigation with job.

Consider a test asserting that clicking Clone calls navigate with { state: { cloneFromJob: job } } for the new clone flow.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@web/packages/studio/src/routes/CustomizationJobDetailsRoute/DetailActions.test.tsx`
around lines 18 - 96, The DetailActions tests lack coverage for the Clone
action’s navigation payload. Add a test around DetailActions that renders a
clone-eligible job, clicks the Clone control, and verifies the mocked navigate
function receives the clone route with state containing cloneFromJob set to the
job object.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/packages/studio/src/routes/NewCustomizationRoute/index.tsx`:
- Around line 22-28: Replace the unchecked locationState assertion in the
NewCustomizationRoute initialization with a type guard that validates the state
shape and confirms cloneFromJob is a valid CustomizationJob before passing it to
jobToFormFields. Preserve undefined initialValues when validation fails, and
keep the existing useMemo behavior for validated clone jobs.

---

Outside diff comments:
In
`@web/packages/studio/src/routes/CustomizationJobDetailsRoute/DetailActions.test.tsx`:
- Line 93: Update the Cancel Job absence assertion in the relevant DetailActions
test to query the menuitem role, matching the action’s current rendering
semantics. Keep the existing “not.toBeInTheDocument()” expectation so the test
detects unintended rendering of Cancel Job.

---

Nitpick comments:
In
`@web/packages/studio/src/routes/CustomizationJobDetailsRoute/DetailActions.test.tsx`:
- Around line 18-96: The DetailActions tests lack coverage for the Clone
action’s navigation payload. Add a test around DetailActions that renders a
clone-eligible job, clicks the Clone control, and verifies the mocked navigate
function receives the clone route with state containing cloneFromJob set to the
job object.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6a557e7b-51a9-40a8-8577-76b274dd0bd8

📥 Commits

Reviewing files that changed from the base of the PR and between fa70107 and 58b8870.

📒 Files selected for processing (7)
  • web/packages/studio/src/components/NewCustomizationForm/index.tsx
  • web/packages/studio/src/routes/CustomizationJobDetailsRoute/DetailActions.test.tsx
  • web/packages/studio/src/routes/CustomizationJobDetailsRoute/DetailActions.tsx
  • web/packages/studio/src/routes/CustomizationJobDetailsRoute/index.tsx
  • web/packages/studio/src/routes/NewCustomizationRoute/index.tsx
  • web/packages/studio/src/routes/utils.ts
  • web/packages/studio/src/util/forms/customization.ts

Comment thread web/packages/studio/src/routes/NewCustomizationRoute/index.tsx
@github-actions

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 27140/34858 77.9% 62.1%
Integration Tests 15925/33570 47.4% 19.9%

Signed-off-by: Henrique Tolentino <htolentino@nvidia.com>
@htolentino-nvidia
htolentino-nvidia force-pushed the studio-clone-customizer-job/htolentino branch from 58b8870 to 7a66ad9 Compare July 23, 2026 20:47
@htolentino-nvidia
htolentino-nvidia added this pull request to the merge queue Jul 24, 2026
Merged via the queue into main with commit 3f5358d Jul 24, 2026
60 checks passed
@htolentino-nvidia
htolentino-nvidia deleted the studio-clone-customizer-job/htolentino branch July 24, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants