Skip to content

Refactor Fides initialization code#6143

Merged
gilluminate merged 4 commits intomainfrom
gill/init-utils
May 14, 2025
Merged

Refactor Fides initialization code#6143
gilluminate merged 4 commits intomainfrom
gill/init-utils

Conversation

@gilluminate
Copy link
Copy Markdown
Contributor

@gilluminate gilluminate commented May 13, 2025

Description Of Changes

Refactored Fides initialization code to reduce duplication and improve maintainability. Created a new utility file to centralize common initialization logic used across multiple Fides entry points.

Code Changes

  • Split out automated consent to its own file, since it's getting rather large on its own and has a very specific purpose/use case.
  • Created new lib/init-utils.ts file to centralize common initialization functions
  • Moved repeated initialization code to shared utility functions
  • Reorganized utility functions into appropriate modules

Steps to Confirm

  1. As this is all refactor work, all unit and Cypress tests passing should confirm the work

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
  • 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
Copy Markdown
Contributor

vercel Bot commented May 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fides-privacy-center ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2025 6:29pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview May 13, 2025 6:29pm

Copy link
Copy Markdown
Contributor

@eastandwestwind eastandwestwind left a comment

Choose a reason for hiding this comment

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

Really nice @gilluminate ! This reduces a lot of duplicate code and will reduce chance of bugs while working with this area 🌟

As far as I can see, this is a pure refactor, and no changes have been made as far as timing of when various parts of the init lifecycle happens. But correct me if I'm wrong there.

@gilluminate gilluminate merged commit c37d2c9 into main May 14, 2025
17 checks passed
@gilluminate gilluminate deleted the gill/init-utils branch May 14, 2025 17:34
@cypress
Copy link
Copy Markdown

cypress Bot commented May 14, 2025

fides    Run #12925

Run Properties:  status check passed Passed #12925  •  git commit c37d2c9256: Refactor Fides initialization code (#6143)
Project fides
Branch Review main
Run status status check passed Passed #12925
Run duration 00m 54s
Commit git commit c37d2c9256: Refactor Fides initialization code (#6143)
Committer Jason Gill
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 5
View all changes introduced in this branch ↗︎

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