Skip to content

Conversation

@llucax
Copy link
Contributor

@llucax llucax commented Jun 16, 2025

  • Fix wrong comparison for mike versions when versions were equal.
  • Fix version regex escaping of .. This means that a version like v0x1e1 were accepted as valid semver versions. Now this version is not considered a semver version anymore.

@llucax llucax added this to the v0.13.5 milestone Jun 16, 2025
@llucax llucax self-assigned this Jun 16, 2025
Copilot AI review requested due to automatic review settings June 16, 2025 08:50
@llucax llucax requested a review from a team as a code owner June 16, 2025 08:50
@llucax llucax added the type:bug Something isn't working label Jun 16, 2025
@llucax llucax enabled auto-merge June 16, 2025 08:50
@github-actions github-actions bot added the part:tests Affects the unit, integration and performance (benchmarks) tests label Jun 16, 2025
Copy link

Copilot AI left a 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 like v0x1e1 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)

@github-actions github-actions bot added the part:template Affects the cookiecutter template files label Jun 16, 2025
Marenz
Marenz previously approved these changes Jun 16, 2025
llucax added 3 commits June 16, 2025 12:55
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]>
@llucax
Copy link
Contributor Author

llucax commented Jun 16, 2025

Rebased to fix conflicts and added a commit to prepare the release notes for the release.

@llucax llucax requested a review from Marenz June 16, 2025 10:57
@llucax llucax merged commit 0da3bdb into frequenz-floss:v0.13.x Jun 16, 2025
5 checks passed
@llucax llucax deleted the fix-versions branch June 16, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:template Affects the cookiecutter template files part:tests Affects the unit, integration and performance (benchmarks) tests type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants