ENG-3339: Rename /access-policy to /access-policies (frontend)#8225
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
|
/code-review |
Updates all frontend URL strings in RTK Query slice endpoints, MSW mock handlers, and generated TypeScript API types to use the pluralised path.
8740aae to
d0cb739
Compare
There was a problem hiding this comment.
Code Review: PR #8225 — Rename /access-policy to /access-policies
This is a clean, mechanical rename that correctly pluralizes the API path across the frontend. The change is consistent and well-scoped.
What looks good
- All URL strings in
access-policies.slice.tsandagent-chat.slice.tshave been updated — GET list, GET by id, POST, PATCH, DELETE, reorder, and all preset sub-routes. - MSW mock handlers in both
handlers.tsandagent-chat-handlers.tsare fully aligned with the new paths. - The
urlliteral fields in the generatedtypes.tshave been updated. - Changelog entry is present and accurate.
- No missed occurrences found in the diff.
One concern
types.ts type names vs. URL literals — see the inline comment. The URL strings in types.ts were patched, but the type identifiers themselves (which encode the old path segment) were not regenerated. If this file is auto-generated from the fidesplus OpenAPI spec, a full regeneration via the generate-types workflow would be the cleaner approach and would also update the type names. If the file is hand-maintained, this is low-severity.
Coordination note
The frontend now calls plus/access-policies exclusively. This change is a no-op in isolation unless the backend has already been updated (or will be updated atomically). Worth confirming the backend rename landed in fidesplus before or alongside this PR to avoid a window of broken API calls in staging.
🔬 Codegraph: connected (50588 nodes)
💡 Write /code-review in a comment to re-run this review.
| size?: number; | ||
| }; | ||
| url: "/api/v1/plus/access-policy"; | ||
| url: "/api/v1/plus/access-policies"; |
There was a problem hiding this comment.
clients/admin-ui/src/types/api/types.ts:12713
The URL literal has been updated here (and in the other four hunks below), but the surrounding type names — listAccessPoliciesApiV1PlusAccessPolicyGetData, createAccessPolicyApiV1PlusAccessPolicyPostData, etc. — still embed AccessPolicy (derived from the old singular path segment) rather than AccessPolicies.
If this file is generated from the fidesplus OpenAPI spec (as the naming convention suggests), the correct fix is to regenerate it from the updated spec rather than patching only the URL strings. Regeneration would also rename the type identifiers to reflect the new path (e.g. ...ApiV1PlusAccessPoliciesGet...), keeping the type names consistent with the URL. If the file is intentionally hand-maintained, this is cosmetic and lower priority, but worth noting.
|
Good catch on the generated file concern — I ran the generator to check: it would pull in ~72 files / 1600+ lines of unrelated schema drift from main that has accumulated since types were last synced. That churn is out of scope for this rename PR. Worth noting: the URL literal fields in Keeping the targeted manual edit for now and will open a follow-up PR to do a full schema regeneration / types sync. |
Ticket ENG-3339
Description Of Changes
Updates all frontend URL strings to use the pluralised
/access-policiespath, matching the companion backend rename in ethyca/fidesplus.Accepted risk — no API versioning: These endpoints are not yet exposed to external clients. The Admin UI is the only consumer, and both the frontend and backend are updated atomically across these two PRs.
Code Changes
clients/admin-ui/src/features/access-policies/access-policies.slice.ts— all RTK Query endpoint URLs updated (plus/access-policy→plus/access-policies)clients/admin-ui/src/features/access-policies/agent-chat.slice.ts— agent endpoint URL updatedclients/admin-ui/src/mocks/access-policies/handlers.ts— all MSW mock handler URL patterns updatedclients/admin-ui/src/mocks/access-policies/agent-chat-handlers.ts— agent mock handler URL updatedclients/admin-ui/src/types/api/types.ts— generated TypeScript API type URL strings updatedSteps to Confirm
/access-policiesin the Admin UI → page loads, network tab showsGET /api/v1/plus/access-policiesreturning 200/access-policies/new→ editor loads,GET /api/v1/plus/controlscalled correctly/access-policies/controls→ controls list renders/api/v1/plus/access-policypath appear in the network tab on any of the above pagesPre-Merge Checklist
CHANGELOG.mdupdated — N/A, internal API path rename with no user-facing impact/access-policypath is not referenced in public docs