chore: add semver spec for build metadata - #127
Conversation
gastonfournier
left a comment
There was a problem hiding this comment.
I think this looks nice, I left some suggestions to improve names and I'd like to also get @sighphyre POV
| "expectedResult": true | ||
| }, | ||
| { | ||
| "description": "F8.semverEQ should be enabled for metadata", |
There was a problem hiding this comment.
| "description": "F8.semverEQ should be enabled for metadata", | |
| "description": "F8.semverEQ should ignore metadata and compare only semver", |
I understand SemVer 2.0.0 defines precedence (you should ignore metadata for precedence comparison), but it doesn't say anything about equality.
This gives us:
- version identity/string equality: 1.2.2+foo != 1.2.2
- SemVer precedence comparison (ignoring metadata): compare(1.2.2+foo, 1.2.2) == 0
There was a problem hiding this comment.
Good point. We do only want the SemVer precedence comparison then is my understanding here? @sighphyre
There was a problem hiding this comment.
@gastonfournier with "compare(1.2.2+foo, 1.2.2) == 0" are you suggesting that we do not take metadata into consideration when establishing equality?
There was a problem hiding this comment.
I think this is horribly debatable but I agree with Gaston here: 1.1.1+foo == 1.1.1
For no other reason than if you force an exact match here then you can get into a weird place where two semantic versions do not satisfy any of A >= B, A > B, A == B, A < B or A <=B... which... is weird
No idea how SDKs are going to handle this, so should be funnn to roll this out
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
Adds a series of checks to ensure semver compatibility with regards to version build metadata.
for instance 1.2.2+metadata SEMVER_EQ 1.2.2
!1.2.2+metadata > 1.2.2
etc
The checks are not exhaustive, but from experience our SDKs should either fail all but one (+metadata == +metadata) of these or pass every single one.