Skip to content

fix(FR-2651): list all model-store folders when creating a model card#6888

Open
agatha197 wants to merge 3 commits into04-22-chore_fr-2622_add_i18n_translations_for_delete-folder_optionfrom
04-22-fix_fr-2651_list_all_model-store_folders_when_creating_a_model_card
Open

fix(FR-2651): list all model-store folders when creating a model card#6888
agatha197 wants to merge 3 commits into04-22-chore_fr-2622_add_i18n_translations_for_delete-folder_optionfrom
04-22-fix_fr-2651_list_all_model-store_folders_when_creating_a_model_card

Conversation

@agatha197
Copy link
Copy Markdown
Contributor

@agatha197 agatha197 commented Apr 22, 2026

Resolves #6884(FR-2651)

Problem

On /admin-serving?tab=model-store, clicking Create Model Card opens a modal whose model-storage folder picker is scoped to the currently active project. Since this is a platform-admin operation, switching projects should not hide model-store folders that belong to other projects — but today it does.

Fix

In AdminModelCardSettingModal.tsx, stop passing currentProjectId to BAIVFolderSelect so the underlying vfolder_nodes query uses scopeId: undefined (system-wide) instead of scopeId: project:{id}. Also add usage_mode == "model" to the filter so only model-mode folders are listed, preserving the existing ownership_type == "group" constraint.

This matches the precedent in LegacyModelTryContentButton.tsx, which queries model-storage folders without a project scope and with a usage_mode == "model" filter.

Scope

Data-scope fix only — no visual/UI change. No screenshots needed; the change is a query-variable adjustment.

Acceptance Criteria

  • Switching projects does not change the folder list in the Create Model Card modal (scope is no longer project-bound).
  • Only folders with usage_mode == "model" are listed.
  • Existing ownership_type == "group" filtering behavior is preserved.

Verification

bash scripts/verify.sh=== ALL PASS === (Relay, Lint, Format, TypeScript).

Copilot AI review requested due to automatic review settings April 22, 2026 07:38
@github-actions github-actions Bot added the size:XS ~10 LoC label Apr 22, 2026
Copy link
Copy Markdown
Contributor Author

agatha197 commented Apr 22, 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.

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

Updates the model-card creation modal’s vfolder selector so that “model-store” folders are included in the selectable list when creating a model card.

Changes:

  • Adjusted the BAIVFolderSelect filter to include usage_mode == "model".
  • Removed currentProjectId scoping from the vfolder selector, expanding the query scope beyond the current project.

Comment thread react/src/components/AdminModelCardSettingModal.tsx Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
9.01% (-0% 🔻)
1857/20617
🔴 Branches 8.18% 1187/14514
🔴 Functions
5.28% (-0% 🔻)
295/5586
🔴 Lines
8.74% (-0% 🔻)
1749/20003

Test suite run success

865 tests passing in 40 suites.

Report generated by 🧪jest coverage report action from fd4eab0

Copy link
Copy Markdown
Contributor

@ironAiken2 ironAiken2 left a comment

Choose a reason for hiding this comment

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

https://app.graphite.com/github/pr/lablup/backend.ai-webui/6531/e2e(FR-2504)-add-E2E-tests-for-RBAC-role-management
As the changes to the test code resulting from the RBAC schema update have already been merged into the main branch, I don’t think we need to cover them in this PR.

Comment thread react/src/components/AdminModelCardSettingModal.tsx Outdated
@agatha197 agatha197 force-pushed the 04-22-fix_fr-2651_list_all_model-store_folders_when_creating_a_model_card branch from 444c84b to d223d37 Compare April 23, 2026 11:49
@agatha197 agatha197 force-pushed the 04-22-chore_fr-2622_add_i18n_translations_for_delete-folder_option branch from 6c672c8 to 476ff80 Compare April 23, 2026 11:49
@github-actions github-actions Bot added size:XS ~10 LoC and removed size:XL 500~ LoC labels Apr 23, 2026
@agatha197 agatha197 force-pushed the 04-22-fix_fr-2651_list_all_model-store_folders_when_creating_a_model_card branch from d223d37 to aa7fa8e Compare April 24, 2026 05:05
@github-actions github-actions Bot added size:S 10~30 LoC and removed size:XS ~10 LoC labels Apr 24, 2026
@agatha197
Copy link
Copy Markdown
Contributor Author

Addressed feedback from @ironAiken2: the RBAC schema-alignment changes referenced in the review body (from #6882) were already merged to main and are not part of this PR's diff — no action needed here.

@agatha197 agatha197 requested a review from ironAiken2 April 24, 2026 05:06
@agatha197 agatha197 force-pushed the 04-22-fix_fr-2651_list_all_model-store_folders_when_creating_a_model_card branch from aa7fa8e to 342c0ad Compare April 24, 2026 05:16
@agatha197 agatha197 force-pushed the 04-22-chore_fr-2622_add_i18n_translations_for_delete-folder_option branch 2 times, most recently from 68c2b2f to ad1c94d Compare April 24, 2026 07:53
@agatha197 agatha197 force-pushed the 04-22-fix_fr-2651_list_all_model-store_folders_when_creating_a_model_card branch from 342c0ad to 00a4c36 Compare April 24, 2026 07:53
@agatha197 agatha197 requested a review from yomybaby April 24, 2026 08:07
Copy link
Copy Markdown
Contributor

@ironAiken2 ironAiken2 left a comment

Choose a reason for hiding this comment

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

LGTM

@agatha197 agatha197 force-pushed the 04-22-fix_fr-2651_list_all_model-store_folders_when_creating_a_model_card branch from 00a4c36 to 3b46628 Compare April 28, 2026 06:45
@agatha197 agatha197 force-pushed the 04-22-chore_fr-2622_add_i18n_translations_for_delete-folder_option branch from ad1c94d to 605faec Compare April 28, 2026 06:45
Copy link
Copy Markdown
Contributor

@ironAiken2 ironAiken2 left a comment

Choose a reason for hiding this comment

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

image.png

Entering the model card name is mandatory, not optional.

Copy link
Copy Markdown
Contributor Author

I think this is for 04-22-fix__add_delete-folder_option_and_trash_notification_on_model_card_deletion branch. I'll check it. Please just check this pr make get all model-store folders or not.

@agatha197 agatha197 requested a review from ironAiken2 April 28, 2026 07:57
ironAiken2 and others added 3 commits April 28, 2026 16:59
Resolves [FR-2646](https://lablup.atlassian.net/browse/FR-2646) — GraphQL schema update broke `RoleDetailDrawer`.

## Summary

The backend schema update changed `RoleAssignmentFilter.roleId` from `UUID` to `UUIDFilter`. This:
1. Broke TypeScript compile in `RoleDetailDrawer.tsx` (`error TS2559`).
2. Introduced a latent runtime failure in `RoleAssignmentTab.tsx` refetch path (TypeScript missed it because `GraphQLFilter` is typed `[key: string]: any`).
3. Surfaced a related server-side validation error when loading the role detail drawer: `Fields "adminRole" conflict because they have differing arguments.` — caused by `RoleScopeTabFragment` and the parent query both calling `adminRole(id: …)` at the top level.

## Changes

- **`data/schema.graphql`** — sync with backend 26.4.3+ (`RoleAssignmentFilter.roleId` → `UUIDFilter`, plus new `projectId`/`createdUserId`/`imageId`/`modelVfolderId` filter fields on unrelated inputs).
- **`react/src/components/RoleDetailDrawer.tsx`** — wrap `roleId` in `{ equals: localRoleId }` so it conforms to the new `UUIDFilter` type.
- **`react/src/components/RoleAssignmentTab.tsx`** — same wrap in the refetch path.
- **`react/src/components/RoleScopeTab.tsx`** — alias the inner `adminRole(id: $roleId)` to `scopeRole: adminRole(id: $roleId)` so the server validator stops flagging it as conflicting with the outer `adminRole(id: $id)` call. Two data-access sites (`data.adminRole` → `data.scopeRole`) updated accordingly.

## Verification

- `bash scripts/verify.sh` → `=== ALL PASS ===`
- Relay compile regenerates `RoleDetailDrawerQuery` with the two calls differentiated: outer `adminRole(id: $id)` and inner `scopeRole: adminRole(id: $id)`.
- Role detail drawer opens without the `"Fields adminRole conflict"` validation error from the backend.

## Checklist

- [x] Documentation: N/A (bug fix, no user-facing behavior change)
- [x] Minimum required manager version: needs manager exposing the updated schema (26.4.3+)
- [x] Specific setting for review: open any role in `/rbac` and verify the detail drawer loads
- [x] Minimum requirements to check during review: TypeScript passes; role detail drawer loads without GraphQL validation error
- [x] Test case(s): existing `e2e/rbac/rbac-role-detail.spec.ts` (currently `test.fixme`d pending separate work) exercises this flow

[FR-2646]: https://lablup.atlassian.net/browse/FR-2646?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
@agatha197 agatha197 force-pushed the 04-22-chore_fr-2622_add_i18n_translations_for_delete-folder_option branch from 605faec to 8178dc1 Compare April 28, 2026 08:00
@agatha197 agatha197 force-pushed the 04-22-fix_fr-2651_list_all_model-store_folders_when_creating_a_model_card branch from 3b46628 to fd4eab0 Compare April 28, 2026 08:00
Copy link
Copy Markdown
Contributor

@ironAiken2 ironAiken2 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10~30 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model Store: always fetch all model-store folders regardless of current project when creating a model card

3 participants