semantic_puppet 1.0.4 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +17 -0
- data/.github/workflows/mend.yaml +35 -0
- data/.github/workflows/rspec_tests.yaml +37 -0
- data/CHANGELOG.md +9 -0
- data/CODEOWNERS +1 -1
- data/README.md +1 -2
- data/lib/semantic_puppet/dependency.rb +3 -3
- data/lib/semantic_puppet/gem_version.rb +1 -1
- data/lib/semantic_puppet/version_range.rb +4 -4
- data/semantic_puppet.gemspec +1 -2
- data/spec/unit/semantic_puppet/dependency_spec.rb +10 -0
- data/spec/unit/semantic_puppet/version_range_spec.rb +10 -0
- metadata +7 -6
- data/.travis.yml +0 -29
- data/appveyor.yml +0 -20
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7eca696bafc0fd31fcab209996686beb644ab5822f0dd1097738b756efa757cb
|
|
4
|
+
data.tar.gz: 53602f9333cf344a567fcd371e97e1160327991164a5f2bca4927c1cbf372b74
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 31e8634019028c678bfb59b7f8ec71fa8d839af8bb9475add780fd330e943246edc4a1cb803dc5e6a270ca4c48229d9fcbaf917d1bc00c9fd5a70b8896e9c91b
|
|
7
|
+
data.tar.gz: 27f26157df4621ad97687fdcfd6b8f0f69dd4e8c70fbb8f36dd35ec1e129998ce97f374342336607dd12b76833e17393762694ad3b224cad16315b651eee16b0
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
# raise PRs for gem updates
|
|
4
|
+
- package-ecosystem: bundler
|
|
5
|
+
directory: "/"
|
|
6
|
+
schedule:
|
|
7
|
+
interval: daily
|
|
8
|
+
time: "13:00"
|
|
9
|
+
open-pull-requests-limit: 10
|
|
10
|
+
|
|
11
|
+
# Maintain dependencies for GitHub Actions
|
|
12
|
+
- package-ecosystem: github-actions
|
|
13
|
+
directory: "/"
|
|
14
|
+
schedule:
|
|
15
|
+
interval: daily
|
|
16
|
+
time: "13:00"
|
|
17
|
+
open-pull-requests-limit: 10
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Mend Monitor
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
jobs:
|
|
8
|
+
mend_monitor:
|
|
9
|
+
if: ${{ github.repository_owner == 'puppetlabs' }}
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
name: Mend Monitor
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout current PR
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
- name: Setup Ruby
|
|
16
|
+
uses: ruby/setup-ruby@v1
|
|
17
|
+
with:
|
|
18
|
+
ruby-version: 2.7
|
|
19
|
+
- name: Create lock
|
|
20
|
+
run: bundle lock
|
|
21
|
+
- uses: actions/setup-java@v4
|
|
22
|
+
with:
|
|
23
|
+
distribution: 'temurin'
|
|
24
|
+
java-version: '17'
|
|
25
|
+
- name: Download Mend
|
|
26
|
+
run: curl -o wss-unified-agent.jar https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar
|
|
27
|
+
- name: Run Mend
|
|
28
|
+
run: java -jar wss-unified-agent.jar
|
|
29
|
+
env:
|
|
30
|
+
WS_APIKEY: ${{ secrets.MEND_API_KEY }}
|
|
31
|
+
WS_WSS_URL: https://saas-eu.whitesourcesoftware.com/agent
|
|
32
|
+
WS_USERKEY: ${{ secrets.MEND_TOKEN }}
|
|
33
|
+
WS_PRODUCTNAME: Puppet Agent
|
|
34
|
+
WS_PROJECTNAME: ${{ github.event.repository.name }}
|
|
35
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: RSpec test
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [main]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
rspec_tests:
|
|
12
|
+
name: ${{ matrix.cfg.os }}(ruby ${{ matrix.cfg.ruby }})
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
cfg:
|
|
16
|
+
- {os: ubuntu-22.04, ruby: '2.7'}
|
|
17
|
+
- {os: ubuntu-22.04, ruby: '3.0'}
|
|
18
|
+
- {os: ubuntu-22.04, ruby: '3.2'}
|
|
19
|
+
- {os: ubuntu-22.04, ruby: '3.3'}
|
|
20
|
+
- {os: ubuntu-22.04, ruby: 'jruby-9.4.2'}
|
|
21
|
+
- {os: windows-2019, ruby: '2.7'}
|
|
22
|
+
- {os: windows-2019, ruby: '3.0'}
|
|
23
|
+
- {os: windows-2019, ruby: '3.2'}
|
|
24
|
+
|
|
25
|
+
runs-on: ${{ matrix.cfg.os }}
|
|
26
|
+
steps:
|
|
27
|
+
- name: Checkout current PR
|
|
28
|
+
uses: actions/checkout@v4
|
|
29
|
+
|
|
30
|
+
- name: Install ruby version ${{ matrix.cfg.ruby }}
|
|
31
|
+
uses: ruby/setup-ruby@v1
|
|
32
|
+
with:
|
|
33
|
+
ruby-version: ${{ matrix.cfg.ruby }}
|
|
34
|
+
bundler-cache: true
|
|
35
|
+
- run: bundle exec rake spec
|
|
36
|
+
- name: Verify gem builds
|
|
37
|
+
run: gem build --verbose *.gemspec
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
|
|
5
|
+
## 1.1.1 - 2025-01-07
|
|
6
|
+
|
|
7
|
+
- Fix method name typo ([joshcooper](https://github.com/joshcooper))
|
|
8
|
+
|
|
9
|
+
## 1.1.0 - 2023-04-10
|
|
10
|
+
- Fix unsatisfiable if resolve() fails ([ekohl](https://github.com/ekohl))
|
|
11
|
+
- Move from travis/appveyor to GitHub actions ([AriaXLi](https://github.com/AriaXLi))
|
|
12
|
+
- Add Ruby 3.2 testing ([mhashizume](https://github.com/mhashizume))
|
|
13
|
+
|
|
5
14
|
## 1.0.4 - 2021-06-08
|
|
6
15
|
- Remove dependency on SortedSet
|
|
7
16
|
- Add Ruby 3.0 to Travis and AppVeyor
|
data/CODEOWNERS
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
* @puppetlabs/
|
|
1
|
+
* @puppetlabs/phoenix
|
data/README.md
CHANGED
|
@@ -19,8 +19,7 @@ This library is used by a number of Puppet Labs projects, including
|
|
|
19
19
|
Requirements
|
|
20
20
|
------------
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
2.0.0, 2.1.9 and 2.4.1. Please see the exact matrix in `.travis.yml`.
|
|
22
|
+
semantic_puppet will work on Ruby version 2.7 and greater.
|
|
24
23
|
|
|
25
24
|
No gem/library requirements.
|
|
26
25
|
|
|
@@ -73,7 +73,7 @@ module SemanticPuppet
|
|
|
73
73
|
# @param graph [Graph] the root of a dependency graph
|
|
74
74
|
# @return [Array<ModuleRelease>] the list of releases to act on
|
|
75
75
|
def resolve(graph)
|
|
76
|
-
@module_dependencies
|
|
76
|
+
@module_dependencies = @satisfieds = nil
|
|
77
77
|
|
|
78
78
|
catch :next do
|
|
79
79
|
return walk(graph, graph.dependencies.dup)
|
|
@@ -120,6 +120,8 @@ module SemanticPuppet
|
|
|
120
120
|
name = dependencies.keys.sort.first
|
|
121
121
|
deps = dependencies.delete(name)
|
|
122
122
|
|
|
123
|
+
@module_dependencies |= [name]
|
|
124
|
+
|
|
123
125
|
# ... (and stepping over it if we've seen it before) ...
|
|
124
126
|
unless (deps & considering).empty?
|
|
125
127
|
return walk(graph, dependencies, *considering)
|
|
@@ -127,8 +129,6 @@ module SemanticPuppet
|
|
|
127
129
|
|
|
128
130
|
# ... we'll iterate through the list of possible versions in order.
|
|
129
131
|
preferred_releases(deps).reverse_each do |dep|
|
|
130
|
-
@module_dependencies |= [name]
|
|
131
|
-
|
|
132
132
|
# We should skip any releases that violate any module's constraints.
|
|
133
133
|
unless [graph, *considering].all? { |x| x.satisfies_constraints?(dep) }
|
|
134
134
|
next
|
|
@@ -398,8 +398,8 @@ module SemanticPuppet
|
|
|
398
398
|
|
|
399
399
|
# Merge two ranges so that the result matches the intersection of all matching versions.
|
|
400
400
|
#
|
|
401
|
-
# @param range [
|
|
402
|
-
# @return [
|
|
401
|
+
# @param range [AbstractRange] the range to intersect with
|
|
402
|
+
# @return [AbstractRange,nil] the intersection between the ranges
|
|
403
403
|
#
|
|
404
404
|
# @api private
|
|
405
405
|
def intersection(range)
|
|
@@ -474,7 +474,7 @@ module SemanticPuppet
|
|
|
474
474
|
excl_end = other.exclude_end?
|
|
475
475
|
else
|
|
476
476
|
max = self.end
|
|
477
|
-
excl_end = exclude_end && other.exclude_end?
|
|
477
|
+
excl_end = exclude_end? && other.exclude_end?
|
|
478
478
|
end
|
|
479
479
|
|
|
480
480
|
MinMaxRange.create(excl_begin ? GtRange.new(min) : GtEqRange.new(min), excl_end ? LtRange.new(max) : LtEqRange.new(max))
|
|
@@ -499,7 +499,7 @@ module SemanticPuppet
|
|
|
499
499
|
# Checks if this matcher accepts a prerelease with the same major, minor, patch triple as the given version. Only matchers
|
|
500
500
|
# where this has been explicitly stated will respond `true` to this method
|
|
501
501
|
#
|
|
502
|
-
# @return [Boolean] `true` if this matcher accepts a
|
|
502
|
+
# @return [Boolean] `true` if this matcher accepts a prerelease with the tuple from the given version
|
|
503
503
|
def test_prerelease?(_)
|
|
504
504
|
false
|
|
505
505
|
end
|
data/semantic_puppet.gemspec
CHANGED
|
@@ -20,9 +20,8 @@ spec = Gem::Specification.new do |s|
|
|
|
20
20
|
s.require_paths = ["lib"]
|
|
21
21
|
|
|
22
22
|
# Dependencies
|
|
23
|
-
s.required_ruby_version = '>=
|
|
23
|
+
s.required_ruby_version = '>= 2.7.0'
|
|
24
24
|
|
|
25
|
-
s.add_development_dependency "json", "~> 1.8.3" if RUBY_VERSION < '2.0'
|
|
26
25
|
s.add_development_dependency "rake"
|
|
27
26
|
s.add_development_dependency "rspec"
|
|
28
27
|
|
|
@@ -247,6 +247,16 @@ describe SemanticPuppet::Dependency do
|
|
|
247
247
|
expect { foo('1.1.0') }.to raise_exception with_message
|
|
248
248
|
expect { foo('1.1.0') }.to raise_exception /\bfoo\b/
|
|
249
249
|
end
|
|
250
|
+
|
|
251
|
+
it 'sets unsatisfiable' do
|
|
252
|
+
add_source_modules('foo', %w[ 1.1.0 ], 'bar' => '1.x')
|
|
253
|
+
add_source_modules('bar', %w[ 0.0.1 0.1.0-a 0.1.0 ])
|
|
254
|
+
|
|
255
|
+
with_message = /Could not find satisfying releases/
|
|
256
|
+
expect { foo('1.1.0') }.to raise_exception with_message
|
|
257
|
+
|
|
258
|
+
expect(SemanticPuppet::Dependency.unsatisfiable).to eq('foo')
|
|
259
|
+
end
|
|
250
260
|
end
|
|
251
261
|
end
|
|
252
262
|
|
|
@@ -270,6 +270,16 @@ describe SemanticPuppet::VersionRange do
|
|
|
270
270
|
expect(range.exclude_end?).to be_nil
|
|
271
271
|
end
|
|
272
272
|
end
|
|
273
|
+
|
|
274
|
+
context 'prerelease' do
|
|
275
|
+
test_expressions(
|
|
276
|
+
[ '>=5.0.1-rc0' || '>=0.5.0' ] => {
|
|
277
|
+
:to_str => '>=5.0.1-rc0',
|
|
278
|
+
:includes => ['5.0.1-rc0', '5.0.1'], # should include 1.0.0
|
|
279
|
+
:excludes => ['1.0.0', '5.0.0-rc0', '5.0.2-rc0']
|
|
280
|
+
}
|
|
281
|
+
)
|
|
282
|
+
end
|
|
273
283
|
end
|
|
274
284
|
|
|
275
285
|
context 'invalid expressions' do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: semantic_puppet
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Puppet Labs
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2025-01-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -102,9 +102,11 @@ executables: []
|
|
|
102
102
|
extensions: []
|
|
103
103
|
extra_rdoc_files: []
|
|
104
104
|
files:
|
|
105
|
+
- ".github/dependabot.yml"
|
|
106
|
+
- ".github/workflows/mend.yaml"
|
|
107
|
+
- ".github/workflows/rspec_tests.yaml"
|
|
105
108
|
- ".gitignore"
|
|
106
109
|
- ".rubocop.yml"
|
|
107
|
-
- ".travis.yml"
|
|
108
110
|
- ".yardopts"
|
|
109
111
|
- CHANGELOG.md
|
|
110
112
|
- CODEOWNERS
|
|
@@ -112,7 +114,6 @@ files:
|
|
|
112
114
|
- LICENSE
|
|
113
115
|
- README.md
|
|
114
116
|
- Rakefile
|
|
115
|
-
- appveyor.yml
|
|
116
117
|
- lib/semantic_puppet.rb
|
|
117
118
|
- lib/semantic_puppet/dependency.rb
|
|
118
119
|
- lib/semantic_puppet/dependency/graph.rb
|
|
@@ -145,14 +146,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
145
146
|
requirements:
|
|
146
147
|
- - ">="
|
|
147
148
|
- !ruby/object:Gem::Version
|
|
148
|
-
version:
|
|
149
|
+
version: 2.7.0
|
|
149
150
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
151
|
requirements:
|
|
151
152
|
- - ">="
|
|
152
153
|
- !ruby/object:Gem::Version
|
|
153
154
|
version: '0'
|
|
154
155
|
requirements: []
|
|
155
|
-
rubygems_version: 3.
|
|
156
|
+
rubygems_version: 3.4.22
|
|
156
157
|
signing_key:
|
|
157
158
|
specification_version: 4
|
|
158
159
|
summary: Useful tools for working with Semantic Versions.
|
data/.travis.yml
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
language: ruby
|
|
3
|
-
|
|
4
|
-
cache: bundler
|
|
5
|
-
|
|
6
|
-
before_install:
|
|
7
|
-
- bundle -v
|
|
8
|
-
- rm Gemfile.lock || true
|
|
9
|
-
- gem update --system
|
|
10
|
-
- gem update bundler
|
|
11
|
-
- gem --version
|
|
12
|
-
- bundle -v
|
|
13
|
-
|
|
14
|
-
script: "bundle exec rspec --color --format documentation spec/unit"
|
|
15
|
-
|
|
16
|
-
notifications:
|
|
17
|
-
email: false
|
|
18
|
-
|
|
19
|
-
sudo: false
|
|
20
|
-
|
|
21
|
-
rvm:
|
|
22
|
-
- "2.5.8"
|
|
23
|
-
- "2.6.6"
|
|
24
|
-
- "2.7.2"
|
|
25
|
-
- "3.0.0"
|
|
26
|
-
- "jruby-19mode"
|
|
27
|
-
|
|
28
|
-
jdk:
|
|
29
|
-
- openjdk8
|
data/appveyor.yml
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
version: 1.0.1.{build}
|
|
2
|
-
clone_depth: 10
|
|
3
|
-
image: Visual Studio 2019
|
|
4
|
-
environment:
|
|
5
|
-
matrix:
|
|
6
|
-
- RUBY_VERSION: 25-x64
|
|
7
|
-
- RUBY_VERSION: 26-x64
|
|
8
|
-
- RUBY_VERSION: 27-x64
|
|
9
|
-
- RUBY_VERSION: 30-x64
|
|
10
|
-
matrix:
|
|
11
|
-
fast_finish: true
|
|
12
|
-
install:
|
|
13
|
-
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
|
|
14
|
-
- bundle install --jobs 4 --retry 2
|
|
15
|
-
build: off
|
|
16
|
-
test_script:
|
|
17
|
-
- ruby -v
|
|
18
|
-
- gem -v
|
|
19
|
-
- bundle -v
|
|
20
|
-
- bundle exec rspec --format documentation --color spec/unit
|