puppet-ghostbuster 2.1.0 → 2.2.0
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/labeler.yml +3 -0
- data/.github/release.yml +40 -0
- data/.github/workflows/labeler.yml +18 -0
- data/.github/workflows/release.yml +2 -2
- data/.github/workflows/test.yml +22 -13
- data/CHANGELOG.md +17 -2
- data/Gemfile +4 -2
- data/README.md +6 -1
- data/lib/puppet-ghostbuster/puppetdb.rb +9 -4
- data/lib/puppet-ghostbuster/version.rb +1 -1
- data/puppet-ghostbuster.gemspec +3 -3
- data/spec/puppet_ghostbuster/puppet_db_spec.rb +56 -0
- data/spec/spec_helper.rb +2 -0
- metadata +12 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3ded6aa277f38f2383a92a014237dfcf53e4c5d08b9a31ddca68c04a1ba9d5a0
|
|
4
|
+
data.tar.gz: 9bc03b84ae579a7d1c0c8087d19dcf1f9a096882e261126941b333f43bfc49df
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9626a929c8fa55a70ab0600dc807f83db204bcc23d4f9db39c9cd5eda4fe55fd93c6dc03e8eae680dba8ad678cfc1a2e8e031cdb2eb49e70d0815dc89b6831ef
|
|
7
|
+
data.tar.gz: 8c664c1ecd7d405319f6567646104d7f7d9c96f47a17dd4049d7d1a1285999e5682c432e4fccfb121fa495e56147e3ae158079c4b479ece41f8831a301c3198e
|
data/.github/labeler.yml
ADDED
data/.github/release.yml
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
|
|
3
|
+
|
|
4
|
+
changelog:
|
|
5
|
+
exclude:
|
|
6
|
+
labels:
|
|
7
|
+
- duplicate
|
|
8
|
+
- invalid
|
|
9
|
+
- modulesync
|
|
10
|
+
- question
|
|
11
|
+
- skip-changelog
|
|
12
|
+
- wont-fix
|
|
13
|
+
- wontfix
|
|
14
|
+
- github_actions
|
|
15
|
+
|
|
16
|
+
categories:
|
|
17
|
+
- title: Breaking Changes 🛠
|
|
18
|
+
labels:
|
|
19
|
+
- backwards-incompatible
|
|
20
|
+
|
|
21
|
+
- title: New Features 🎉
|
|
22
|
+
labels:
|
|
23
|
+
- enhancement
|
|
24
|
+
|
|
25
|
+
- title: Bug Fixes 🐛
|
|
26
|
+
labels:
|
|
27
|
+
- bug
|
|
28
|
+
|
|
29
|
+
- title: Documentation Updates 📚
|
|
30
|
+
labels:
|
|
31
|
+
- documentation
|
|
32
|
+
- docs
|
|
33
|
+
|
|
34
|
+
- title: Dependency Updates ⬆️
|
|
35
|
+
labels:
|
|
36
|
+
- dependencies
|
|
37
|
+
|
|
38
|
+
- title: Other Changes
|
|
39
|
+
labels:
|
|
40
|
+
- "*"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 🏷️ Pull Request Labeler
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
- pull_request_target
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
labeler:
|
|
12
|
+
name: Labeler
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
if: github.repository_owner == 'voxpupuli' || github.repository_owner == 'OpenVoxProject'
|
|
15
|
+
permissions:
|
|
16
|
+
pull-requests: write
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0
|
|
@@ -15,7 +15,7 @@ jobs:
|
|
|
15
15
|
name: Build the gem
|
|
16
16
|
runs-on: ubuntu-24.04
|
|
17
17
|
steps:
|
|
18
|
-
- uses: actions/checkout@
|
|
18
|
+
- uses: actions/checkout@v7
|
|
19
19
|
- name: Install Ruby
|
|
20
20
|
uses: ruby/setup-ruby@v1
|
|
21
21
|
with:
|
|
@@ -76,7 +76,7 @@ jobs:
|
|
|
76
76
|
uses: actions/download-artifact@v8
|
|
77
77
|
with:
|
|
78
78
|
name: gem-artifact
|
|
79
|
-
- uses: rubygems/configure-rubygems-credentials@
|
|
79
|
+
- uses: rubygems/configure-rubygems-credentials@v2.1.0
|
|
80
80
|
- name: Publish gem to rubygems.org
|
|
81
81
|
shell: bash
|
|
82
82
|
run: gem push *.gem
|
data/.github/workflows/test.yml
CHANGED
|
@@ -10,11 +10,16 @@ on:
|
|
|
10
10
|
env:
|
|
11
11
|
BUNDLE_WITHOUT: release
|
|
12
12
|
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
13
16
|
jobs:
|
|
14
|
-
|
|
17
|
+
rubocop_and_matrix:
|
|
15
18
|
runs-on: ubuntu-latest
|
|
19
|
+
outputs:
|
|
20
|
+
ruby: ${{ steps.ruby.outputs.versions }}
|
|
16
21
|
steps:
|
|
17
|
-
- uses: actions/checkout@
|
|
22
|
+
- uses: actions/checkout@v7
|
|
18
23
|
- name: Setup ruby
|
|
19
24
|
uses: ruby/setup-ruby@v1
|
|
20
25
|
with:
|
|
@@ -22,21 +27,21 @@ jobs:
|
|
|
22
27
|
bundler-cache: true
|
|
23
28
|
- name: Run rake rubocop
|
|
24
29
|
run: bundle exec rake rubocop
|
|
30
|
+
- id: ruby
|
|
31
|
+
uses: voxpupuli/ruby-version@be0467ce7366d206b2e87f5b7a032a030120b7cb # 2.0.0
|
|
25
32
|
test:
|
|
26
33
|
runs-on: ubuntu-latest
|
|
34
|
+
needs: rubocop_and_matrix
|
|
27
35
|
strategy:
|
|
28
36
|
fail-fast: false
|
|
29
37
|
matrix:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
coverage: "yes"
|
|
33
|
-
- ruby: "3.3"
|
|
34
|
-
- ruby: "3.4"
|
|
35
|
-
env:
|
|
36
|
-
COVERAGE: ${{ matrix.coverage }}
|
|
38
|
+
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
|
|
39
|
+
|
|
37
40
|
name: Ruby ${{ matrix.ruby }}
|
|
41
|
+
env:
|
|
42
|
+
COVERAGE: ${{ (matrix.ruby == '3.2' || matrix.ruby == '4.0') && 'yes' || 'no' }}
|
|
38
43
|
steps:
|
|
39
|
-
- uses: actions/checkout@
|
|
44
|
+
- uses: actions/checkout@v7
|
|
40
45
|
- name: Install Ruby ${{ matrix.ruby }}
|
|
41
46
|
uses: ruby/setup-ruby@v1
|
|
42
47
|
with:
|
|
@@ -47,10 +52,14 @@ jobs:
|
|
|
47
52
|
- name: Verify gem builds
|
|
48
53
|
run: gem build --strict --verbose *.gemspec
|
|
49
54
|
tests:
|
|
55
|
+
if: always()
|
|
50
56
|
needs:
|
|
51
|
-
-
|
|
57
|
+
- rubocop_and_matrix
|
|
52
58
|
- test
|
|
53
|
-
runs-on: ubuntu-
|
|
59
|
+
runs-on: ubuntu-26.04
|
|
54
60
|
name: Test suite
|
|
55
61
|
steps:
|
|
56
|
-
-
|
|
62
|
+
- name: Decide whether the needed jobs succeeded or failed
|
|
63
|
+
uses: re-actors/alls-green@release/v1
|
|
64
|
+
with:
|
|
65
|
+
jobs: ${{ toJSON(needs) }}
|
data/CHANGELOG.md
CHANGED
|
@@ -2,9 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [2.
|
|
5
|
+
## [2.2.0](https://github.com/voxpupuli/puppet-ghostbuster/tree/2.2.0) (2026-10-08)
|
|
6
6
|
|
|
7
|
-
[Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/v2.
|
|
7
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/v2.1.0...2.2.0)
|
|
8
|
+
|
|
9
|
+
**Implemented enhancements:**
|
|
10
|
+
|
|
11
|
+
- feat: make it work with openvox9 [\#129](https://github.com/voxpupuli/puppet-ghostbuster/pull/129) ([rwaffen](https://github.com/rwaffen))
|
|
12
|
+
|
|
13
|
+
**Merged pull requests:**
|
|
14
|
+
|
|
15
|
+
- Update voxpupuli-rubocop requirement from ~\> 5.2.0 to ~\> 5.3.0 [\#126](https://github.com/voxpupuli/puppet-ghostbuster/pull/126) ([dependabot[bot]](https://github.com/apps/dependabot))
|
|
16
|
+
- Update json requirement from \>= 2.0, \< 3.0 to \>= 2.0, \< 4.0 [\#124](https://github.com/voxpupuli/puppet-ghostbuster/pull/124) ([dependabot[bot]](https://github.com/apps/dependabot))
|
|
17
|
+
- Update github\_changelog\_generator requirement from ~\> 1.16.4 to ~\> 1.18 [\#120](https://github.com/voxpupuli/puppet-ghostbuster/pull/120) ([dependabot[bot]](https://github.com/apps/dependabot))
|
|
18
|
+
- Update voxpupuli-rubocop requirement from ~\> 5.1.0 to ~\> 5.2.0 [\#119](https://github.com/voxpupuli/puppet-ghostbuster/pull/119) ([dependabot[bot]](https://github.com/apps/dependabot))
|
|
19
|
+
|
|
20
|
+
## [v2.1.0](https://github.com/voxpupuli/puppet-ghostbuster/tree/v2.1.0) (2026-02-27)
|
|
21
|
+
|
|
22
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-ghostbuster/compare/v2.0.0...v2.1.0)
|
|
8
23
|
|
|
9
24
|
**Merged pull requests:**
|
|
10
25
|
|
data/Gemfile
CHANGED
|
@@ -4,9 +4,11 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org'
|
|
|
4
4
|
|
|
5
5
|
gemspec
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
gem 'openvox', ENV['OPENVOX_VERSION'] if ENV['OPENVOX_VERSION']
|
|
8
|
+
|
|
9
|
+
group :release, optional: true do
|
|
8
10
|
gem 'faraday-retry', '~> 2.1', require: false
|
|
9
|
-
gem 'github_changelog_generator', '~> 1.
|
|
11
|
+
gem 'github_changelog_generator', '~> 1.18', require: false
|
|
10
12
|
end
|
|
11
13
|
|
|
12
14
|
group :coverage, optional: ENV['COVERAGE'] != 'yes' do
|
data/README.md
CHANGED
|
@@ -16,6 +16,8 @@ This gems helps puppet users to find dead code by displaying unused classes, def
|
|
|
16
16
|
|
|
17
17
|
This gems only support PuppetDB APi v4 (PuppetDB 3+)
|
|
18
18
|
|
|
19
|
+
Supports OpenVox 8 and 9 with Ruby 3.2 or newer.
|
|
20
|
+
|
|
19
21
|
Usage
|
|
20
22
|
-----
|
|
21
23
|
|
|
@@ -34,7 +36,10 @@ The location of the `hiera.yaml` file. Defaults to `./hiera.yaml` or `/etc/puppe
|
|
|
34
36
|
|
|
35
37
|
### PUPPETDB_URL
|
|
36
38
|
|
|
37
|
-
The
|
|
39
|
+
The URL of PuppetDB.
|
|
40
|
+
If unset, uses the first server URL from `puppetdb.conf` when the PuppetDB integration is available,
|
|
41
|
+
otherwise `https://<server>:8081` using the `server` setting in `puppet.conf`.
|
|
42
|
+
OpenVox 9 has no default `server`, so configure it or set `PUPPETDB_URL` explicitly.
|
|
38
43
|
|
|
39
44
|
### PUPPETDB_CACERT_FILE
|
|
40
45
|
|
|
@@ -5,17 +5,22 @@ class PuppetGhostbuster
|
|
|
5
5
|
class PuppetDB
|
|
6
6
|
Puppet.initialize_settings
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
def self.server_url
|
|
9
|
+
return ENV['PUPPETDB_URL'] if ENV['PUPPETDB_URL'] && !ENV['PUPPETDB_URL'].empty?
|
|
10
|
+
|
|
9
11
|
require 'puppet/util/puppetdb'
|
|
10
|
-
|
|
12
|
+
Puppet::Util::Puppetdb.config.server_urls[0]
|
|
11
13
|
rescue LoadError
|
|
12
|
-
|
|
14
|
+
server = Puppet[:server]
|
|
15
|
+
raise ArgumentError, 'Set PUPPETDB_URL or configure server in puppet.conf to connect to PuppetDB' if server.nil? || server.empty?
|
|
16
|
+
|
|
17
|
+
"https://#{server}:8081"
|
|
13
18
|
end
|
|
14
19
|
|
|
15
20
|
def self.client
|
|
16
21
|
@@client ||= begin
|
|
17
22
|
options = {
|
|
18
|
-
server:
|
|
23
|
+
server: server_url,
|
|
19
24
|
}
|
|
20
25
|
|
|
21
26
|
if ENV['PE_TOKEN']
|
data/puppet-ghostbuster.gemspec
CHANGED
|
@@ -25,10 +25,10 @@ Gem::Specification.new do |s|
|
|
|
25
25
|
s.add_development_dependency 'rspec', '~> 3.0'
|
|
26
26
|
s.add_development_dependency 'rspec-collection_matchers', '~> 1.0'
|
|
27
27
|
s.add_development_dependency 'rspec-its', '~> 2.0'
|
|
28
|
-
s.add_development_dependency 'voxpupuli-rubocop', '~> 5.
|
|
28
|
+
s.add_development_dependency 'voxpupuli-rubocop', '~> 5.3.0'
|
|
29
29
|
|
|
30
|
-
s.add_dependency 'json', '>= 2.0', '<
|
|
31
|
-
s.add_dependency 'openvox', '>= 8.0', '<
|
|
30
|
+
s.add_dependency 'json', '>= 2.0', '< 4.0'
|
|
31
|
+
s.add_dependency 'openvox', '>= 8.0', '< 10.0'
|
|
32
32
|
s.add_dependency 'puppetdb-ruby', '~> 1.1', '>= 1.1.1'
|
|
33
33
|
s.add_dependency 'syslog', '>= 0.3', '< 0.5'
|
|
34
34
|
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'spec_helper'
|
|
4
|
+
|
|
5
|
+
describe PuppetGhostbuster::PuppetDB do
|
|
6
|
+
describe '.server_url' do
|
|
7
|
+
around do |example|
|
|
8
|
+
original_url = ENV.fetch('PUPPETDB_URL', nil)
|
|
9
|
+
ENV.delete('PUPPETDB_URL')
|
|
10
|
+
example.run
|
|
11
|
+
ensure
|
|
12
|
+
if original_url
|
|
13
|
+
ENV['PUPPETDB_URL'] = original_url
|
|
14
|
+
else
|
|
15
|
+
ENV.delete('PUPPETDB_URL')
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it 'uses the explicit URL without loading the PuppetDB integration' do
|
|
20
|
+
ENV['PUPPETDB_URL'] = 'https://database.example.com:8081'
|
|
21
|
+
allow(described_class).to receive(:require)
|
|
22
|
+
expect(described_class.server_url).to eq('https://database.example.com:8081')
|
|
23
|
+
expect(described_class).not_to have_received(:require)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it 'uses the first URL from the PuppetDB integration' do
|
|
27
|
+
config = Struct.new(:server_urls).new(['https://database.example.com:8081'])
|
|
28
|
+
integration = Struct.new(:config).new(config)
|
|
29
|
+
stub_const('Puppet::Util::Puppetdb', integration)
|
|
30
|
+
allow(described_class).to receive(:require).with('puppet/util/puppetdb')
|
|
31
|
+
expect(described_class.server_url).to eq('https://database.example.com:8081')
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
context 'without the PuppetDB integration' do
|
|
35
|
+
before do
|
|
36
|
+
allow(described_class).to receive(:require).with('puppet/util/puppetdb').and_raise(LoadError)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it 'uses the configured Puppet server' do
|
|
40
|
+
allow(Puppet).to receive(:[]).with(:server).and_return('compiler.example.com')
|
|
41
|
+
expect(described_class.server_url).to eq('https://compiler.example.com:8081')
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it 'reports a missing server instead of constructing an invalid URL' do
|
|
45
|
+
allow(Puppet).to receive(:[]).with(:server).and_return('')
|
|
46
|
+
expect { described_class.server_url }.to raise_error(ArgumentError, /Set PUPPETDB_URL/)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
it 'treats an empty explicit URL as unset' do
|
|
50
|
+
ENV['PUPPETDB_URL'] = ''
|
|
51
|
+
allow(Puppet).to receive(:[]).with(:server).and_return('compiler.example.com')
|
|
52
|
+
expect(described_class.server_url).to eq('https://compiler.example.com:8081')
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: puppet-ghostbuster
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Camptocamp
|
|
@@ -138,14 +138,14 @@ dependencies:
|
|
|
138
138
|
requirements:
|
|
139
139
|
- - "~>"
|
|
140
140
|
- !ruby/object:Gem::Version
|
|
141
|
-
version: 5.
|
|
141
|
+
version: 5.3.0
|
|
142
142
|
type: :development
|
|
143
143
|
prerelease: false
|
|
144
144
|
version_requirements: !ruby/object:Gem::Requirement
|
|
145
145
|
requirements:
|
|
146
146
|
- - "~>"
|
|
147
147
|
- !ruby/object:Gem::Version
|
|
148
|
-
version: 5.
|
|
148
|
+
version: 5.3.0
|
|
149
149
|
- !ruby/object:Gem::Dependency
|
|
150
150
|
name: json
|
|
151
151
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -155,7 +155,7 @@ dependencies:
|
|
|
155
155
|
version: '2.0'
|
|
156
156
|
- - "<"
|
|
157
157
|
- !ruby/object:Gem::Version
|
|
158
|
-
version: '
|
|
158
|
+
version: '4.0'
|
|
159
159
|
type: :runtime
|
|
160
160
|
prerelease: false
|
|
161
161
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -165,7 +165,7 @@ dependencies:
|
|
|
165
165
|
version: '2.0'
|
|
166
166
|
- - "<"
|
|
167
167
|
- !ruby/object:Gem::Version
|
|
168
|
-
version: '
|
|
168
|
+
version: '4.0'
|
|
169
169
|
- !ruby/object:Gem::Dependency
|
|
170
170
|
name: openvox
|
|
171
171
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -175,7 +175,7 @@ dependencies:
|
|
|
175
175
|
version: '8.0'
|
|
176
176
|
- - "<"
|
|
177
177
|
- !ruby/object:Gem::Version
|
|
178
|
-
version: '
|
|
178
|
+
version: '10.0'
|
|
179
179
|
type: :runtime
|
|
180
180
|
prerelease: false
|
|
181
181
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -185,7 +185,7 @@ dependencies:
|
|
|
185
185
|
version: '8.0'
|
|
186
186
|
- - "<"
|
|
187
187
|
- !ruby/object:Gem::Version
|
|
188
|
-
version: '
|
|
188
|
+
version: '10.0'
|
|
189
189
|
- !ruby/object:Gem::Dependency
|
|
190
190
|
name: puppetdb-ruby
|
|
191
191
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -232,6 +232,9 @@ extensions: []
|
|
|
232
232
|
extra_rdoc_files: []
|
|
233
233
|
files:
|
|
234
234
|
- ".github/dependabot.yml"
|
|
235
|
+
- ".github/labeler.yml"
|
|
236
|
+
- ".github/release.yml"
|
|
237
|
+
- ".github/workflows/labeler.yml"
|
|
235
238
|
- ".github/workflows/release.yml"
|
|
236
239
|
- ".github/workflows/test.yml"
|
|
237
240
|
- ".gitignore"
|
|
@@ -279,6 +282,7 @@ files:
|
|
|
279
282
|
- spec/puppet-lint/plugins/ghostbuster_hiera_files_spec.rb
|
|
280
283
|
- spec/puppet-lint/plugins/ghostbuster_templates_spec.rb
|
|
281
284
|
- spec/puppet-lint/plugins/ghostbuster_types_spec.rb
|
|
285
|
+
- spec/puppet_ghostbuster/puppet_db_spec.rb
|
|
282
286
|
- spec/spec_helper.rb
|
|
283
287
|
homepage: http://github.com/voxpupuli/puppet-ghostbuster
|
|
284
288
|
licenses:
|
|
@@ -298,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
298
302
|
- !ruby/object:Gem::Version
|
|
299
303
|
version: '0'
|
|
300
304
|
requirements: []
|
|
301
|
-
rubygems_version: 4.0.
|
|
305
|
+
rubygems_version: 4.0.20
|
|
302
306
|
specification_version: 4
|
|
303
307
|
summary: Dead code detector for Puppet
|
|
304
308
|
test_files: []
|