ENG-2516: Add shared clean_version utility for version string sanitization #7345
+164
−2
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
Add a shared
clean_version()function tofides.common.utilsthat removes noisy suffixes from version strings for cleaner user-facing display. This 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