Skip to content

Conversation

gilluminate
Copy link
Contributor

@gilluminate gilluminate commented Jun 17, 2025

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

  • 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

Copy link

vercel bot commented Jun 17, 2025

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

@gilluminate gilluminate mentioned this pull request Jun 18, 2025
15 tasks
@gilluminate gilluminate requested a review from NevilleS June 18, 2025 00:01
Copy link
Contributor

@NevilleS NevilleS left a comment

Choose a reason for hiding this comment

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

This strategy looks very promising and I'm convinced there's a route here. Lots of suggestions 👍

@gilluminate gilluminate force-pushed the gill/versioning-3 branch 7 times, most recently from 206aab8 to 2757daa Compare June 19, 2025 17:55
Comment on lines +146 to +145
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

docker was giving warnings about the deprecated support here, so I cleaned that up

Copy link

codecov bot commented Jun 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

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           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Comment on lines +2 to +3
"version": "DEV",
"comment": "Do not edit this file directly. It will be replaced during the Docker build process by an autogenerated version.json containing the Fides Python package version."
Copy link
Contributor Author

Choose a reason for hiding this comment

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

❤️

@NevilleS NevilleS changed the title Use visioneer to set PC/FidesJS version Use versioneer to set PC/FidesJS version Jul 18, 2025
Copy link
Contributor

@NevilleS NevilleS left a comment

Choose a reason for hiding this comment

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

Let's try it out 👍

@gilluminate gilluminate merged commit 0d44233 into main Jul 18, 2025
45 checks passed
@gilluminate gilluminate deleted the gill/versioning-3 branch July 18, 2025 15:36
Copy link

cypress bot commented Jul 18, 2025

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 ↗︎

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