fides icon indicating copy to clipboard operation
fides copied to clipboard

Use visioneer to set PC/FidesJS version

Open gilluminate opened this issue 7 months ago • 2 comments

Description Of Changes

Automatically inject versioneer-generated version into the Privacy Center and FidesJS build processes. The docker build system replaces a __RELEASE_VERSION__ placeholder in next.config.js with the actual Git-based version during Docker build, ensuring version consistency across the entire application stack. It also writes to the version.json file for FidesJS to pick up and use during the rollup build process.

Code Changes

  • Added Docker build stage to extract version using versioneer
  • Modified built_frontend stage to replace __RELEASE_VERSION__ placeholder with actual version as well as write it to the version.json file
  • Changed hardcoded version in privacy-center/next.config.js from "1.2.3" to __RELEASE_VERSION__ placeholder
  • Added window.Fides.version property to fides.js bundle for client-side version access
  • Added console.info to Privacy Center to log the version on every page load.
  • Updated smoke test to verify version replacement functionality

Steps to Confirm

  1. Build the Docker image and verify version extraction: docker build --target version_extractor -t test-version . && docker run --rm test-version cat /version.txt
  2. Build and run the privacy center: docker build --target prod_pc -t test-pc . && docker run -d -p 3000:3000 test-pc
  3. Load the Privacy Center on http://localhost:3000 and check the console log
  4. Load the PC demo page and check the window.Fides.version value

Pre-Merge Checklist

  • [x] Issue requirements met
  • [ ] All CI pipelines succeeded
  • [x] CHANGELOG.md updated
    • [ ] Add a https://github.com/ethyca/fides/labels/db-migration label to the entry if your change includes a DB migration
    • [ ] Add a https://github.com/ethyca/fides/labels/high-risk 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
    • [x] 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!
    • [x] 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
    • [x] No documentation updates required

gilluminate avatar Jun 17 '25 23:06 gilluminate

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

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview Jul 18, 2025 3:00pm
fides-privacy-center ⬜️ Ignored (Inspect) Jul 18, 2025 3:00pm

vercel[bot] avatar Jun 17 '25 23:06 vercel[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.77%. Comparing base (e6449d8) to head (78f0f1f). Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6239   +/-   ##
=======================================
  Coverage   86.77%   86.77%           
=======================================
  Files         448      448           
  Lines       28607    28607           
  Branches     3178     3178           
=======================================
  Hits        24823    24823           
  Misses       3050     3050           
  Partials      734      734           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Jun 19 '25 18:06 codecov[bot]

fides    Run #13133

Run Properties:  status check passed Passed #13133  •  git commit 0d44233a3a: Use versioneer to set PC/FidesJS version (#6239)
Project fides
Branch Review main
Run status status check passed Passed #13133
Run duration 00m 50s
Commit git commit 0d44233a3a: Use versioneer to set PC/FidesJS version (#6239)
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 ↗︎

cypress[bot] avatar Jul 18 '25 15:07 cypress[bot]