feat(FR-2957): add new-revision-from-this action in revision detail drawer#7561
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage Report for react-coverage (./react)
File Coverage
|
||||||||||||||||||||||||||||||||||||||
b197d30 to
5458e94
Compare
There was a problem hiding this comment.
Pull request overview
Adds a “Fork from here” action to Deployment revision UX so users can open the Add Revision modal prefilled from any historical revision (drawer overflow menu + revision table row menu), and extends the revision GraphQL selections to support full configuration prefill.
Changes:
- Introduces “Fork from here” actions in the revision detail drawer and revision history row menus, wiring them to open
DeploymentAddRevisionModalwith a selected revision fragment. - Refactors Add Revision modal prefill logic to support both “load current revision” and “fork from here” paths, including new runtime/resource fields.
- Updates Relay artifacts/fragments/queries to include
runtimeVariantIdandresourceConfig, and adds i18n strings for the new action (en/ko).
Reviewed changes
Copilot reviewed 5 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/i18n/ko.json | Adds Korean translation for deployment.ForkFromHere. |
| resources/i18n/en.json | Adds English string for deployment.ForkFromHere. |
| react/src/components/DeploymentRevisionHistoryTab.tsx | Adds “Fork from here” action in row menu and drawer overflow; opens Add Revision modal with selected revision fragment. |
| react/src/components/DeploymentRevisionDetail.tsx | Extends revision fragment to include runtimeVariantId and resourceConfig for prefill support. |
| react/src/components/DeploymentAddRevisionModal.tsx | Adds fork revision fragment support and unifies revision-based prefill logic for current/forked revisions. |
| react/src/generated/ProjectAdminDeploymentsPageQuery.graphql.ts | Regenerated Relay artifact to include updated DeploymentRevisionDetail_revision fields. |
| react/src/generated/DeploymentRevisionHistoryTabListQuery.graphql.ts | Regenerated Relay artifact to include fork fragment spread and new revision fields. |
| react/src/generated/DeploymentRevisionHistoryTabActivateMutation.graphql.ts | Regenerated Relay artifact to include updated DeploymentRevisionDetail_revision fields. |
| react/src/generated/DeploymentRevisionDetail_revision.graphql.ts | Regenerated fragment artifact with runtimeVariantId and resourceConfig. |
| react/src/generated/DeploymentReplicasTabListQuery.graphql.ts | Regenerated Relay artifact to include updated DeploymentRevisionDetail_revision fields. |
| react/src/generated/DeploymentListPageQuery.graphql.ts | Regenerated Relay artifact to include updated DeploymentRevisionDetail_revision fields. |
| react/src/generated/DeploymentDetailPageQuery.graphql.ts | Regenerated Relay artifact to include updated DeploymentRevisionDetail_revision fields. |
| react/src/generated/DeploymentAddRevisionModalAddMutation.graphql.ts | Regenerated mutation artifact to include updated DeploymentRevisionDetail_revision fields. |
| react/src/generated/DeploymentAddRevisionModal_forkRevision.graphql.ts | New generated fragment artifact used to prefill the Add Revision modal from an arbitrary revision. |
| react/src/generated/AdminDeploymentListPageQuery.graphql.ts | Regenerated Relay artifact to include updated DeploymentRevisionDetail_revision fields. |
Files not reviewed (10)
- react/src/generated/AdminDeploymentListPageQuery.graphql.ts: Language not supported
- react/src/generated/DeploymentAddRevisionModalAddMutation.graphql.ts: Language not supported
- react/src/generated/DeploymentAddRevisionModal_forkRevision.graphql.ts: Language not supported
- react/src/generated/DeploymentDetailPageQuery.graphql.ts: Language not supported
- react/src/generated/DeploymentListPageQuery.graphql.ts: Language not supported
- react/src/generated/DeploymentReplicasTabListQuery.graphql.ts: Language not supported
- react/src/generated/DeploymentRevisionDetail_revision.graphql.ts: Language not supported
- react/src/generated/DeploymentRevisionHistoryTabActivateMutation.graphql.ts: Language not supported
- react/src/generated/DeploymentRevisionHistoryTabListQuery.graphql.ts: Language not supported
- react/src/generated/ProjectAdminDeploymentsPageQuery.graphql.ts: Language not supported
Comments suppressed due to low confidence (1)
react/src/components/DeploymentAddRevisionModal.tsx:900
prefillFromCurrentRevisioncurrently castscurrentRevisiontoDeploymentAddRevisionModal_forkRevision$dataviaas unknown as .... This removes type safety and can mask schema/selection drift (e.g., if either query stops selecting a needed field, prefill silently degrades). Consider introducing a small shared structural type (as described in the PR summary) and typingapplyRevisionPrefillagainst it so bothcurrentRevisionandforkRevisionDatacan be passed without an unsafe cast.
const prefillFromCurrentRevision = () => {
if (!currentRevision) return;
applyRevisionPrefill(
currentRevision as unknown as DeploymentAddRevisionModal_forkRevision$data,
);
};
b8a6cf8 to
5a9fd07
Compare
64eb682 to
e0bb951
Compare
yomybaby
left a comment
There was a problem hiding this comment.
The expression 'fork' does not seem appropriate. A revision of the expression is needed. Also, let's reconsider if solving this function in this way is right.
e0bb951 to
15d8fe5
Compare
- Add a "Duplicate as new revision" overflow action in the revision detail drawer (next to the Apply button) and in each revision history table row menu - Clicking "Duplicate as new revision" opens the Add Revision modal pre-filled with the selected revision's full configuration (cluster config, resources, image, environment variables, model definition, extra mounts) - Refactor `prefillFromCurrentRevision` into a generic `applyRevisionPrefill(rev)` function so duplicate prefill and current-revision prefill share the same code path - Add `runtimeVariantId` and `resourceConfig` to the `DeploymentRevisionDetail_revision` fragment to support full prefill - Add i18n key `deployment.DuplicateAsNewRevision` (all 21 languages) Per review feedback on PR #7561: "fork" was inaccurate (no branching/parallel timeline — the new revision still lands on the same linear history), renamed to "Duplicate as new revision" / "이 리비전 복제". Icon `BranchesOutlined` → `CopyOutlined`. Fragment `DeploymentAddRevisionModal_forkRevision` → `_duplicateRevision`. Also fixes stray `,,` JSON syntax error introduced in i18n files.
15d8fe5 to
5c4b93f
Compare
- Add a "Duplicate as new revision" overflow action in the revision detail drawer (next to the Apply button) and in each revision history table row menu - Clicking "Duplicate as new revision" opens the Add Revision modal pre-filled with the selected revision's full configuration (cluster config, resources, image, environment variables, model definition, extra mounts) - Refactor `prefillFromCurrentRevision` into a generic `applyRevisionPrefill(rev)` function so duplicate prefill and current-revision prefill share the same code path - Add `runtimeVariantId` and `resourceConfig` to the `DeploymentRevisionDetail_revision` fragment to support full prefill - Add i18n key `deployment.DuplicateAsNewRevision` (all 21 languages) Per review feedback on PR #7561: "fork" was inaccurate (no branching/parallel timeline — the new revision still lands on the same linear history), renamed to "Duplicate as new revision" / "이 리비전 복제". Icon `BranchesOutlined` → `CopyOutlined`. Fragment `DeploymentAddRevisionModal_forkRevision` → `_duplicateRevision`. Also fixes stray `,,` JSON syntax error introduced in i18n files.
2bdfc6c to
0ac2b91
Compare
- Add a "Duplicate as new revision" overflow action in the revision detail drawer (next to the Apply button) and in each revision history table row menu - Clicking "Duplicate as new revision" opens the Add Revision modal pre-filled with the selected revision's full configuration (cluster config, resources, image, environment variables, model definition, extra mounts) - Refactor `prefillFromCurrentRevision` into a generic `applyRevisionPrefill(rev)` function so duplicate prefill and current-revision prefill share the same code path - Add `runtimeVariantId` and `resourceConfig` to the `DeploymentRevisionDetail_revision` fragment to support full prefill - Add i18n key `deployment.DuplicateAsNewRevision` (all 21 languages) Per review feedback on PR #7561: "fork" was inaccurate (no branching/parallel timeline — the new revision still lands on the same linear history), renamed to "Duplicate as new revision" / "이 리비전 복제". Icon `BranchesOutlined` → `CopyOutlined`. Fragment `DeploymentAddRevisionModal_forkRevision` → `_duplicateRevision`. Also fixes stray `,,` JSON syntax error introduced in i18n files.
1b84a66 to
3ba8330
Compare
0ac2b91 to
126a939
Compare
126a939 to
7f1a475
Compare
|
@yomybaby Thanks for the feedback — both concerns are now addressed: Naming. The action was first renamed away from "fork" to "duplicate as new revision", and now further refined to "Add new revision from this" / "이 리비전으로 추가" so the verb matches the modal that opens (Add Revision). This avoids the confusion of clicking "Duplicate"/"Fork" and being shown an Add modal. Architecture. The Browser-verified both entry points (table row "More" + revision-detail drawer "More"): the Could you re-review when convenient? |
- Add a "Duplicate as new revision" overflow action in the revision detail drawer (next to the Apply button) and in each revision history table row menu - Clicking "Duplicate as new revision" opens the Add Revision modal pre-filled with the selected revision's full configuration (cluster config, resources, image, environment variables, model definition, extra mounts) - Refactor `prefillFromCurrentRevision` into a generic `applyRevisionPrefill(rev)` function so duplicate prefill and current-revision prefill share the same code path - Add `runtimeVariantId` and `resourceConfig` to the `DeploymentRevisionDetail_revision` fragment to support full prefill - Add i18n key `deployment.DuplicateAsNewRevision` (all 21 languages) Per review feedback on PR #7561: "fork" was inaccurate (no branching/parallel timeline — the new revision still lands on the same linear history), renamed to "Duplicate as new revision" / "이 리비전 복제". Icon `BranchesOutlined` → `CopyOutlined`. Fragment `DeploymentAddRevisionModal_forkRevision` → `_duplicateRevision`. Also fixes stray `,,` JSON syntax error introduced in i18n files.
3ba8330 to
3274d43
Compare
7f1a475 to
bfb7ba1
Compare
- Add a "Duplicate as new revision" overflow action in the revision detail drawer (next to the Apply button) and in each revision history table row menu - Clicking "Duplicate as new revision" opens the Add Revision modal pre-filled with the selected revision's full configuration (cluster config, resources, image, environment variables, model definition, extra mounts) - Refactor `prefillFromCurrentRevision` into a generic `applyRevisionPrefill(rev)` function so duplicate prefill and current-revision prefill share the same code path - Add `runtimeVariantId` and `resourceConfig` to the `DeploymentRevisionDetail_revision` fragment to support full prefill - Add i18n key `deployment.DuplicateAsNewRevision` (all 21 languages) Per review feedback on PR #7561: "fork" was inaccurate (no branching/parallel timeline — the new revision still lands on the same linear history), renamed to "Duplicate as new revision" / "이 리비전 복제". Icon `BranchesOutlined` → `CopyOutlined`. Fragment `DeploymentAddRevisionModal_forkRevision` → `_duplicateRevision`. Also fixes stray `,,` JSON syntax error introduced in i18n files.
bfb7ba1 to
cc80b05
Compare
3274d43 to
7623f0e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 33 changed files in this pull request and generated 2 comments.
Files not reviewed (10)
- react/src/generated/AdminDeploymentListPageQuery.graphql.ts: Language not supported
- react/src/generated/DeploymentAddRevisionModalAddMutation.graphql.ts: Language not supported
- react/src/generated/DeploymentDetailPageQuery.graphql.ts: Language not supported
- react/src/generated/DeploymentListPageQuery.graphql.ts: Language not supported
- react/src/generated/DeploymentReplicasTabListQuery.graphql.ts: Language not supported
- react/src/generated/DeploymentRevisionDetail_revision.graphql.ts: Language not supported
- react/src/generated/DeploymentRevisionHistoryTabActivateMutation.graphql.ts: Language not supported
- react/src/generated/DeploymentRevisionHistoryTabListQuery.graphql.ts: Language not supported
- react/src/generated/DeploymentRevisionHistoryTab_deployment.graphql.ts: Language not supported
- react/src/generated/ProjectAdminDeploymentsPageQuery.graphql.ts: Language not supported
Merge activity
|
…rawer (#7561) Resolves #7560 (FR-2957) > **Stacked on #7602 (FR-2977).** The base PR refactors `DeploymentAddRevisionModal` to an id-based revision source. This top PR is a thin layer on top of that — menu items, i18n, icon, and the parent state that drives `sourceRevisionId`. The bulk of the original FR-2957 diff (fragment definition, dual `useEffectEvent` state pump, fragment-ref prop drilling) moved into FR-2977 in cleaner form. ## Summary - Add an **Add new revision from this** overflow action in the revision detail drawer (next to the Apply button) and in each revision history table row menu - On click, set `sourceRevisionId` on `DeploymentAddRevisionModal` so the modal opens locked to Custom mode and auto-prefills with that revision's full configuration (handled by FR-2977's machinery) - Add i18n key `deployment.AddNewRevisionFromThis` (all 21 languages) - Use `CopyOutlined` (not a branching icon) — the action copies settings into a new linear revision; it does not fork or branch the history ## Test plan - [ ] Open a deployment's revision history; verify "Add new revision from this" appears in each row's overflow menu - [ ] Open a revision detail drawer; verify the "More" (⋯) overflow next to Apply shows "Add new revision from this" - [ ] Click it — verify the Add Revision modal opens in Custom mode pre-filled with that revision's configuration (Model Folder, Runtime, image, resources, env vars, mounts) - [ ] Submit the Add Revision flow — verify a new revision is created at the linear end of the history (no branching) - [ ] Confirm the Apply button (rollback) still works as before ## Screenshots > Note: the screenshots below were captured against an earlier label ("Duplicate as new revision"). The shipped copy is **"Add new revision from this"** (`deployment.AddNewRevisionFromThis`); the layout and behavior are unchanged. | Row overflow menu | Revision detail drawer (Apply + ⋯) | Pre-filled Add Revision modal | |---|---|---| |  |  |  | The drawer header groups **Apply** with a **More (⋯)** overflow (`Space.Compact`, both primary), matching the established convention from `DeploymentConfigurationSection`. Selecting **Add new revision from this** sets `sourceRevisionId` on the modal; FR-2977's `revision(id:)` + single-effect prefill applies the values. ## What this PR no longer contains (moved to FR-2977) - The `DeploymentAddRevisionModal_duplicateRevision` fragment (replaced by `DeploymentAddRevisionModal_revisionSource` in the base PR) - The `pendingDuplicatePrefill` state + the two `useEffectEvent`s (replaced by a single derived `effectiveMode` + single apply effect in the base PR) - The fragment ref `useState` and `...DeploymentAddRevisionModal_duplicateRevision` spread on the list query (removed; the modal resolves source via id)

Resolves #7560 (FR-2957)
Summary
sourceRevisionIdonDeploymentAddRevisionModalso the modal opens locked to Custom mode and auto-prefills with that revision's full configuration (handled by FR-2977's machinery)deployment.AddNewRevisionFromThis(all 21 languages)CopyOutlined(not a branching icon) — the action copies settings into a new linear revision; it does not fork or branch the historyTest plan
Screenshots
The drawer header groups Apply with a More (⋯) overflow (
Space.Compact, both primary), matching the established convention fromDeploymentConfigurationSection. Selecting Add new revision from this setssourceRevisionIdon the modal; FR-2977'srevision(id:)+ single-effect prefill applies the values.What this PR no longer contains (moved to FR-2977)
DeploymentAddRevisionModal_duplicateRevisionfragment (replaced byDeploymentAddRevisionModal_revisionSourcein the base PR)pendingDuplicatePrefillstate + the twouseEffectEvents (replaced by a single derivedeffectiveMode+ single apply effect in the base PR)useStateand...DeploymentAddRevisionModal_duplicateRevisionspread on the list query (removed; the modal resolves source via id)