ENG-2516: Add shared clean_version utility for version string sanitization#7345
Open
ENG-2516: Add shared clean_version utility for version string sanitization#7345
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Add a shared clean_version() function to fides.common.utils that removes noisy suffixes from version strings for cleaner display. This strips: - dirty suffix (.dirty or -dirty) from uncommitted changes - +0.gXXXXXX suffix when exactly on a tag Update fides/__init__.py to import and use the shared utility. Add comprehensive unit tests for the clean_version function. Co-authored-by: Cursor <cursoragent@cursor.com>
9b02f5e to
4d0ea22
Compare
Co-authored-by: Cursor <cursoragent@cursor.com>
4d0ea22 to
16e98e1
Compare
Contributor
Greptile OverviewGreptile SummaryRefactored version string cleaning by extracting the
Confidence Score: 4/5
Important Files Changed
|
adamsachs
approved these changes
Feb 11, 2026
Contributor
adamsachs
left a comment
There was a problem hiding this comment.
nice followup. i assume you'll want a fidesplus PR to switch to using this util, right?
Contributor
Author
Yeah, that one goes here: https://github.com/ethyca/fidesplus/pull/3082 I'm just going to let the dust settle on our current release before merging those two in. |
- scripts/run_lib_tests.sh: runner that configures local Postgres/Redis via env vars - IMPLEMENTATION-REPORT.md: documents setup, what worked, and what didn't Requires: PostgreSQL, Redis, uv, Python 3.13. Services must be running locally. Co-authored-by: Neville Samuell <NevilleS@users.noreply.github.com>
Document what passes (lib, noxfiles) and what partially passes or fails across api, ctl, ops, service, task, util, qa, integration. Include common failure patterns: env var leakage, taxonomy seeding, Docker hostnames. Co-authored-by: Neville Samuell <NevilleS@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket ENG-2516
Description Of Changes
In this PR https://github.com/ethyca/fidesplus/pull/3047 we added a
clean_version()function to fidesplus to clean up the sometimes-messy version numbers for displaying in the API. This refactors that approach by moving thatclean_version()function tofides.common.utils, which enables fidesplus to import and reuse this utility rather than duplicating the code.Code Changes
clean_version()function tosrc/fides/common/utils.pythat strips:.dirtyor-dirty) added when there are uncommitted changes+0.gXXXXXXsuffix when exactly on a git tag (zero commits past)src/fides/__init__.pyto importclean_versionfromcommon.utilsinstead of defining it locallytests/lib/test_version.pySteps to Confirm
clean_versioncan be imported fromfides.common.utilsnox -s "pytest(lib)" -- tests/lib/test_version.pyto verify tests passPre-Merge Checklist
CHANGELOG.mdupdatedMade with Cursor