-
Notifications
You must be signed in to change notification settings - Fork 505
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
Fix version comparison in VerifyLatestUpdate #3223
Fix version comparison in VerifyLatestUpdate #3223
Conversation
Signed-off-by: Marko Mudrinić <[email protected]>
/test pull-release-integration-test |
Unfortunately the linter does not seem to be happy with this change. /lgtm cancel |
Signed-off-by: Marko Mudrinić <[email protected]>
78c8377
to
23c723f
Compare
/retest |
@saschagrunert The linter issue should be fixed now. |
/retest |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cpanato, saschagrunert, xmudrii The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Revert "Merge pull request #3223 from xmudrii/fix-release-comparison"
Fixing the very specific use case of the failing semver comparison mentioned in kubernetes/kubernetes#117115 Follow-up on kubernetes#3223 and kubernetes#3254 Signed-off-by: Sascha Grunert <[email protected]>
Fixing the very specific use case of the failing semver comparison mentioned in kubernetes/kubernetes#117115 Follow-up on kubernetes#3223 and kubernetes#3254 Signed-off-by: Sascha Grunert <[email protected]>
Fixing the very specific use case of the failing semver comparison mentioned in kubernetes/kubernetes#117115 Follow-up on kubernetes#3223 and kubernetes#3254 Signed-off-by: Sascha Grunert <[email protected]>
What type of PR is this?
/kind bug
What this PR does / why we need it:
We observed that version markers are not getting updated properly on many occasions which is documented in kubernetes/kubernetes#117115
This issue appears when the version marker is supposed to switch from prerelease (rc) to stable. For example:
v1.28.0-rc.1.9+3fb5377b25ec51
->v1.28.0-7+c4e17abb04728e
is not going to happen even though left version is lower than right version.The reason for that is that both
v1.28.0-rc.1.9+3fb5377b25ec51
andv1.28.0-7+c4e17abb04728e
are considered as "prereleases" byblang/semver
library. Version is modeled as:v1.28.0-rc.1.9+3fb5377b25ec51
v1.28.0-7+c4e17abb04728e
Comparing versions includes comparing elements in both prerelease slices and that doesn't behave as we would expect in this case.
Given this logic, we always know that:
prerelease
sliceprerelease
sliceThis can be used when comparing the version to properly switch from prerelease (rc) to stable.
There might be a better approach, but I didn't find such an approach from the
blang/semver
documentation. Unit tests are added to cover various cases and ensure that this still works as expected.Which issue(s) this PR fixes:
Fixes kubernetes/kubernetes#117115
Does this PR introduce a user-facing change?
/assign @saschagrunert @puerco @jeremyrickard
cc @kubernetes/release-engineering
/hold for discussion