-
Notifications
You must be signed in to change notification settings - Fork 585
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
Semver parse fix to handle prereleases and build parts #1325
Conversation
Also addresses #1154 |
do we need to do the same in paket? |
Yeah, but the problem there is compounded by the fact that there are two, slightly different implementations of SemVer there already split between the bootstrapper and Paket.Core. Is it worth splitting this out somehow and/or paket file including the source file over there? |
@@ -132,7 +132,7 @@ public class when_parsing_many_pre_release_versions | |||
#### 2.0.0-alpha001 - December 15 2013 | |||
* A"; | |||
static readonly ReleaseNotesHelper.ReleaseNotes expected = | |||
ReleaseNotesHelper.ReleaseNotes.New("2.0.0", "2.0.0-rc007", null, new[] { "A" }.ToFSharpList()); | |||
ReleaseNotesHelper.ReleaseNotes.New("2.0.0", "2.0.0-rc2", null, new[] { "A" }.ToFSharpList()); |
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.
why this change?
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 made this change because the comparison logic in the spec changed. rc007 is now less than rc2, so the expected output for the given release notes data had to change to take the improved comparison rules into account.
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.
Oh that's breaking in fake. Not sure if we really want that.
On Jul 24, 2016 6:56 PM, "Chester Husk III" notifications@github.com
wrote:
In src/test/Test.FAKECore/ReleaseNotesSpecs.cs
#1325 (comment):@@ -132,7 +132,7 @@ public class when_parsing_many_pre_release_versions
2.0.0-alpha001 - December 15 2013
- A";
static readonly ReleaseNotesHelper.ReleaseNotes expected =
ReleaseNotesHelper.ReleaseNotes.New("2.0.0", "2.0.0-rc007", null, new[] { "A" }.ToFSharpList());
ReleaseNotesHelper.ReleaseNotes.New("2.0.0", "2.0.0-rc2", null, new[] { "A" }.ToFSharpList());
I made this change because the comparison logic in the spec changed. rc007
is now less than rc2, so the expected output for the given release notes
data had to change to take the improved comparison rules into account.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/fsharp/FAKE/pull/1325/files/799b4be354b7eb8da836eec694fe7385d43411d7#r71991697,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNHkwzbdlZ2itA60z_q8eYrUxUSdNks5qY5k1gaJpZM4JSHRJ
.
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.
Current logic is wrong, though. Part of the reason I chafed working with nuget was because they implemented almost-sorta-but-not-really-semver, so none of the existing libraries worked. Do we want to do the same? Besides, if people depend on that sorting, they can either
- use a prerelease of the form
rc.{increment}
, where increment is a number and thus compared numerically, or - use a prerelease of the form
rc{padding}{number}
, and be consistent, sorc007
compared torc002
,
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.
The problem is usually the existing packages. But maybe this is less of a
problem now. It was a huge problem couple of years ago before we starter
with paket
On Jul 24, 2016 7:01 PM, "Chester Husk III" notifications@github.com
wrote:
In src/test/Test.FAKECore/ReleaseNotesSpecs.cs
#1325 (comment):@@ -132,7 +132,7 @@ public class when_parsing_many_pre_release_versions
2.0.0-alpha001 - December 15 2013
- A";
static readonly ReleaseNotesHelper.ReleaseNotes expected =
ReleaseNotesHelper.ReleaseNotes.New("2.0.0", "2.0.0-rc007", null, new[] { "A" }.ToFSharpList());
ReleaseNotesHelper.ReleaseNotes.New("2.0.0", "2.0.0-rc2", null, new[] { "A" }.ToFSharpList());
Current logic is wrong, though. Part of the reason I chafed working with
nuget was because they implemented almost-sorta-but-not-really-semver, so
none of the existing libraries worked. Do we want to do the same? Besides,
if people depend on that sorting, they can either
- use a prerelease of the form rc.{increment}, where increment is a
number and thus compared numerically, or- use a prerelease of the form rc{padding}{number}, and be
consistent, so rc007 compared to rc002,—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/fsharp/FAKE/pull/1325/files/799b4be354b7eb8da836eec694fe7385d43411d7#r71991787,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNEBbyq4YdgDhIJmJc4cPCec9CYrUks5qY5pigaJpZM4JSHRJ
.
yes I think I tried to split it out into a separate file but didn't suceed |
re: splitting this out - it's in a separate file with no non-framework dependencies, so we could just paket include it in paket. This could be an issue, though, as paket exposes SemVerInfo publically so I think we'd get name collisions, and Fake's SemVerInfo wouldn't be the same as Paket's. |
I think we want to have a 'correct' implementation of SemVer in Fake and Paket for internal use for sure. Then, especially in the nuget-related areas of Fake and Paket, if we need to have a stripped down version of Semver that's up to nuget spec but not SemVer proper, we can have mapping functions that assert the invariants. |
Alternatively, we could just use kolectiv's SemVer.net (FParsec parser + nice tests) in both places? https://github.com/xyncro/semver.net. That would handle the issue with sharing types around. But then we have even more back-compat issues. |
It would be very easy to leave the current implementation, mark it as obsolete, and include this new code as a 'SemVer2Helper' or something like that. But Paket is the real sticking point. Do you have any guidance here as to what you prefer? |
good question. I still don't know which packages would be affected |
hey, good news! Nuget client has started supporting SemVer 2.0 as of 3.5.0-rc1! https://emgarten.com/2016/08/09/semver-2-0-0-with-nuget-3-5-0-rc1/ So maybe this gives us some cover to move forward? |
ok let's try it. |
thanks! |
Want me to mirror these changes to Paket? On Mon, Aug 22, 2016, 03:19 Steffen Forkmann notifications@github.com
|
yes. that would be awesome |
Fixes #1324 by rewriting the prerelease and build parsing sections to adhere to spec, while maintaining the Origin, Name, and Number portions of the current logic.
This has implications for existing uses of this code, because the prior code wasn't up to spec. This code implements proper comparison for prerelease identifiers, and now discards the build portion in order to compare.
Thoughts? We hit this when a git sha that we used for stamping prerelease information on a nupkg started with a number and the semver info helper broke :(
Also touches #522 around build information.