feat(FR-2685): migrate VFolder selector queries to Strawberry V2 GraphQL API#6933
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
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
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🟢 | Statements | 81.87% | 429/524 |
| 🟡 | Branches | 70.43% | 362/514 |
| 🟡 | Functions | 76.86% | 93/121 |
| 🟢 | Lines | 83.19% | 391/470 |
Test suite run success
319 tests passing in 13 suites.
Report generated by 🧪jest coverage report action from d217feb
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 8.66% | 1857/21450 |
| 🔴 | Branches | 7.85% | 1187/15112 |
| 🔴 | Functions | 5.09% | 295/5792 |
| 🔴 | Lines | 8.4% | 1749/20821 |
Test suite run success
865 tests passing in 40 suites.
Report generated by 🧪jest coverage report action from d217feb
There was a problem hiding this comment.
Pull request overview
Migrates vfolder selection and related folder queries from the legacy V1 vfolder_nodes + filter-string approach to the Strawberry V2 GraphQL API using structured VFolderFilter.
Changes:
- Update vfolder selectors to use V2
myVfolders/projectVfoldersand accept structuredVFolderFilterinstead of string filters. - Replace selected-value resolution logic with aliased
vfolderV2(vfolderId:)lookups (fixed slots) due to V2 filter limitations. - Migrate folder-name availability check to V2
myVfolders(count).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| react/src/components/VFolderMountFormItem.tsx | Switch auto-mount folder lookup to V2 projectVfolders with structured VFolderFilter; update prop typing accordingly. |
| react/src/components/ImportArtifactRevisionToFolderModal.tsx | Remove legacy V1 filter-string usage; rely on currentProjectId scoping to V2 projectVfolders. |
| react/src/components/AdminModelCardSettingModal.tsx | Remove legacy ownership_type == "group" filter-string; rely on V2 project scoping. |
| packages/backend.ai-ui/src/hooks/useGetAvailableFolderName.ts | Migrate availability check to V2 myVfolders(count) using structured filter conditions. |
| packages/backend.ai-ui/src/components/fragments/BAIVFolderSelect.tsx | Major migration: V2 filters, V2 pagination (myVfolders/projectVfolders), and aliased selected-value resolution via vfolderV2. |
| packages/backend.ai-ui/src/components/fragments/BAIVFolderSelect.stories.tsx | Update Storybook mocks/docs for V2 vfolder shape and V2 query behavior. |
1b1afab to
367890c
Compare
5c25214 to
dd9c9c0
Compare
367890c to
25bbf35
Compare
dd9c9c0 to
dd0f151
Compare
25bbf35 to
4282f19
Compare
4282f19 to
e5290d8
Compare
4c583dc to
28763bc
Compare
e5290d8 to
0a342fb
Compare
28763bc to
6ac89aa
Compare
0a342fb to
5ae9335
Compare
6ac89aa to
0e57b15
Compare
5ae9335 to
46ee67e
Compare
0e57b15 to
38e8ec3
Compare
b549ca7 to
aa4ced0
Compare
4732fe4 to
d960843
Compare
346d02d to
e4794f7
Compare
666bee0 to
d25a561
Compare
b1ce201 to
5d022da
Compare
b89b540 to
7144e82
Compare
5d022da to
7e77dd0
Compare
7144e82 to
edce67f
Compare
ba66b17 to
d514862
Compare
a854196 to
6fd1340
Compare
3b98b9c to
362174f
Compare
6fd1340 to
48c0e92
Compare
…hQL API Resolves #6929(FR-2685) ## Summary - Migrate `BAIVFolderSelect`, `useGetAvailableFolderName`, `VFolderMountFormItem` (auto-mount section), and the two caller-side filters in `AdminModelCardSettingModal` / `ImportArtifactRevisionToFolderModal` from the Graphene V1 `vfolder_nodes` query to the Strawberry V2 `myVfolders` / `projectVfolders` / `vfolderV2` API. - The paginated list routes to `projectVfolders` when `currentProjectId` is set, otherwise `myVfolders` — matching the V1 `scope_id` behavior. - Search and status-exclusion semantics are preserved via `VFolderFilter` (`name.iContains` for search, `status.notIn DELETE_*` for `excludeDeleted`). The `filter` prop is now a structured `VFolderFilter` (previously a V1 filter string). - Preselected-value resolution uses up to 10 aliased `vfolderV2(vfolderId:)` lookups gated by `@include` booleans, since `VFolderFilter` does not expose an id filter. Values beyond that fall back to paginated name resolution or the raw id label. - `BAIVFolderSelect.stories.tsx` mock shapes are updated to the V2 `{ id, status, metadata.name }` form for both `myVfolders` and `projectVfolders`. ## Caller adjustments - `AdminModelCardSettingModal` and `ImportArtifactRevisionToFolderModal` previously passed V1 filter strings (`ownership_type == "group"`, `group == "<id>"`). These clauses are redundant under V2 because `projectVfolders` already scopes results to project-owned folders; `VFolderFilter` does not expose `ownershipType` or `projectId`. The model-store modal now scopes via `currentProjectId={modelStoreProject.id}`. ## Part of Epic FR-2572 — Migrate WebUI to Strawberry V2 GraphQL API. ## Verification - `bash scripts/verify.sh` → `=== ALL PASS ===`
362174f to
d217feb
Compare
48c0e92 to
46c7c65
Compare

resolves #NNN (FR-MMM)
Checklist: (if applicable)