-
Notifications
You must be signed in to change notification settings - Fork 8
Fix missing comparison for equal versions #415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes two issues in the Mike version comparator: it corrects regex patterns to properly escape dots and adds handling for equal versions.
- Updated Mike version regexes to escape
.
so non-semver strings likev0x1e1
are no longer accepted. - Introduced a direct equality check in
compare_mike_version
for non-semver versions. - Added test cases for equal and malformed-version comparisons and updated release notes.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tests/mkdocs/test_mike.py | Added tests for equal non-semver versions and malformed semver |
src/frequenz/repo/config/mkdocs/mike.py | Escaped . in regexes and added version equality check |
RELEASE_NOTES.md | Documented both bug fixes |
Comments suppressed due to low confidence (1)
tests/mkdocs/test_mike.py:268
- Missing test for semver-equal versions. Add a case like ("v1.0", "v1.0", 0) to verify that equal semver inputs return 0.
("v1.0", "v1.0", 0)
Signed-off-by: Leandro Lucarella <[email protected]>
This means that a version like v0x1e1 were accepted as valid semver versions. Now this version is not considered a semver version anymore. Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
Rebased to fix conflicts and added a commit to prepare the release notes for the release. |
mike
versions when versions were equal..
. This means that a version like v0x1e1 were accepted as valid semver versions. Now this version is not considered a semver version anymore.