Skip to content

Commit 6978e2f

Browse files
(main) Update PDK to 3.4.0
Updates the module to PDK 3.4.0 with minimal changes: - Updates gem dependencies for Ruby 3.x compatibility - Updates CI workflow configuration - All unit tests passing with 6 expected pending tests - No functional changes to module code
1 parent 998d169 commit 6978e2f

File tree

12 files changed

+93
-133
lines changed

12 files changed

+93
-133
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
---
2-
name: ci
1+
name: "ci"
2+
33
on:
44
pull_request:
5-
branches: [main]
5+
branches:
6+
- "main"
67
workflow_dispatch:
8+
79
jobs:
810
Spec:
9-
if: ${{ github.repository_owner == 'puppetlabs' }}
10-
uses: puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main
11-
secrets: inherit
11+
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
12+
secrets: "inherit"
13+
1214
Acceptance:
13-
if: ${{ github.repository_owner == 'puppetlabs' }}
1415
needs: Spec
15-
uses: puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main
16-
with:
17-
flags: --provision-service
18-
secrets: inherit
16+
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
17+
secrets: "inherit"

.github/workflows/nightly.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
---
2-
name: nightly
1+
name: "nightly"
2+
33
on:
44
schedule:
5-
- cron: 0 0 * * *
5+
- cron: "0 0 * * *"
66
workflow_dispatch:
7+
78
jobs:
89
Spec:
9-
if: ${{ github.repository_owner == 'puppetlabs' }}
10-
uses: puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main
11-
secrets: inherit
10+
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
11+
secrets: "inherit"
12+
1213
Acceptance:
13-
if: ${{ github.repository_owner == 'puppetlabs' }}
1414
needs: Spec
15-
uses: puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main
16-
with:
17-
flags: --provision-service
18-
secrets: inherit
15+
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
16+
secrets: "inherit"

.github/workflows/release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
---
2-
name: Publish module
1+
name: "Publish module"
2+
33
on:
44
workflow_dispatch:
5+
56
jobs:
6-
release:
7-
uses: puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main
8-
secrets: inherit
7+
release:
8+
uses: "puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main"
9+
secrets: "inherit"

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,25 @@
1919
/spec/fixtures/modules/*
2020
/tmp/
2121
/vendor/
22+
/.vendor/
2223
/convert_report.txt
2324
/update_report.txt
2425
.DS_Store
2526
.project
2627
.envrc
2728
/inventory.yaml
2829
/spec/fixtures/litmus_inventory.yaml
30+
.resource_types
31+
.modules
32+
.task_cache.json
33+
.plan_cache.json
2934
.rerun.json
35+
bolt-debug.log
3036
*.tar.gz
3137
.modules/
32-
.plan_cache.json
3338
.resource_types/
34-
bolt-debug.log
3539
spec/docker/**/*.tar.gz
3640
spec/docker/**/*.asc
3741
spec/docker/**/files/puppet-enterprise*
3842
spec/docker/.task_cache.json
43+
.vscode/

.pdkignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,24 @@
1919
/spec/fixtures/modules/*
2020
/tmp/
2121
/vendor/
22+
/.vendor/
2223
/convert_report.txt
2324
/update_report.txt
2425
.DS_Store
2526
.project
2627
.envrc
2728
/inventory.yaml
2829
/spec/fixtures/litmus_inventory.yaml
30+
.resource_types
31+
.modules
32+
.task_cache.json
33+
.plan_cache.json
34+
.rerun.json
35+
bolt-debug.log
2936
/.fixtures.yml
3037
/Gemfile
3138
/.gitattributes
39+
/.github/
3240
/.gitignore
3341
/.pdkignore
3442
/.puppet-lint.rc

.puppet-lint.rc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1+
--fail-on-warnings
12
--relative
3+
--no-80chars-check
4+
--no-140chars-check
5+
--no-class_inherits_from_params_class-check
6+
--no-autoloader_layout-check
7+
--no-documentation-check
8+
--no-single_quote_string_with_variables-check
9+
--no-strict_indent-check
10+
--no-manifest_whitespace_missing_newline_end_of_file-check
11+
--ignore-paths=.vendor/**/*.pp,.bundle/**/*.pp,pkg/**/*.pp,spec/**/*.pp,tests/**/*.pp,types/**/*.pp,vendor/**/*.pp

.rubocop.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ require:
33
- rubocop-performance
44
- rubocop-rspec
55
AllCops:
6-
Newcops: enable
7-
ExtraDetails: true
8-
DisplayStyleGuide: true
6+
NewCops: enable
97
DisplayCopNames: true
10-
TargetRubyVersion: '2.7'
8+
TargetRubyVersion: '2.6'
119
Include:
1210
- "**/*.rb"
1311
Exclude:
@@ -530,6 +528,8 @@ Lint/DuplicateBranch:
530528
Enabled: false
531529
Lint/DuplicateMagicComment:
532530
Enabled: false
531+
Lint/DuplicateMatchPattern:
532+
Enabled: false
533533
Lint/DuplicateRegexpCharacterClassElement:
534534
Enabled: false
535535
Lint/EmptyBlock:
@@ -646,6 +646,8 @@ Style/ComparableClamp:
646646
Enabled: false
647647
Style/ConcatArrayLiterals:
648648
Enabled: false
649+
Style/DataInheritance:
650+
Enabled: false
649651
Style/DirEmpty:
650652
Enabled: false
651653
Style/DocumentDynamicEvalDefinition:
@@ -714,6 +716,8 @@ Style/RedundantHeredocDelimiterQuotes:
714716
Enabled: false
715717
Style/RedundantInitialize:
716718
Enabled: false
719+
Style/RedundantLineContinuation:
720+
Enabled: false
717721
Style/RedundantSelfAssignmentBranch:
718722
Enabled: false
719723
Style/RedundantStringEscape:

Gemfile

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,37 @@ group :development do
2020
gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2121
gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2222
gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
23+
gem "deep_merge", '~> 1.2.2', require: false
2324
gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
24-
gem "facterdb", '~> 1.18', require: false
25-
gem "metadata-json-lint", '~> 3.0', require: false
26-
gem "puppetlabs_spec_helper", '~> 6.0', require: false
27-
gem "rspec-puppet-facts", '~> 2.0', require: false
28-
gem "codecov", '~> 0.2', require: false
25+
gem "facterdb", '~> 2.1', require: false if Gem::Requirement.create(['< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
26+
gem "facterdb", '~> 3.0', require: false if Gem::Requirement.create(['>= 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
27+
gem "metadata-json-lint", '~> 4.0', require: false
28+
gem "json-schema", '< 5.1.1', require: false
29+
gem "rspec-puppet-facts", '~> 4.0', require: false if Gem::Requirement.create(['< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
30+
gem "rspec-puppet-facts", '~> 5.0', require: false if Gem::Requirement.create(['>= 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2931
gem "dependency_checker", '~> 1.0.0', require: false
3032
gem "parallel_tests", '= 3.12.1', require: false
3133
gem "pry", '~> 0.10', require: false
32-
gem "simplecov-console", '~> 0.5', require: false
34+
gem "simplecov-console", '~> 0.9', require: false
3335
gem "puppet-debugger", '~> 1.0', require: false
34-
gem "rubocop", '= 1.48.1', require: false
36+
gem "rubocop", '~> 1.50.0', require: false
3537
gem "rubocop-performance", '= 1.16.0', require: false
3638
gem "rubocop-rspec", '= 2.19.0', require: false
3739
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
38-
gem "bolt", '>= 3.27.2', require: false
40+
gem "bolt", '>= 3.10.0', require: false
3941
gem "github_changelog_generator", '1.16.4', require: false
4042
gem "octokit", '4.21.0', require: false
4143
gem "orchestrator_client", '< 0.7.1', require: false
4244
end
43-
group :system_tests do
44-
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
45-
gem "serverspec", '~> 2.41', require: false
46-
end
47-
group :release_prep do
45+
group :development, :release_prep do
4846
gem "puppet-strings", '~> 4.0', require: false
49-
gem "puppetlabs_spec_helper", '~> 6.0', require: false
47+
gem "puppetlabs_spec_helper", '~> 8.0', require: false
48+
gem "puppet-blacksmith", '~> 7.0', require: false
49+
end
50+
group :system_tests do
51+
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
52+
gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw]
53+
gem "serverspec", '~> 2.41', require: false
5054
end
5155

5256
puppet_version = ENV['PUPPET_GEM_VERSION']

Rakefile

Lines changed: 8 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -4,89 +4,18 @@ require 'bundler'
44
require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus'
55
require 'puppetlabs_spec_helper/rake_tasks'
66
require 'puppet-syntax/tasks/puppet-syntax'
7-
require 'github_changelog_generator/task' if Gem.loaded_specs.key? 'github_changelog_generator'
87
require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings'
98

10-
def changelog_user
11-
return unless Rake.application.top_level_tasks.include? "changelog"
12-
returnVal = nil || JSON.load(File.read('metadata.json'))['author']
13-
raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil?
14-
puts "GitHubChangelogGenerator user:#{returnVal}"
15-
returnVal
16-
end
17-
18-
def changelog_project
19-
return unless Rake.application.top_level_tasks.include? "changelog"
20-
21-
returnVal = nil
22-
returnVal ||= begin
23-
metadata_source = JSON.load(File.read('metadata.json'))['source']
24-
metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z})
25-
26-
metadata_source_match && metadata_source_match[1]
27-
end
28-
29-
raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil?
30-
31-
puts "GitHubChangelogGenerator project:#{returnVal}"
32-
returnVal
33-
end
34-
35-
def changelog_future_release
36-
return unless Rake.application.top_level_tasks.include? "changelog"
37-
returnVal = "v%s" % JSON.load(File.read('metadata.json'))['version']
38-
raise "unable to find the future_release (version) in metadata.json" if returnVal.nil?
39-
puts "GitHubChangelogGenerator future_release:#{returnVal}"
40-
returnVal
41-
end
42-
439
PuppetLint.configuration.send('disable_relative')
10+
PuppetLint.configuration.send('disable_80chars')
11+
PuppetLint.configuration.send('disable_140chars')
12+
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
13+
PuppetLint.configuration.send('disable_autoloader_layout')
14+
PuppetLint.configuration.send('disable_documentation')
15+
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
4416
PuppetLint.configuration.send('disable_strict_indent')
4517
PuppetLint.configuration.send('disable_manifest_whitespace_missing_newline_end_of_file')
46-
47-
48-
if Gem.loaded_specs.key? 'github_changelog_generator'
49-
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
50-
raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil?
51-
config.user = "#{changelog_user}"
52-
config.project = "#{changelog_project}"
53-
config.since_tag = "2.5.0"
54-
config.future_release = "#{changelog_future_release}"
55-
config.exclude_labels = ['maintenance']
56-
config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org)."
57-
config.add_pr_wo_labels = true
58-
config.issues = false
59-
config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB"
60-
config.configure_sections = {
61-
"Changed" => {
62-
"prefix" => "### Changed",
63-
"labels" => ["backwards-incompatible"],
64-
},
65-
"Added" => {
66-
"prefix" => "### Added",
67-
"labels" => ["enhancement", "feature"],
68-
},
69-
"Fixed" => {
70-
"prefix" => "### Fixed",
71-
"labels" => ["bug", "documentation", "bugfix"],
72-
},
73-
}
74-
end
75-
else
76-
desc 'Generate a Changelog from GitHub'
77-
task :changelog do
78-
raise <<EOM
79-
The changelog tasks depends on recent features of the github_changelog_generator gem.
80-
Please manually add it to your .sync.yml for now, and run `pdk update`:
81-
---
82-
Gemfile:
83-
optional:
84-
':development':
85-
- gem: 'github_changelog_generator'
86-
version: '~> 1.15'
87-
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')"
88-
EOM
89-
end
90-
end
18+
PuppetLint.configuration.fail_on_warnings = true
19+
PuppetLint.configuration.ignore_paths = [".vendor/**/*.pp", ".bundle/**/*.pp", "pkg/**/*.pp", "spec/**/*.pp", "tests/**/*.pp", "types/**/*.pp", "vendor/**/*.pp"]
9120

9221
PuppetSyntax.exclude_paths = ["plans/**/*.pp", "spec/acceptance/**/plans/**/*.pp", "vendor/**/*"]

metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"version_requirement": ">= 7.0.0 < 9.0.0"
8787
}
8888
],
89-
"pdk-version": "3.0.0",
89+
"pdk-version": "3.4.0",
9090
"template-url": "https://github.com/puppetlabs/pdk-templates.git#main",
91-
"template-ref": "tags/3.0.0-0-g056e50d"
91+
"template-ref": "tags/3.4.0.3-0-g8fb22fc"
9292
}

0 commit comments

Comments
 (0)