Jira (PUP-9342) SemVer data type should allow minor and micro to be left out and default to 0

7 views
Skip to first unread message

Henrik Lindberg (JIRA)

unread,
Dec 5, 2018, 5:05:03 PM12/5/18
to puppe...@googlegroups.com
Henrik Lindberg updated an issue
 
Puppet / Improvement PUP-9342
SemVer data type should allow minor and micro to be left out and default to 0
Change By: Henrik Lindberg
Affects Version/s: PUP 5.y
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
Dec 5, 2018, 5:05:03 PM12/5/18
to puppe...@googlegroups.com
Henrik Lindberg created an issue
Issue Type: Improvement Improvement
Assignee: Unassigned
Created: 2018/12/05 2:04 PM
Priority: Normal Normal
Reporter: Henrik Lindberg

It is currently required to have a full three segment version to create a SemVer - this is not great since there are many versions that are just two segments. The various forms of creating a SemVer should default missing segments to 0 (at least major must be given).

Henrik Lindberg (JIRA)

unread,
Dec 5, 2018, 5:06:02 PM12/5/18
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
Dec 5, 2018, 5:06:03 PM12/5/18
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Mar 29, 2019, 1:19:02 PM3/29/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Mar 29, 2019, 1:19:02 PM3/29/19
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Dec 2, 2021, 12:43:01 AM12/2/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
It is currently required to have a full three segment version to create a {{SemVer}} - this is not great since there are many versions that are just two segments. The various forms of creating a SemVer should default missing segments to 0 (at least major must be given).

*Updated*

SemVer obects can be created from a String, an Array of arguments (major, minor, etc), or a Hash of arguments ({major => 1, etc). It should be possible to omit the minor and patch segments, similarly to how prerelease and build segments can be omitted. For example, I should be able to write this in puppet code:

{code:puppet}
notice(SemVer('1'))
notice(SemVer('1.2'))
notice(SemVer(1))
notice(SemVer(1, 2))
notice(SemVer(major => 1))
notice(SemVer(major => 1, minor => 2))
{code}
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Josh Cooper (Jira)

unread,
Dec 2, 2021, 12:43:01 AM12/2/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Dec 2, 2021, 12:43:01 AM12/2/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Feb 23, 2022, 9:46:02 PM2/23/22
to puppe...@googlegroups.com
Josh Cooper commented on Improvement PUP-9342
 
Re: SemVer data type should allow minor and micro to be left out and default to 0

It makes sense to implement this, but given resources I don't see that happening. Please reopen if you'd like to submit a pull request.

This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages