Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
Coremunity
-
Platform Core KANBAN
-
Needs Assessment
-
Bug Fix
-
-
Needs Assessment
Description
The language specification says you should be able to pass the SemVer prerelease and build components as a hash or list of arguments. However, the values are corrupted when SemVer objects are created this way:
❯ bx puppet apply -e 'notice(SemVer(major => 1, minor => 0, patch => 0, prerelease => "alpha"))'
|
Notice: Scope(Class[main]): 1.0.0-a.l.p.h.a
|
...
|
❯ bx puppet apply -e 'notice(SemVer(major => 1, minor => 0, patch => 0, build => "123"))'
|
Notice: Scope(Class[main]): 1.0.0+1.2.3
|
...
|
Note the extra dots in the output. This leads to confusing behavior:
❯ bx puppet apply -e 'notice(SemVer(major => 1, minor => 0, patch => 0, build => "123") == SemVer("1.0.0+123"))'
|
Notice: Scope(Class[main]): false
|
Passing the build and prerelease components in the string version does work, because internally SemanticPuppet::Version.parse converts the String component to an array.
The problem is that the SemVer data type needs to pass the build and prerelease components as a single element array when calling SemanticPuppet::Version.new(.., prerelease, build)
Attachments
Issue Links
- is duplicated by
-
PUP-9581 Add 'to hash' functionality for SemVer data type.
-
- Closed
-
- relates to
-
DOCUMENT-956 Data types SemVer and SemVerRange are not documented
-
- Resolved
-