Skip to content

ENG-3339: Rename /access-policy to /access-policies (frontend)#8225

Merged
thabofletcher merged 2 commits into
mainfrom
ENG-3339/rename-access-policy-to-plural
May 19, 2026
Merged

ENG-3339: Rename /access-policy to /access-policies (frontend)#8225
thabofletcher merged 2 commits into
mainfrom
ENG-3339/rename-access-policy-to-plural

Conversation

@thabofletcher
Copy link
Copy Markdown
Contributor

@thabofletcher thabofletcher commented May 18, 2026

Ticket ENG-3339

Description Of Changes

Updates all frontend URL strings to use the pluralised /access-policies path, 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-policyplus/access-policies)
  • clients/admin-ui/src/features/access-policies/agent-chat.slice.ts — agent endpoint URL updated
  • clients/admin-ui/src/mocks/access-policies/handlers.ts — all MSW mock handler URL patterns updated
  • clients/admin-ui/src/mocks/access-policies/agent-chat-handlers.ts — agent mock handler URL updated
  • clients/admin-ui/src/types/api/types.ts — generated TypeScript API type URL strings updated

Steps to Confirm

  1. Navigate to /access-policies in the Admin UI → page loads, network tab shows GET /api/v1/plus/access-policies returning 200
  2. Navigate to /access-policies/new → editor loads, GET /api/v1/plus/controls called correctly
  3. Navigate to /access-policies/controls → controls list renders
  4. Verify no requests to the old /api/v1/plus/access-policy path appear in the network tab on any of the above pages

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated — N/A, internal API path rename with no user-facing impact
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • No UX review needed — URL path rename, no visible UI changes
  • Followup issues:
    • No followup issues
  • Database migrations:
    • No migrations
  • Documentation:
    • No documentation updates required — /access-policy path is not referenced in public docs

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
fides-plus-nightly Ignored Ignored Preview May 18, 2026 7:12pm
fides-privacy-center Ignored Ignored May 18, 2026 7:12pm

Request Review

@thabofletcher
Copy link
Copy Markdown
Contributor Author

/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.
@thabofletcher thabofletcher force-pushed the ENG-3339/rename-access-policy-to-plural branch from 8740aae to d0cb739 Compare May 18, 2026 19:11
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

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.ts and agent-chat.slice.ts have been updated — GET list, GET by id, POST, PATCH, DELETE, reorder, and all preset sub-routes.
  • MSW mock handlers in both handlers.ts and agent-chat-handlers.ts are fully aligned with the new paths.
  • The url literal fields in the generated types.ts have 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";
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.

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.

@thabofletcher
Copy link
Copy Markdown
Contributor Author

Good catch on the generated file concern — types.ts is indeed auto-generated by @hey-api/openapi-ts.

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 types.ts (e.g. url: "/api/v1/plus/access-policy") are part of the hey-api generated client types, not the RTK Query slices that drive actual runtime calls. The runtime behaviour is already correct via the slice edits. The types.ts literals are used for TypeScript type-checking of the generated client, so having them stale causes a type inaccuracy but not a runtime breakage.

Keeping the targeted manual edit for now and will open a follow-up PR to do a full schema regeneration / types sync.

@github-actions
Copy link
Copy Markdown

Title Lines Statements Branches Functions
admin-ui Coverage: 9%
6.93% (3173/45766) 6.34% (1680/26489) 4.79% (650/13543)
fides-js Coverage: 78%
79.17% (1977/2497) 66.25% (1249/1885) 73.31% (349/476)
privacy-center Coverage: 85%
82.53% (364/441) 79.74% (189/237) 74.07% (60/81)

@thabofletcher thabofletcher marked this pull request as ready for review May 18, 2026 20:08
@thabofletcher thabofletcher requested a review from a team as a code owner May 18, 2026 20:08
@thabofletcher thabofletcher requested review from gilluminate and removed request for a team May 18, 2026 20:08
@thabofletcher thabofletcher added this pull request to the merge queue May 19, 2026
Merged via the queue into main with commit 36b402e May 19, 2026
51 checks passed
@thabofletcher thabofletcher deleted the ENG-3339/rename-access-policy-to-plural branch May 19, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants