Skip to content

fix(FR-3037): version-gate project folder creation for managers without createVFolderInProject#7727

Open
nowgnuesLee wants to merge 1 commit into
mainfrom
fr-3037-vfolder-project-create-version-gate
Open

fix(FR-3037): version-gate project folder creation for managers without createVFolderInProject#7727
nowgnuesLee wants to merge 1 commit into
mainfrom
fr-3037-vfolder-project-create-version-gate

Conversation

@nowgnuesLee

@nowgnuesLee nowgnuesLee commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Resolves #7713 (FR-3037)

Problem

On main, creating a project folder from the admin/project Data page calls the GraphQL mutation createVFolderInProject (input CreateVFolderInScopeInput). Both symbols are Added in UNRELEASED and do not exist in Manager 26.4.3, so the whole operation fails GRAPHQL_VALIDATION_FAILED and project folder creation is fully broken on 26.4.3.

Fix

Version-gate the project-scoped mutation and fall back to the long-standing createVfolderV2 on older managers:

  1. packages/backend.ai-client/src/client.ts — add capability flag vfolder-create-in-scope, gated at isManagerVersionCompatibleWith('26.4.4rc6'), mirroring the existing rc4/rc6 precedents (rbac-element-type-filter, user-v2-extended-filter) in the same function.
  2. react/src/components/FolderCreateModalV2.tsxhandleOk branches:
    • isProjectFolder && supports('vfolder-create-in-scope')createVFolderInProject (enum-typed input), unchanged behavior on new managers.
    • otherwise → createVfolderV2 (Added in 26.4.2, present in 26.4.3) with projectId set for project folders. CreateVFolderV2Input.projectId exists since 26.4.2, so this creates a project-owned vfolder on 26.4.3.

createVfolderV2's lowercase usageMode/permission strings and the new path's GENERAL/READ_WRITE enums both map the UI's options correctly. Merely declaring the createVFolderInProject mutation hook is safe on 26.4.3 — the operation is only sent when committed, which the branch guards.

Notes

  • Gate threshold: 26.4.4rc6 errs intentionally high — the fallback is functionally equivalent and valid on any manager >= 26.4.2, so gating slightly above the real landing version only routes a few versions through the (working) fallback. ⚠️ Before merge, confirm with the manager team that createVFolderInProject ships in 26.4.4 final (same release as the rc6 user filters) so the gate can't mis-fire on a released manager lacking the symbol.

Verification

bash scripts/verify.sh — Relay / Lint (0 errors) / Format / TypeScript all PASS. (The pre-existing "Vite warmup paths" check fails on clean main too — unrelated to this change.)

Live verification against a 26.4.3 manager was not run from this environment (test manager 10.82.0.223 unreachable here).

@github-actions github-actions Bot added the size:S 10~30 LoC label Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

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

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.45% 1798 / 27849
🔵 Statements 5.24% 1994 / 38008
🔵 Functions 5.34% 300 / 5609
🔵 Branches 3.66% 1305 / 35561
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/components/FolderCreateModalV2.tsx 0% 0% 0% 0% 50-737
Generated in workflow #1496 for commit 70178bc by the Vitest Coverage Report Action

@nowgnuesLee nowgnuesLee marked this pull request as ready for review June 4, 2026 10:21
@nowgnuesLee nowgnuesLee requested review from agatha197 and Copilot and removed request for Copilot June 4, 2026 10:21
@nowgnuesLee nowgnuesLee requested a review from yomybaby June 4, 2026 10:22
@nowgnuesLee nowgnuesLee force-pushed the fr-3037-vfolder-project-create-version-gate branch from 13b2d94 to 75481a5 Compare June 4, 2026 10:23
Copilot AI review requested due to automatic review settings June 4, 2026 10:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 restores compatibility with Manager 26.4.3 by version-gating the project folder creation path: it uses the newer project-scoped GraphQL mutation only when the connected Manager is new enough, and otherwise falls back to the long-standing createVfolderV2 mutation (with projectId set) to keep project folder creation working.

Changes:

  • Add a new Backend.AI client capability flag (vfolder-create-in-scope) gated on Manager version >= 26.4.4rc6.
  • Branch FolderCreateModalV2’s create flow to use createVFolderInProject only when the capability is available; otherwise use createVfolderV2 with projectId for project-owned folders.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
react/src/components/FolderCreateModalV2.tsx Adds capability-gated branching between createVFolderInProject and the createVfolderV2 fallback (with projectId).
packages/backend.ai-client/src/client.ts Introduces the vfolder-create-in-scope feature flag, enabled on Manager versions >= 26.4.4rc6.

Comment thread react/src/components/FolderCreateModalV2.tsx
Comment thread react/src/components/FolderCreateModalV2.tsx

@agatha197 agatha197 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please check copilot reviews and resolve merge conflicts

@nowgnuesLee nowgnuesLee force-pushed the fr-3037-vfolder-project-create-version-gate branch from 75481a5 to 70178bc Compare June 5, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project folder creation fails on Manager 26.4.3: createVFolderInProject mutation / CreateVFolderInScopeInput type missing

3 participants