-
Notifications
You must be signed in to change notification settings - Fork 154
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 the handling of pre-releases and the 0.0.0 release edge case #70
Conversation
0.0.0-alpha < 0.0.0-beta < 0.0.0 per the semver spec at http://semver.org. The resolver ignores pre-release versions unless the comparator has a pre-release. This change adds tests for the cases around 0.0.0 along with fixing incorrect evaluations
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.
@mattfarina I'm quite confused in general about this still, and I'm not confident on how the removed code were supposed to work and how it will work after it was removed. But all but one test made sense to me, see comment.
{">0", "0.0.1-alpha", false}, | ||
{">0.0", "0.0.1-alpha", false}, | ||
{">0-0", "0.0.1-alpha", true}, | ||
{">0.0-0", "0.0.1-alpha", true}, |
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.
I'm curious to know if the following test cases also succeed. They should right?
{">0.0.0", "0.0.1-alpha", false},
{">0.0.0-0", "0.0.1-alpha", true},
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.
Yes.
{">=0.0-0", "0.0.1-alpha", true}, | ||
{">=0", "0.0.0-alpha", false}, | ||
{">=0-0", "0.0.0-alpha", true}, | ||
{"<0", "0.0.0-alpha", false}, |
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.
Confused about this test ({"<0", "0.0.0-alpha", false}
), especially because {">=0", "0.0.0-alpha", false}
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.
Without a pre-release in the comparator (e.g., <0
, >=0
) you'll find all pre-release values are ignored. That's why they are false.
Since Helm uses `Masterminds/semver` previous `kubeVersion` fields without any additional alphanumeric characters after the version would cause installs to fail on GKE and EKS. Since Masterminds/semver#70, we should now be able pass the pre-install check since ` 1.13.0-gke-version` < `1.13.0-0 `, `1.13.0-eks-version` < `1.13.0-0`, and `1.13.0` < `1.13.0-0`.
* Add back kubeVersion Since Helm uses `Masterminds/semver` previous `kubeVersion` fields without any additional alphanumeric characters after the version would cause installs to fail on GKE and EKS. Since Masterminds/semver#70, we should now be able pass the pre-install check since ` 1.13.0-gke-version` < `1.13.0-0 `, `1.13.0-eks-version` < `1.13.0-0`, and `1.13.0` < `1.13.0-0`. * Adding changleog entry * Adding ticks to changelog entry * Temporarily enable nighly acc tests for this PR * Revert "Temporarily enable nighly acc tests for this PR" This reverts commit d99dd97. * Update CHANGELOG.md Co-authored-by: Iryna Shustava <[email protected]> * Update CHANGELOG.md Co-authored-by: Iryna Shustava <[email protected]> Co-authored-by: Iryna Shustava <[email protected]> Co-authored-by: Iryna Shustava <[email protected]>
0.0.0-alpha < 0.0.0-beta < 0.0.0 per the semver spec at
http://semver.org. The resolver ignores pre-release versions
unless the comparator has a pre-release. This change adds tests
for the cases around 0.0.0 along with fixing incorrect evaluations