Skip to content

Conversation

@erosselli
Copy link
Contributor

@erosselli erosselli commented Nov 6, 2025

Ticket ENG-1868

Description Of Changes

Adds Admin UI support for the Fides v3 API by updating the next config (to include v3 routing) and the store.ts file.

Steps to Confirm

  1. N/A , will be used in follow-up PR

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@vercel
Copy link

vercel bot commented Nov 6, 2025

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

Project Deployment Preview Comments Updated (UTC)
fides-plus-nightly Ready Ready Preview Comment Nov 7, 2025 7:52pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
fides-privacy-center Ignored Ignored Nov 7, 2025 7:52pm

@erosselli erosselli marked this pull request as ready for review November 6, 2025 19:15
@erosselli erosselli requested a review from a team as a code owner November 6, 2025 19:15
@erosselli erosselli requested review from jpople and removed request for a team November 6, 2025 19:15
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

This PR adds Admin UI support for the Fides v3 API by creating a new RTK Query API slice for v3 endpoints and adding proxy configuration in Next.js.

Changes:

  • Created new v3Api slice with consent preference endpoints (savePrivacyPreferences, getCurrentPreferences)
  • Added v3 API proxy rewrites in next.config.js to route /api/v3/* requests to the backend server
  • Integrated v3Api reducer and middleware into the Redux store

Issue:

  • The v3Api.reducerPath is missing from the persist blacklist, which could cause phantom subscriptions from cached API data

Confidence Score: 4/5

  • This PR is safe to merge after fixing the persist blacklist issue
  • The implementation follows the existing pattern for API slices (similar to healthApi), but missing v3Api from the persist blacklist could cause issues with phantom subscriptions. Once fixed, the changes are straightforward and low-risk.
  • clients/admin-ui/src/app/store.ts requires adding v3Api to the persist blacklist

Important Files Changed

File Analysis

Filename Score Overview
clients/admin-ui/src/features/poc/privacy-notices-sandbox/v3-api.ts 4/5 Created v3 API slice with consent endpoints - missing v3Api from persist blacklist
clients/admin-ui/src/app/store.ts 4/5 Added v3Api reducer and middleware - missing v3Api.reducerPath from persist blacklist

Additional Comments (1)

  1. clients/admin-ui/src/app/store.ts, line 139-143 (link)

    logic: v3Api.reducerPath should be added to the blacklist to prevent the api cache from being persisted and restored, which could cause phantom subscriptions

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@tvandort tvandort left a comment

Choose a reason for hiding this comment

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

Do we need to change our env vars in our env file after this is merged?

Comment on lines 16 to 23
export interface ConsentPreferenceCreate {
notice_key: string;
notice_history_id: string;
value: "opt_in" | "opt_out" | "acknowledge";
experience_config_history_id?: string | null;
meta?: Record<string, any> | null;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Are these automatically generated? Will they be in the future if they are not right now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

these weren't but I think they should be. Maybe I need to run that type generation thing somewhere

Comment on lines +59 to +70
export const v3Api = createApi({
reducerPath: "v3Api",
baseQuery: fetchBaseQuery({
baseUrl: "/api/v3",
prepareHeaders: (headers, { getState }) => {
const { token } = (getState() as RootState).auth;
addCommonHeaders(headers, token);
return headers;
},
}),
endpoints: () => ({}),
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worthwhile to colocate this with api.slice.ts as I suspect it might live longer than we expect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

also answering the question

Do we need to change our env vars in our env file after this is merged?

I don't see why you would, I didn't need to change any env vars

Comment on lines +38 to +46
// V3 API proxying for consent sandbox
{
source: `/api/v3/:path`,
destination: `${process.env.NEXT_PUBLIC_FIDESCTL_API_SERVER}/api/v3/:path`,
},
{
source: `/api/v3/:first/:second*`,
destination: `${process.env.NEXT_PUBLIC_FIDESCTL_API_SERVER}/api/v3/:first/:second*`,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have a notion for why this is needed? I know we're mirroring what was done for v1 api (which is good) but I'm curious why both of these proxies are necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no idea 😆 I hadn't noticed there were two until you pointed it out 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

Went down a bit of a Git history rabbit hole and it looks like they may not be both necessary anymore-- this was because of #690, which should have been resolved by #886. Given that the slash handling was removed in #5111 I think a single :path* should work for both.

@erosselli erosselli added this pull request to the merge queue Nov 7, 2025
Merged via the queue into main with commit 352b980 Nov 7, 2025
46 of 47 checks passed
@erosselli erosselli deleted the erosselli/ENG-1868-add-v3-api branch November 7, 2025 20:14
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.

4 participants