Skip to content

Commit 108d4bd

Browse files
Merge pull request #86 from mhashizume/maint/main/beaker-bump
Beaker bump and PDK update
2 parents 0b620ce + 8f4e774 commit 108d4bd

File tree

8 files changed

+32
-104
lines changed

8 files changed

+32
-104
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "Publish module"
22

33
on:
44
workflow_dispatch:
5-
5+
66
jobs:
77
release:
88
uses: "puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main"

.rubocop.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ require:
33
- rubocop-performance
44
- rubocop-rspec
55
AllCops:
6+
NewCops: enable
67
DisplayCopNames: true
78
TargetRubyVersion: '2.6'
89
Include:
@@ -533,6 +534,8 @@ Lint/DuplicateBranch:
533534
Enabled: false
534535
Lint/DuplicateMagicComment:
535536
Enabled: false
537+
Lint/DuplicateMatchPattern:
538+
Enabled: false
536539
Lint/DuplicateRegexpCharacterClassElement:
537540
Enabled: false
538541
Lint/EmptyBlock:
@@ -649,6 +652,8 @@ Style/ComparableClamp:
649652
Enabled: false
650653
Style/ConcatArrayLiterals:
651654
Enabled: false
655+
Style/DataInheritance:
656+
Enabled: false
652657
Style/DirEmpty:
653658
Enabled: false
654659
Style/DocumentDynamicEvalDefinition:
@@ -717,6 +722,8 @@ Style/RedundantHeredocDelimiterQuotes:
717722
Enabled: false
718723
Style/RedundantInitialize:
719724
Enabled: false
725+
Style/RedundantLineContinuation:
726+
Enabled: false
720727
Style/RedundantSelfAssignmentBranch:
721728
Enabled: false
722729
Style/RedundantStringEscape:

.sync.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Gemfile:
1515
optional:
1616
":development":
1717
- gem: beaker
18-
version: '~> 5.0'
18+
version: '~> 6.0'
1919
from_env: BEAKER_VERSION
2020
- gem: beaker-abs
2121
from_env: BEAKER_ABS_VERSION
@@ -27,7 +27,7 @@ Gemfile:
2727
# Prevent beaker-puppet from being installed on Ruby > 3.1 until beaker-puppet supports newer Rubies (PA-6136)
2828
- gem: beaker-puppet
2929
from_env: BEAKER_PUPPET_VERSION
30-
version: '~> 3.0'
30+
version: '~> 4.0'
3131
condition: Gem::Requirement.create('< 3.2.0').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
3232
# We can unpin async when we move to Ruby 3
3333
- gem: async

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"recommendations": [
33
"puppet.puppet-vscode",
4-
"rebornix.Ruby"
4+
"Shopify.ruby-lsp"
55
]
66
}

Gemfile

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,40 +20,39 @@ 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.0', require: false
2324
gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
2425
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
26+
gem "metadata-json-lint", '~> 4.0', require: false
27+
gem "rspec-puppet-facts", '~> 3.0', require: false
2928
gem "dependency_checker", '~> 1.0.0', require: false
3029
gem "parallel_tests", '= 3.12.1', require: false
3130
gem "pry", '~> 0.10', require: false
32-
gem "simplecov-console", '~> 0.5', require: false
31+
gem "simplecov-console", '~> 0.9', require: false
3332
gem "puppet-debugger", '~> 1.0', require: false
34-
gem "rubocop", '= 1.48.1', require: false
33+
gem "rubocop", '~> 1.50.0', require: false
3534
gem "rubocop-performance", '= 1.16.0', require: false
3635
gem "rubocop-rspec", '= 2.19.0', require: false
37-
gem "puppet-strings", '~> 4.0', require: false
3836
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
39-
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 5.0')
37+
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 6.0')
4038
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 1.0')
4139
gem "beaker-hostgenerator"
4240
gem "beaker-rspec"
43-
gem "beaker-puppet", *location_for(ENV['BEAKER_PUPPET_VERSION'] || '~> 3.0') if Gem::Requirement.create('< 3.2.0').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
41+
gem "beaker-puppet", *location_for(ENV['BEAKER_PUPPET_VERSION'] || '~> 4.0') if Gem::Requirement.create('< 3.2.0').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
4442
gem "async", '~> 1', require: false
4543
gem "beaker-module_install_helper", require: false
4644
gem "beaker-puppet_install_helper", require: false
4745
gem "nokogiri", require: false
4846
end
49-
group :system_tests do
50-
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
51-
gem "serverspec", '~> 2.41', require: false
52-
gem "voxpupuli-acceptance", require: false
53-
end
54-
group :release_prep do
47+
group :development, :release_prep do
5548
gem "puppet-strings", '~> 4.0', require: false
56-
gem "puppetlabs_spec_helper", '~> 6.0', require: false
49+
gem "puppetlabs_spec_helper", '~> 7.0', require: false
50+
end
51+
group :system_tests do
52+
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
53+
gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw]
54+
gem "serverspec", '~> 2.41', require: false
55+
gem "voxpupuli-acceptance", require: false
5756
end
5857

5958
puppet_version = ENV['PUPPET_GEM_VERSION']

Rakefile

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -4,86 +4,7 @@ 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
require 'voxpupuli/acceptance/rake' if Gem.loaded_specs.key? 'voxpupuli-acceptance'
109

11-
def changelog_user
12-
return unless Rake.application.top_level_tasks.include? "changelog"
13-
returnVal = nil || JSON.load(File.read('metadata.json'))['author']
14-
raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil?
15-
puts "GitHubChangelogGenerator user:#{returnVal}"
16-
returnVal
17-
end
18-
19-
def changelog_project
20-
return unless Rake.application.top_level_tasks.include? "changelog"
21-
22-
returnVal = nil
23-
returnVal ||= begin
24-
metadata_source = JSON.load(File.read('metadata.json'))['source']
25-
metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z})
26-
27-
metadata_source_match && metadata_source_match[1]
28-
end
29-
30-
raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil?
31-
32-
puts "GitHubChangelogGenerator project:#{returnVal}"
33-
returnVal
34-
end
35-
36-
def changelog_future_release
37-
return unless Rake.application.top_level_tasks.include? "changelog"
38-
returnVal = "v%s" % JSON.load(File.read('metadata.json'))['version']
39-
raise "unable to find the future_release (version) in metadata.json" if returnVal.nil?
40-
puts "GitHubChangelogGenerator future_release:#{returnVal}"
41-
returnVal
42-
end
43-
4410
PuppetLint.configuration.send('disable_relative')
45-
46-
47-
if Gem.loaded_specs.key? 'github_changelog_generator'
48-
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
49-
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?
50-
config.user = "#{changelog_user}"
51-
config.project = "#{changelog_project}"
52-
config.future_release = "#{changelog_future_release}"
53-
config.exclude_labels = ['maintenance']
54-
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)."
55-
config.add_pr_wo_labels = true
56-
config.issues = false
57-
config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB"
58-
config.configure_sections = {
59-
"Changed" => {
60-
"prefix" => "### Changed",
61-
"labels" => ["backwards-incompatible"],
62-
},
63-
"Added" => {
64-
"prefix" => "### Added",
65-
"labels" => ["enhancement", "feature"],
66-
},
67-
"Fixed" => {
68-
"prefix" => "### Fixed",
69-
"labels" => ["bug", "documentation", "bugfix"],
70-
},
71-
}
72-
end
73-
else
74-
desc 'Generate a Changelog from GitHub'
75-
task :changelog do
76-
raise <<EOM
77-
The changelog tasks depends on recent features of the github_changelog_generator gem.
78-
Please manually add it to your .sync.yml for now, and run `pdk update`:
79-
---
80-
Gemfile:
81-
optional:
82-
':development':
83-
- gem: 'github_changelog_generator'
84-
version: '~> 1.15'
85-
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')"
86-
EOM
87-
end
88-
end
89-

metadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"version_requirement": ">= 6.0.0 < 9.0.0"
5858
}
5959
],
60-
"pdk-version": "3.0.1",
61-
"template-url": "https://github.com/puppetlabs/pdk-templates#3.0.1",
62-
"template-ref": "tags/3.0.1-0-gd13288a"
60+
"pdk-version": "3.2.0",
61+
"template-url": "https://github.com/puppetlabs/pdk-templates#3.2.0",
62+
"template-ref": "tags/3.2.0-0-gb257ef1"
6363
}

spec/spec_helper.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,16 @@
2525
next unless File.exist?(f) && File.readable?(f) && File.size?(f)
2626

2727
begin
28-
default_facts.merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true))
28+
require 'deep_merge'
29+
default_facts.deep_merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true))
2930
rescue StandardError => e
3031
RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}"
3132
end
3233
end
3334

3435
# read default_facts and merge them over what is provided by facterdb
3536
default_facts.each do |fact, value|
36-
add_custom_fact fact, value
37+
add_custom_fact fact, value, merge_facts: true
3738
end
3839

3940
RSpec.configure do |c|

0 commit comments

Comments
 (0)