Skip to content

fix(FR-2646): align RoleDetailDrawer queries with updated schema#6882

Merged
graphite-app[bot] merged 1 commit intomainfrom
04-22-fix_fr-2646_align_roledetaildrawer_queries_with_updated_schema
Apr 22, 2026
Merged

fix(FR-2646): align RoleDetailDrawer queries with updated schema#6882
graphite-app[bot] merged 1 commit intomainfrom
04-22-fix_fr-2646_align_roledetaildrawer_queries_with_updated_schema

Conversation

@ironAiken2
Copy link
Copy Markdown
Contributor

@ironAiken2 ironAiken2 commented Apr 22, 2026

Resolves 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.roleIdUUIDFilter, 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.adminRoledata.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

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

Copilot AI review requested due to automatic review settings April 22, 2026 05:42
@github-actions github-actions Bot added the size:L 100~500 LoC label Apr 22, 2026
Copy link
Copy Markdown
Contributor Author

ironAiken2 commented Apr 22, 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 Apr 22, 2026

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements 8.6% 1757/20437
🔴 Branches 7.89% 1131/14338
🔴 Functions 5.14% 285/5545
🔴 Lines 8.32% 1649/19831

Test suite run success

856 tests passing in 39 suites.

Report generated by 🧪jest coverage report action from db84a8e

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 RBAC role detail UI’s Relay queries and the repo’s schema snapshot to match recent GraphQL schema changes (notably filter input shape updates).

Changes:

  • Update RoleAssignmentFilter.roleId usages to the new UUIDFilter shape ({ equals: ... }).
  • Adjust RoleScopeTab fragment root field selection (aliasing adminRole).
  • Refresh data/schema.graphql with updated “Added in …” annotations and new/updated schema fields.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
react/src/components/RoleScopeTab.tsx Updates the fragment root role field selection and downstream data access for scopes.
react/src/components/RoleDetailDrawer.tsx Updates query variables to match the new role assignment filter input shape.
react/src/components/RoleAssignmentTab.tsx Updates refetch filter construction to use UUIDFilter for roleId.
data/schema.graphql Updates schema snapshot (new filters/fields and version annotations).

Comment thread react/src/components/RoleScopeTab.tsx Outdated
@ironAiken2 ironAiken2 force-pushed the 04-22-fix_fr-2646_align_roledetaildrawer_queries_with_updated_schema branch from e4675bb to 26990f9 Compare April 22, 2026 06:57
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Apr 22, 2026

Merge activity

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
@graphite-app graphite-app Bot force-pushed the 04-22-fix_fr-2646_align_roledetaildrawer_queries_with_updated_schema branch from 26990f9 to db84a8e Compare April 22, 2026 07:01
@graphite-app graphite-app Bot merged commit db84a8e into main Apr 22, 2026
10 checks passed
@graphite-app graphite-app Bot deleted the 04-22-fix_fr-2646_align_roledetaildrawer_queries_with_updated_schema branch April 22, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants