-
Notifications
You must be signed in to change notification settings - Fork 588
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
ReleaseNotes.load does not parse SemVer correctly #2557
Comments
Welcome to the FAKE community! Thank you so much for creating your first issue and therefore improving the project! |
There has not been any activity in this issue for the last 3 months so it will be closed in 14 days if there is no activity. |
Okay, so i looked a bit into this: The problem seems to be that SemVer is parsed from the nuget version static member New(assemblyVersion,nugetVersion,date,notes) = {
AssemblyVersion = assemblyVersion
NugetVersion = nugetVersion
SemVer = SemVer.parse nugetVersion
Date = date
Notes = notes } and nuget seems to get parsed with this Regex pattern: My suggestion would be to use the offcially recommended Regex to parse SemVer. Either by parsing the full header for SemVer again or by using it to also parse the nuget version. In the following i removed starting and ending requirement to confidently pick the complete SemVer from the start line. (?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))? You can check this regex against some examples:
|
Would it help if i did a PR for this? There are some open PRs and i don't really know if this would be useful. |
I think this may still be an issue and should be reopened. |
Yes sadly it is 😢 I am also having an eye on this issue |
Description
I used ReleaseNotes.load to read in my markdown release notes and tried to add the github commit to the SemVer metadata. As "#" is not a allowed symbol in metadata the version looks like this
0.1.1+09da94a
.release.SemVer.BuildMetaData
returns in this case09
release.SemVer.Original
returns in this case0.1.1+09
if i change the SemVer to
0.1.1+test
it returns nothing for meta data.Repro steps
Parse the markdown file with
ReleaseNotes.load "RELEASE_NOTES.md"
Check SemVer.BuildMetaData/SemVer.Original of the ReleaseNotes record type.
Expected behavior
As far as i understand the specification it should allow both numbers and letters for
metadata.
Actual behavior
It stops parsing the metadata at the first letter.
The text was updated successfully, but these errors were encountered: