Skip to content

fix(FR-2914): scope deployment add-revision model folder picker to current project#7465

Open
agatha197 wants to merge 1 commit into
mainfrom
fix/FR-2914-add-revision-model-folder-current-project
Open

fix(FR-2914): scope deployment add-revision model folder picker to current project#7465
agatha197 wants to merge 1 commit into
mainfrom
fix/FR-2914-add-revision-model-folder-current-project

Conversation

@agatha197
Copy link
Copy Markdown
Contributor

@agatha197 agatha197 commented May 18, 2026

Resolves #7464 (FR-2914)

Summary

  • Switch both the preset-mode and advanced (custom)-mode model folder pickers in DeploymentAddRevisionModal from BAIProjectVfolderSelect (which forces the MODEL_STORE project) to BAIVFolderSelect scoped to the user's current project.
  • Call signature: 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).
  • BAIVFolderSelect works in GlobalID space (VirtualFolderNode:<uuid>), so prefill now wraps rev.modelMountConfig.vfolderId with toGlobalId('VirtualFolderNode', ...) and submit unwraps it back with toLocalId(values.modelFolderId) to get the dashed UUID the backend expects. The old convertToUUID call is dropped.
  • The advanced tab's VFolderTableFormItem also needs modelFolderIdNoDash to be a real UUID, so the String(modelFolderId).replace(/-/g, '') path is replaced with safeDecodeUuid(...)?.replace(/-/g, '') to decode the GlobalID first.
  • Drop the now-dead deployment.metadata.projectId field from the query.
  • (Drive-by) Remove the unused Alert import from VFolderNodes.tsx so the pre-commit lint-staged hook (eslint --max-warnings=0 over ./src) does not block the commit.

Test plan

  • Open the "Add Revision" modal from a deployment detail page and verify that the Preset tab's Model Folder dropdown lists vfolders from the user's current project.
  • In the same modal, verify the Advanced (custom) tab lists the same set of current-project vfolders.
  • In both modes, pick a vfolder, fill in preset/custom inputs, and confirm Add succeeds (the submit payload's vfolderId should be a plain dashed UUID).
  • In the Advanced tab, hit "Load current revision" and confirm the existing revision's vfolder is prefilled correctly.
  • In the Advanced tab, confirm the model file picker (VFolderTableFormItem) still renders the selected vfolder's file list.

@github-actions github-actions Bot added the size:S 10~30 LoC label May 18, 2026
Copy link
Copy Markdown
Contributor Author

agatha197 commented May 18, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of 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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.51% 1785 / 27379
🔵 Statements 5.36% 1980 / 36910
🔵 Functions 5.25% 296 / 5634
🔵 Branches 3.74% 1293 / 34569
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/components/DeploymentAddRevisionModal.tsx 0% 0% 0% 0% 130-1629
react/src/components/VFolderNodes.tsx 0% 0% 0% 0% 51-691
Generated in workflow #842 for commit 86bd35a by the Vitest Coverage Report Action

@agatha197 agatha197 force-pushed the fix/FR-2914-add-revision-model-folder-current-project branch from 6c9f7ff to bdb1ea9 Compare May 18, 2026 09:31
@github-actions github-actions Bot added size:M 30~100 LoC and removed size:S 10~30 LoC labels May 18, 2026
@agatha197 agatha197 force-pushed the fix/FR-2914-add-revision-model-folder-current-project branch from bdb1ea9 to 806865e Compare May 18, 2026 09:36
@github-actions github-actions Bot added size:L 100~500 LoC and removed size:M 30~100 LoC labels May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Coverage Report for backend-ai-ui-coverage (./packages/backend.ai-ui)

Status Category Percentage Covered / Total
🔵 Lines 8.03% 362 / 4506
🔵 Statements 7.17% 411 / 5728
🔵 Functions 8.93% 94 / 1052
🔵 Branches 6.36% 362 / 5690
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/backend.ai-ui/src/components/fragments/BAIVFolderSelect.tsx 0% 0% 0% 0% 52-375
Generated in workflow #833 for commit 44be402 by the Vitest Coverage Report Action

@agatha197 agatha197 force-pushed the fix/FR-2914-add-revision-model-folder-current-project branch from 806865e to 44be402 Compare May 18, 2026 10:12
@agatha197 agatha197 marked this pull request as ready for review May 18, 2026 10:12
Copilot AI review requested due to automatic review settings May 18, 2026 10:12
@agatha197 agatha197 marked this pull request as draft May 18, 2026 10:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 BAIProjectVfolderSelect with BAIVFolderSelect in both preset and custom add-revision modes.
  • Removes unused deployment metadata.projectId query field.
  • Allows BAIVFolderSelect consumers to override labelRender; removes an unused Alert import.

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 currentProjectId is null/undefined, BAIVFolderSelect receives no scopeId and falls back to an unscoped vfolder_nodes query, 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 until currentProjectId is 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: READY constraint. With only excludeDeleted, folders in states such as PERFORMING, CLONING, or ERROR are still returned by vfolder_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, include status == "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"'

Comment thread react/src/components/DeploymentAddRevisionModal.tsx
Comment thread react/src/components/DeploymentAddRevisionModal.tsx
@agatha197 agatha197 force-pushed the fix/FR-2914-add-revision-model-folder-current-project branch from 44be402 to 50a17a6 Compare May 18, 2026 16:09
@github-actions github-actions Bot added size:M 30~100 LoC and removed size:L 100~500 LoC labels May 18, 2026
@agatha197 agatha197 requested review from ironAiken2 and yomybaby May 18, 2026 16:43
@agatha197 agatha197 marked this pull request as ready for review May 18, 2026 16:43
@agatha197 agatha197 force-pushed the fix/FR-2914-add-revision-model-folder-current-project branch from 50a17a6 to 0d20384 Compare May 18, 2026 16:48
@agatha197 agatha197 force-pushed the fix/FR-2914-add-revision-model-folder-current-project branch from 0d20384 to 86bd35a Compare May 18, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scope deployment add-revision model folder picker to current project

2 participants