feat(FR-2862): add preset mode for deployment revision creation#7350
Conversation
8b53b30 to
d07caa2
Compare
39b98b4 to
f011f2c
Compare
d07caa2 to
6d245d1
Compare
There was a problem hiding this comment.
Pull request overview
Implements FR-2862 “Deployment Revision Preset Mode UX” across quick-deploy entry points and the add-revision flow, adding a Preset/Custom mode switch with persisted user preference and supporting UI empty states.
Changes:
- Extend quick deploy to support both VFolder and Model Card contexts via
useDeploymentLauncher. - Add Preset/Custom mode switching (persisted in user settings) to
DeploymentAddRevisionModal, including Preset→Custom transfer prefill and explicit “Load current revision” action. - Add i18n strings for the new preset-mode UX across all supported locales and update the local GraphQL schema snapshot.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| react/src/hooks/useDeploymentLauncher.ts | Adds model-card quick deploy support and refactors Quick Deploy input shape. |
| react/src/hooks/useBAISetting.tsx | Persists per-user revision creation mode setting (deploymentRevisionCreationMode). |
| react/src/components/VFolderNodes.tsx | Wires empty-preset fallback to open DeploymentSettingModal. |
| react/src/components/VFolderNodesV2.tsx | Same as above for the V2 nodes surface. |
| react/src/components/VFolderDeployModal.tsx | Adds empty-preset inline guidance and adjusts post-deploy navigation behavior. |
| react/src/components/ModelCardDrawer.tsx | Enables model-card quick deploy and wires empty-preset fallback to DeploymentSettingModal. |
| react/src/components/ModelCardDeployModal.tsx | Adds empty-preset inline guidance and adjusts post-deploy navigation behavior. |
| react/src/components/DeploymentAddRevisionModal.tsx | Adds Preset/Custom segmented mode, persisted preference, preset→custom transfer, and explicit “Load current revision”. |
| data/schema.graphql | Updates local GraphQL schema snapshot (notably model-definition related input nullability). |
| resources/i18n/en.json | Adds new deployment preset-mode related strings. |
| resources/i18n/zh-TW.json | Adds new deployment preset-mode related strings. |
| resources/i18n/zh-CN.json | Adds new deployment preset-mode related strings. |
| resources/i18n/vi.json | Adds new deployment preset-mode related strings. |
| resources/i18n/tr.json | Adds new deployment preset-mode related strings. |
| resources/i18n/th.json | Adds new deployment preset-mode related strings. |
| resources/i18n/ru.json | Adds new deployment preset-mode related strings. |
| resources/i18n/pt.json | Adds new deployment preset-mode related strings. |
| resources/i18n/pt-BR.json | Adds new deployment preset-mode related strings. |
| resources/i18n/pl.json | Adds new deployment preset-mode related strings. |
| resources/i18n/ms.json | Adds new deployment preset-mode related strings. |
| resources/i18n/mn.json | Adds new deployment preset-mode related strings. |
| resources/i18n/ko.json | Adds new deployment preset-mode related strings. |
| resources/i18n/ja.json | Adds new deployment preset-mode related strings. |
| resources/i18n/it.json | Adds new deployment preset-mode related strings. |
| resources/i18n/id.json | Adds new deployment preset-mode related strings. |
| resources/i18n/fr.json | Adds new deployment preset-mode related strings. |
| resources/i18n/fi.json | Adds new deployment preset-mode related strings. |
| resources/i18n/es.json | Adds new deployment preset-mode related strings. |
| resources/i18n/el.json | Adds new deployment preset-mode related strings. |
| resources/i18n/de.json | Adds new deployment preset-mode related strings. |
6d245d1 to
e0f2e74
Compare
f011f2c to
9cba66c
Compare
3fd0291 to
4a9752b
Compare
c0fca8c to
e05d1cf
Compare
|
@nowgnuesLee Following up on the earlier feedback that the modal should use The The reason a local boundary was still needed somewhere is that Net effect: no Suspense in the modal layer, the page no longer suspends on mode switch, and the fallback is confined to the form section that's actually fetching. |
6f6a62e to
2d1e5f3
Compare
ironAiken2
left a comment
There was a problem hiding this comment.
If there is only one deployment preset, the deployment is created directly based on the preset without selecting it; however, this means that settings such as the resource group cannot be configured. Even if there is only one preset, it should be possible to select both the preset and the resource group.
ironAiken2
left a comment
There was a problem hiding this comment.
I don’t think there needs to be a ‘Create’ button within the notification. Personally, I think it would be better to include just a brief summary in the notification and display the details in the body of the modal. The ‘Create’ button could simply be labelled ‘배포 생성’ and placed next to the ‘Cancel’ button.
ironAiken2
left a comment
There was a problem hiding this comment.
When I click the 'Create Revision' button on the deployment details page, the page enters a state of suspense. The suspense related to fetching the necessary data in the modal should occur within the creation modal itself.
3b92854 to
d5362fa
Compare
2d1e5f3 to
4ae0e6e
Compare
|
@ironAiken2 Thanks for the careful review. Each of the four points has been addressed across this stack — the changes ended up across follow-up PRs in the stack so this PR's diff doesn't reflect them all. Summary: 1. Single-preset auto-deploy bypasses resource group selection 2. Modal footer has no border (UI consistency) 3. "Create" button placement / labelling in notification 4. Clicking "Create Revision" puts the parent page into Suspense Re-requesting your review when you have a moment. |
d5362fa to
af26e26
Compare
4ae0e6e to
848777e
Compare
af26e26 to
e7629e7
Compare
848777e to
da4c026
Compare
e7629e7 to
66c0579
Compare
da4c026 to
63ca4d7
Compare
Merge activity
|
Resolves #7347 (FR-2862) ## Test ``` 10.122.10.215 ``` `e2e-cpu-http-server` preset makes a helathy route. ## Summary Implements **M2** and **M3** of FR-2862 ("Deployment Revision Preset Mode UX"). ### M2 — VFolder Deploy: preset selector - `VFolderDeployModal` now requires a deployment-revision **preset**; resource group + replicas/openToPublic are still configurable but image/runtime/cluster/resources/env are sourced from the selected preset. - Submits via `deployVfolderV2` (single-shot deployment + initial revision) and polls the new endpoint until it appears in the v1 store. - Empty-preset state: shows a banner with a link that opens the deployment preset creation modal directly. - Entry points wired: `VFolderNodes`, `VFolderNodesV2`, `ModelCardDrawer`, `ModelCardDeployModal`. ### M3 — Add Revision: Preset / Custom modes - `DeploymentAddRevisionModal` now opens in **Preset mode** by default; an antd `Segmented` switches to **Custom mode** (the legacy advanced form). - Mode preference persists per-user via `useBAISettingUserState('deploymentRevisionCreationMode')`. - Preset → Custom carries the user's preset selection forward by reading an `@inline` Relay fragment with `readInlineData` and prefilling the custom form (cluster, image, runtime, resources, environ, replicas, public flag). - Removed the previous auto-prefill from the current revision. The Custom body now surfaces an `Alert` action ("Load current revision") that the user must click explicitly. The Alert is gated on the deployment having a current revision. ### Structural refactor - **Split** the previous monolithic `DeploymentAddRevisionFormContents.tsx` into two co-located bodies: - `DeploymentAddRevisionCustomContent.tsx` — Custom-mode form + `addModelRevision` mutation. - `DeploymentAddRevisionPresetContent.tsx` — Preset-mode form + `deployVfolderV2` mutation. Each body owns its own fragment, mutation, and form values type. The modal wrapper now only hosts the segmented control, the shared `useLazyLoadQuery`, and the Preset → Custom transfer bridge. - **Removed** the now-unused legacy `DeploymentLauncherPage` / `DeploymentLauncherPageContent` (≈2,000 lines), whose responsibilities are subsumed by the modal-based flows above. - **Validation guard**: explicit `form.validateFields().then(...)` immediately before each create/deploy mutation (`commitAdd` in Custom, `commitDeploy` in Preset) so the rule "validate before any deploy/commit mutation" holds at the mutation call site, not just at the `onFinish` boundary. The modal's `handleOk` also validates before `form.submit()`. ## Test plan - [ ] VFolder → Deploy: empty-presets banner opens the create-preset modal. - [ ] VFolder → Deploy: select a preset, submit; endpoint detail page opens after the v1 store catches up. - [ ] Deployment detail → Add revision: opens in Preset mode by default. - [ ] Switch Preset → Custom: carry-over preset values appear in the custom form. - [ ] Toggle Preset ⇄ Custom multiple times; persisted mode survives reload. - [ ] Custom mode: clicking "Load current revision" prefills the form; modal opened with no current revision hides the Alert. - [ ] Preset / Custom: submitting with an invalid field scrolls to the first error and does not fire the mutation.
66c0579 to
2dd95fa
Compare
63ca4d7 to
ccb8d84
Compare



Resolves #7347 (FR-2862)
Test
e2e-cpu-http-serverpreset makes a helathy route.Summary
Implements M2 and M3 of FR-2862 ("Deployment Revision Preset Mode UX").
M2 — VFolder Deploy: preset selector
VFolderDeployModalnow requires a deployment-revision preset; resource group + replicas/openToPublic are still configurable but image/runtime/cluster/resources/env are sourced from the selected preset.deployVfolderV2(single-shot deployment + initial revision) and polls the new endpoint until it appears in the v1 store.VFolderNodes,VFolderNodesV2,ModelCardDrawer,ModelCardDeployModal.M3 — Add Revision: Preset / Custom modes
DeploymentAddRevisionModalnow opens in Preset mode by default; an antdSegmentedswitches to Custom mode (the legacy advanced form).useBAISettingUserState('deploymentRevisionCreationMode').@inlineRelay fragment withreadInlineDataand prefilling the custom form (cluster, image, runtime, resources, environ, replicas, public flag).Alertaction ("Load current revision") that the user must click explicitly. The Alert is gated on the deployment having a current revision.Structural refactor
DeploymentAddRevisionFormContents.tsxinto two co-located bodies:DeploymentAddRevisionCustomContent.tsx— Custom-mode form +addModelRevisionmutation.DeploymentAddRevisionPresetContent.tsx— Preset-mode form +deployVfolderV2mutation.Each body owns its own fragment, mutation, and form values type. The modal wrapper now only hosts the segmented control, the shared
useLazyLoadQuery, and the Preset → Custom transfer bridge.DeploymentLauncherPage/DeploymentLauncherPageContent(≈2,000 lines), whose responsibilities are subsumed by the modal-based flows above.form.validateFields().then(...)immediately before each create/deploy mutation (commitAddin Custom,commitDeployin Preset) so the rule "validate before any deploy/commit mutation" holds at the mutation call site, not just at theonFinishboundary. The modal'shandleOkalso validates beforeform.submit().Test plan