feat(studio): Add the option to clone Customizer Jobs - #873
Conversation
Signed-off-by: Henrique Tolentino <htolentino@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (7)
📝 WalkthroughWalkthroughChangesCustomization job cloning
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
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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 winWrong role — assertion no longer verifies absence.
Cancel Jobis now amenuitem(per lines 36, 73), but this still queries rolebutton. 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 winNo coverage for the Clone action's navigation with
job.Consider a test asserting that clicking
Clonecallsnavigatewith{ 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
📒 Files selected for processing (7)
web/packages/studio/src/components/NewCustomizationForm/index.tsxweb/packages/studio/src/routes/CustomizationJobDetailsRoute/DetailActions.test.tsxweb/packages/studio/src/routes/CustomizationJobDetailsRoute/DetailActions.tsxweb/packages/studio/src/routes/CustomizationJobDetailsRoute/index.tsxweb/packages/studio/src/routes/NewCustomizationRoute/index.tsxweb/packages/studio/src/routes/utils.tsweb/packages/studio/src/util/forms/customization.ts
|
Signed-off-by: Henrique Tolentino <htolentino@nvidia.com>
58b8870 to
7a66ad9
Compare
Summary by CodeRabbit
New Features
Bug Fixes