-
Notifications
You must be signed in to change notification settings - Fork 12
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
[JENKINS-51594] Test behavior of snapshots vs. RCs, JEP-229 #6
Conversation
@@ -48,10 +48,6 @@ | |||
* <p> | |||
* 'SNAPSHOT' is also allowed as a component, and "N.SNAPSHOT" is interpreted as "N-1.*" | |||
* | |||
* <pre> | |||
* 2.0.* < 2.0.1 < 2.0.1-SNAPSHOT < 2.0.0.99 < 2.0.0 < 2.0.ea < 2.0 |
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.
This was just so far off that I did not see how to rescue it. 2.0.1 < 2.0??
@@ -180,7 +176,7 @@ public String toString() { | |||
* Represents a string in the version item list, usually a qualifier. | |||
*/ | |||
private static class StringItem implements Item { | |||
private final static String[] QUALIFIERS = {"snapshot", "alpha", "beta", "milestone", "rc", "", "sp"}; | |||
private final static String[] QUALIFIERS = {"alpha", "beta", "milestone", "rc", "snapshot", "", "sp"}; |
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.
Technically from Maven's PoV -SNAPSHOT
happens before -alpha-SNAPSHOT
which happens before the release.
IOW your version starts off as 1.1-SNAPSHOT, then goes to 1.1-alpha-1-SNAPSHOT, 1.1-alpha-1, 1.1-alpha-2-SNAPSHOT, 1.1-alpha-2, 1.1-beta-1-SNAPSHOT, 1.1-beta-1, 1.1-rc-1-SNAPSHOT, 1.1-rc-1, ..., 1.1, 1.1-sp-1-SNAPSHOT, 1.1-sp-1, 1.1-sp-2-SNAPSHOT
So if you want to stay consistent with Maven's version handling, this is not the change you want
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.
Hmm…I am wondering whether we should just be making this library a shim for ComparableVersion
. It is not entirely clear to me why it differs at all.
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.
some "magic" that KK had for *
as a version component
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 saw a comment to that effect…but is this “feature” actually being used anywhere that you know of?
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 know not of any usage of that...
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.
Hmm milestones are usually pre-alpha thus milestone -> alpha -> beta -> rc -> ga
but yeah maven ¯_(ツ)_/¯
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.
@jglick FYI this is now conflicted. |
Fixed.
Well it was not “unfinished”, it was more that there was no clear consensus on what the behavior of this library should be or what the historical decisions were. |
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.
as per Stephenc.
changing the order of rc and snapshot whilst makes sense for our incrementals JEP (222?) it does not match mavens ordering and I am not clear on what if any issues that may cause.
As Snapshots are normally clearly identified and can be filtered this should not cause too many issues (famous last words), but I am not clear on where any checking would actually take place between a snapshot and a non snapshot version.
@@ -180,7 +176,7 @@ public String toString() { | |||
* Represents a string in the version item list, usually a qualifier. | |||
*/ | |||
private static class StringItem implements Item { | |||
private final static String[] QUALIFIERS = {"snapshot", "alpha", "beta", "milestone", "rc", "", "sp"}; | |||
private final static String[] QUALIFIERS = {"alpha", "beta", "milestone", "rc", "snapshot", "", "sp"}; |
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.
Right: #6 (comment) jenkinsci/jenkins#3551 makes this less interesting. |
// Maven considers 99.1.abcd1234abcd to sort before 99.1234deadbeef so we cannot simply use 99. as the branch prefix. | ||
// Nor can we use 99.1234deadbeef. as the prefix because Maven would compare 5 and 10 lexicographically. | ||
// 100._. seems to work but is not intuitive. | ||
// Using changelist.format=%d.v%s behaves better, apparently because then the hash is never treated like a number. |
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.
JENKINS-51594
See jenkinsci/jenkins#153 where @stephenc was apparently trying to act like Maven by default.