fix(FR-2914): scope deployment add-revision model folder picker to current project#7465
fix(FR-2914): scope deployment add-revision model folder picker to current project#7465agatha197 wants to merge 1 commit into
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
|
||||||||||||||||||||||||||||||||||||||||||||
6c9f7ff to
bdb1ea9
Compare
bdb1ea9 to
806865e
Compare
Coverage Report for backend-ai-ui-coverage (./packages/backend.ai-ui)
File Coverage
|
||||||||||||||||||||||||||||||||||||||
806865e to
44be402
Compare
There was a problem hiding this comment.
Pull request overview
This PR scopes the deployment add-revision model folder picker to the active project instead of the model-store project, aligning the flow with current-project deployment behavior.
Changes:
- Replaces
BAIProjectVfolderSelectwithBAIVFolderSelectin both preset and custom add-revision modes. - Removes unused deployment
metadata.projectIdquery field. - Allows
BAIVFolderSelectconsumers to overridelabelRender; removes an unusedAlertimport.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
react/src/components/DeploymentAddRevisionModal.tsx |
Updates model folder selection to use current project vfolders and removes dead query field. |
packages/backend.ai-ui/src/components/fragments/BAIVFolderSelect.tsx |
Adds support for caller-provided labelRender. |
react/src/components/VFolderNodes.tsx |
Removes unused Alert import. |
Comments suppressed due to low confidence (2)
react/src/components/DeploymentAddRevisionModal.tsx:1337
- If
currentProjectIdis null/undefined,BAIVFolderSelectreceives noscopeIdand falls back to an unscopedvfolder_nodesquery, which can list folders outside the active project. The previous picker was disabled until its project id existed; keep the same guard here (for example, disable or avoid rendering the select untilcurrentProjectIdis available) so the add-revision picker cannot briefly expose/select cross-project folders.
<BAIVFolderSelect
currentProjectId={currentProjectId ?? undefined}
excludeDeleted
filter='usage_mode == "model"'
react/src/components/DeploymentAddRevisionModal.tsx:1337
- This replacement drops the previous
status: READYconstraint. With onlyexcludeDeleted, folders in states such asPERFORMING,CLONING, orERRORare still returned byvfolder_nodes, so the user can select a model folder that is not ready to be mounted for the revision. Keep the ready-status filter (for example, includestatus == "READY"with the usage-mode filter) to preserve the old behavior and match the launcher’s ready-only model folder picker.
excludeDeleted
filter='usage_mode == "model"'
44be402 to
50a17a6
Compare
50a17a6 to
0d20384
Compare
0d20384 to
86bd35a
Compare

Resolves #7464 (FR-2914)
Summary
DeploymentAddRevisionModalfromBAIProjectVfolderSelect(which forces the MODEL_STORE project) toBAIVFolderSelectscoped to the user's current project.currentProjectId={useCurrentProjectValue().id},filter='usage_mode == "model"',excludeDeleted. The add-revision flow is part of an existing deployment in the user's active project, so listing the user's current-project vfolders is the natural choice and matches the rest of the model-deployment UI (ServiceLauncherPageContent,ModelCardDeployModal).BAIVFolderSelectworks in GlobalID space (VirtualFolderNode:<uuid>), so prefill now wrapsrev.modelMountConfig.vfolderIdwithtoGlobalId('VirtualFolderNode', ...)and submit unwraps it back withtoLocalId(values.modelFolderId)to get the dashed UUID the backend expects. The oldconvertToUUIDcall is dropped.VFolderTableFormItemalso needsmodelFolderIdNoDashto be a real UUID, so theString(modelFolderId).replace(/-/g, '')path is replaced withsafeDecodeUuid(...)?.replace(/-/g, '')to decode the GlobalID first.deployment.metadata.projectIdfield from the query.Alertimport fromVFolderNodes.tsxso the pre-commit lint-staged hook (eslint --max-warnings=0over./src) does not block the commit.Test plan
vfolderIdshould be a plain dashed UUID).VFolderTableFormItem) still renders the selected vfolder's file list.