fix(FR-2646): align RoleDetailDrawer queries with updated schema#6882
Conversation
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 | 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
There was a problem hiding this comment.
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.roleIdusages to the newUUIDFiltershape ({ equals: ... }). - Adjust
RoleScopeTabfragment root field selection (aliasingadminRole). - Refresh
data/schema.graphqlwith 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). |
e4675bb to
26990f9
Compare
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
26990f9 to
db84a8e
Compare

Resolves FR-2646 — GraphQL schema update broke
RoleDetailDrawer.Summary
The backend schema update changed
RoleAssignmentFilter.roleIdfromUUIDtoUUIDFilter. This:RoleDetailDrawer.tsx(error TS2559).RoleAssignmentTab.tsxrefetch path (TypeScript missed it becauseGraphQLFilteris typed[key: string]: any).Fields "adminRole" conflict because they have differing arguments.— caused byRoleScopeTabFragmentand the parent query both callingadminRole(id: …)at the top level.Changes
data/schema.graphql— sync with backend 26.4.3+ (RoleAssignmentFilter.roleId→UUIDFilter, plus newprojectId/createdUserId/imageId/modelVfolderIdfilter fields on unrelated inputs).react/src/components/RoleDetailDrawer.tsx— wraproleIdin{ equals: localRoleId }so it conforms to the newUUIDFiltertype.react/src/components/RoleAssignmentTab.tsx— same wrap in the refetch path.react/src/components/RoleScopeTab.tsx— alias the inneradminRole(id: $roleId)toscopeRole: adminRole(id: $roleId)so the server validator stops flagging it as conflicting with the outeradminRole(id: $id)call. Two data-access sites (data.adminRole→data.scopeRole) updated accordingly.Verification
bash scripts/verify.sh→=== ALL PASS ===RoleDetailDrawerQuerywith the two calls differentiated: outeradminRole(id: $id)and innerscopeRole: adminRole(id: $id)."Fields adminRole conflict"validation error from the backend.Checklist
/rbacand verify the detail drawer loadse2e/rbac/rbac-role-detail.spec.ts(currentlytest.fixmed pending separate work) exercises this flow