Skip to content

feat(FR-2685): migrate VFolder selector queries to Strawberry V2 GraphQL API#6933

Draft
ironAiken2 wants to merge 1 commit into04-21-feat_fr-2573_migrate_vfolder_list_queries_to_strawberry_v2_graphql_apifrom
04-23-feat_fr-2685_migrate_vfolder_selector_queries_to_strawberry_v2_graphql_api
Draft

feat(FR-2685): migrate VFolder selector queries to Strawberry V2 GraphQL API#6933
ironAiken2 wants to merge 1 commit into04-21-feat_fr-2573_migrate_vfolder_list_queries_to_strawberry_v2_graphql_apifrom
04-23-feat_fr-2685_migrate_vfolder_selector_queries_to_strawberry_v2_graphql_api

Conversation

@ironAiken2
Copy link
Copy Markdown
Contributor

resolves #NNN (FR-MMM)

Checklist: (if applicable)

  • Documentation
  • Minium required manager version
  • Specific setting for review (eg., KB link, endpoint or how to setup)
  • Minimum requirements to check during review
  • Test case(s) to demonstrate the difference of before/after

Copy link
Copy Markdown
Contributor Author

ironAiken2 commented Apr 23, 2026

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.
Learn more


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 Apr 23, 2026

Coverage report for ./packages/backend.ai-ui

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 23, 2026

Coverage report for ./react

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

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

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 / projectVfolders and accept structured VFolderFilter instead 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.

Comment thread packages/backend.ai-ui/src/components/fragments/BAIVFolderSelect.tsx Outdated
Comment thread packages/backend.ai-ui/src/components/fragments/BAIVFolderSelect.stories.tsx Outdated
@ironAiken2 ironAiken2 force-pushed the 04-23-feat_fr-2685_migrate_vfolder_selector_queries_to_strawberry_v2_graphql_api branch from 1b1afab to 367890c Compare April 23, 2026 04:15
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2619_migrate_single_folder_detail_reads_to_strawberry_v2_vfolderv2_query branch from 5c25214 to dd9c9c0 Compare April 23, 2026 04:35
@ironAiken2 ironAiken2 force-pushed the 04-23-feat_fr-2685_migrate_vfolder_selector_queries_to_strawberry_v2_graphql_api branch from 367890c to 25bbf35 Compare April 23, 2026 04:35
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2619_migrate_single_folder_detail_reads_to_strawberry_v2_vfolderv2_query branch from dd9c9c0 to dd0f151 Compare April 23, 2026 07:13
@ironAiken2 ironAiken2 force-pushed the 04-23-feat_fr-2685_migrate_vfolder_selector_queries_to_strawberry_v2_graphql_api branch from 25bbf35 to 4282f19 Compare April 23, 2026 07:13
@ironAiken2 ironAiken2 force-pushed the 04-23-feat_fr-2685_migrate_vfolder_selector_queries_to_strawberry_v2_graphql_api branch from 4282f19 to e5290d8 Compare April 23, 2026 07:59
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2619_migrate_single_folder_detail_reads_to_strawberry_v2_vfolderv2_query branch 2 times, most recently from 4c583dc to 28763bc Compare April 23, 2026 08:35
@ironAiken2 ironAiken2 force-pushed the 04-23-feat_fr-2685_migrate_vfolder_selector_queries_to_strawberry_v2_graphql_api branch from e5290d8 to 0a342fb Compare April 23, 2026 08:35
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2619_migrate_single_folder_detail_reads_to_strawberry_v2_vfolderv2_query branch from 28763bc to 6ac89aa Compare April 24, 2026 04:02
@ironAiken2 ironAiken2 force-pushed the 04-23-feat_fr-2685_migrate_vfolder_selector_queries_to_strawberry_v2_graphql_api branch from 0a342fb to 5ae9335 Compare April 24, 2026 04:02
@ironAiken2 ironAiken2 marked this pull request as draft April 24, 2026 04:04
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2619_migrate_single_folder_detail_reads_to_strawberry_v2_vfolderv2_query branch from 6ac89aa to 0e57b15 Compare April 24, 2026 04:45
@ironAiken2 ironAiken2 force-pushed the 04-23-feat_fr-2685_migrate_vfolder_selector_queries_to_strawberry_v2_graphql_api branch from 5ae9335 to 46ee67e Compare April 24, 2026 04:45
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2619_migrate_single_folder_detail_reads_to_strawberry_v2_vfolderv2_query branch from 0e57b15 to 38e8ec3 Compare April 24, 2026 06:03
@ironAiken2 ironAiken2 force-pushed the 04-23-feat_fr-2685_migrate_vfolder_selector_queries_to_strawberry_v2_graphql_api branch 2 times, most recently from b549ca7 to aa4ced0 Compare April 24, 2026 06:29
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2619_migrate_single_folder_detail_reads_to_strawberry_v2_vfolderv2_query branch 2 times, most recently from 4732fe4 to d960843 Compare April 24, 2026 06:36
@ironAiken2 ironAiken2 force-pushed the 04-23-feat_fr-2685_migrate_vfolder_selector_queries_to_strawberry_v2_graphql_api branch 2 times, most recently from 346d02d to e4794f7 Compare April 27, 2026 02:42
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2619_migrate_single_folder_detail_reads_to_strawberry_v2_vfolderv2_query branch 2 times, most recently from 666bee0 to d25a561 Compare April 27, 2026 04:19
@ironAiken2 ironAiken2 force-pushed the 04-23-feat_fr-2685_migrate_vfolder_selector_queries_to_strawberry_v2_graphql_api branch 2 times, most recently from b1ce201 to 5d022da Compare April 27, 2026 05:43
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2619_migrate_single_folder_detail_reads_to_strawberry_v2_vfolderv2_query branch 2 times, most recently from b89b540 to 7144e82 Compare April 27, 2026 06:57
@ironAiken2 ironAiken2 force-pushed the 04-23-feat_fr-2685_migrate_vfolder_selector_queries_to_strawberry_v2_graphql_api branch from 5d022da to 7e77dd0 Compare April 27, 2026 06:57
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2619_migrate_single_folder_detail_reads_to_strawberry_v2_vfolderv2_query branch from 7144e82 to edce67f Compare April 27, 2026 08:55
@ironAiken2 ironAiken2 force-pushed the 04-23-feat_fr-2685_migrate_vfolder_selector_queries_to_strawberry_v2_graphql_api branch 2 times, most recently from ba66b17 to d514862 Compare April 27, 2026 10:00
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2619_migrate_single_folder_detail_reads_to_strawberry_v2_vfolderv2_query branch 2 times, most recently from a854196 to 6fd1340 Compare April 28, 2026 02:03
@ironAiken2 ironAiken2 force-pushed the 04-23-feat_fr-2685_migrate_vfolder_selector_queries_to_strawberry_v2_graphql_api branch 2 times, most recently from 3b98b9c to 362174f Compare April 28, 2026 03:21
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2619_migrate_single_folder_detail_reads_to_strawberry_v2_vfolderv2_query branch from 6fd1340 to 48c0e92 Compare April 28, 2026 03:21
…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 ===`
@ironAiken2 ironAiken2 changed the base branch from 04-21-feat_fr-2619_migrate_single_folder_detail_reads_to_strawberry_v2_vfolderv2_query to graphite-base/6933 April 28, 2026 06:19
@ironAiken2 ironAiken2 force-pushed the 04-23-feat_fr-2685_migrate_vfolder_selector_queries_to_strawberry_v2_graphql_api branch from 362174f to d217feb Compare April 28, 2026 06:20
@ironAiken2 ironAiken2 changed the base branch from graphite-base/6933 to 04-21-feat_fr-2573_migrate_vfolder_list_queries_to_strawberry_v2_graphql_api April 28, 2026 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants