Jira (PUP-10295) Add SemVerRange support to gem package provider

26 views
Skip to first unread message

Gabriel Nagy (JIRA)

unread,
Feb 18, 2020, 7:25:06 AM2/18/20
to puppe...@googlegroups.com
Gabriel Nagy created an issue
 
Puppet / New Feature PUP-10295
Add SemVerRange support to gem package provider
Issue Type: New Feature New Feature
Assignee: Unassigned
Created: 2020/02/18 4:24 AM
Priority: Normal Normal
Reporter: Gabriel Nagy

Implement SemVerRange type support for the gem provider.

Sample manifest with a range passed for a gem:

package { 'rake':
  # this will be parsed as: >= 13.0.0 < 13.1.0
  ensure => SemVerRange('~> 13.0')
}
 
package { 'rake':
  ensure => SemVerRange('>= 12')
}
 
package { 'rake':
  ensure => SemVerRange('< 10')
}
 
package { 'rake':
  # this is a valid range, but we should not support it
  ensure => SemVerRange('~> 13.0 || ~> 15.0')
}

This value should be handled inside the gem provider code, and should be munged into a valid string for the gem install command. We should also make sure we don't take additional actions if the range is already satisfied (i.e. puppet apply with a SemVerRange should be idempotent)

Sample code on how the ensure property can be treated inside the provider:

if @resource.should(:ensure).is_a?(SemanticPuppet::VersionRange)
  version = @resource.should(:ensure).ranges.first
 
  case version
  when SemanticPuppet::VersionRange::MinMaxRange
    # gem requires min/max ranges to be separated by a comma
    version.to_s.tr(' ', ',')
  else
    version.to_s
  end
end

Example gem install with a version range:

gem install rake -v ">= 13.0.0,< 13.1.0"

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Mihai Buzgau (JIRA)

unread,
Feb 18, 2020, 7:44:05 AM2/18/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Component/s: Types and Providers

Mihai Buzgau (JIRA)

unread,
Feb 19, 2020, 6:12:06 AM2/19/20
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Feb 19, 2020, 6:13:06 AM2/19/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: PR NW - Triage 2020-03-04

Mihai Buzgau (Jira)

unread,
Mar 5, 2020, 3:54:03 AM3/5/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2020-03-04 , NW - 2020-03-17
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Mihai Buzgau (Jira)

unread,
Mar 5, 2020, 3:55:03 AM3/5/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW PR - 2020-03-04 Triage , NW - 2020-03- 17 04

Mihai Buzgau (Jira)

unread,
Mar 18, 2020, 6:02:04 AM3/18/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: PR - Triage, NW - 2020-03-04 , NW - 2020-04-01

Mihai Buzgau (Jira)

unread,
Mar 18, 2020, 6:02:05 AM3/18/20
to puppe...@googlegroups.com

Luchian Nemes (Jira)

unread,
Mar 20, 2020, 9:16:03 AM3/20/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Apr 1, 2020, 3:51:04 AM4/1/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2020-03-04, NW - 2020-04-01 , NW - 2020-04-15

Luchian Nemes (Jira)

unread,
Apr 7, 2020, 4:53:03 AM4/7/20
to puppe...@googlegroups.com
Luchian Nemes updated an issue
Change By: Luchian Nemes
Release Notes: Enhancement
Release Notes Summary: Add support for range intersection (min,max such as: >=A <=B) specified in the :ensure manifest field. This will install a version that satisfies the provided range.

Gabriel Nagy (Jira)

unread,
Apr 23, 2020, 8:02:03 AM4/23/20
to puppe...@googlegroups.com
Gabriel Nagy updated an issue
Change By: Gabriel Nagy
Fix Version/s: PUP 6.15.0

Claire Cadman (Jira)

unread,
Apr 28, 2020, 6:54:03 AM4/28/20
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages