Skip to content

Commit ffd4633

Browse files
authored
Merge pull request #240 from puppetlabs/revert-239-main
Revert "(maint) Pdk update"
2 parents 60ef6bb + dbb4098 commit ffd4633

File tree

10 files changed

+100
-77
lines changed

10 files changed

+100
-77
lines changed

.gitignore

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,13 @@
1616
/log/
1717
/pkg/
1818
/spec/fixtures/manifests/
19-
/spec/fixtures/modules/*
19+
/spec/fixtures/modules/
2020
/tmp/
2121
/vendor/
22-
/.vendor/
2322
/convert_report.txt
2423
/update_report.txt
2524
.DS_Store
2625
.project
2726
.envrc
2827
/inventory.yaml
2928
/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

.pdkignore

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,19 @@
1616
/log/
1717
/pkg/
1818
/spec/fixtures/manifests/
19-
/spec/fixtures/modules/*
19+
/spec/fixtures/modules/
2020
/tmp/
2121
/vendor/
22-
/.vendor/
2322
/convert_report.txt
2423
/update_report.txt
2524
.DS_Store
2625
.project
2726
.envrc
2827
/inventory.yaml
2928
/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
3629
/.fixtures.yml
3730
/Gemfile
3831
/.gitattributes
39-
/.github/
4032
/.gitignore
4133
/.pdkignore
4234
/.puppet-lint.rc

.puppet-lint.rc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
--fail-on-warnings
21
--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
92
--no-unquoted_string_in_case-check
103
--no-strict_indent-check
114
--no-manifest_whitespace_opening_brace_befor-check
12-
--ignore-paths=.vendor/**/*.pp,.bundle/**/*.pp,pkg/**/*.pp,spec/**/*.pp,tests/**/*.pp,types/**/*.pp,vendor/**/*.pp

.rubocop.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ require:
33
- rubocop-performance
44
- rubocop-rspec
55
AllCops:
6-
NewCops: enable
76
DisplayCopNames: true
87
TargetRubyVersion: '2.6'
98
Include:
@@ -72,8 +71,6 @@ Style/TrailingCommaInArrayLiteral:
7271
Style/SymbolArray:
7372
Description: Using percent style obscures symbolic intent of array's contents.
7473
EnforcedStyle: brackets
75-
Layout/BlockAlignment:
76-
Enabled: false
7774
RSpec/MessageSpies:
7875
EnforcedStyle: receive
7976
Style/Documentation:
@@ -376,8 +373,6 @@ RSpec/VoidExpect:
376373
Enabled: false
377374
RSpec/Yield:
378375
Enabled: false
379-
Security/Open:
380-
Enabled: false
381376
Style/AccessModifierDeclarations:
382377
Enabled: false
383378
Style/AccessorGrouping:
@@ -530,8 +525,6 @@ Lint/DuplicateBranch:
530525
Enabled: false
531526
Lint/DuplicateMagicComment:
532527
Enabled: false
533-
Lint/DuplicateMatchPattern:
534-
Enabled: false
535528
Lint/DuplicateRegexpCharacterClassElement:
536529
Enabled: false
537530
Lint/EmptyBlock:
@@ -634,10 +627,6 @@ RSpec/SubjectDeclaration:
634627
Enabled: false
635628
RSpec/VerifiedDoubleReference:
636629
Enabled: false
637-
Security/CompoundHash:
638-
Enabled: false
639-
Security/IoMethods:
640-
Enabled: false
641630
Style/ArgumentsForwarding:
642631
Enabled: false
643632
Style/ArrayIntersect:
@@ -648,8 +637,6 @@ Style/ComparableClamp:
648637
Enabled: false
649638
Style/ConcatArrayLiterals:
650639
Enabled: false
651-
Style/DataInheritance:
652-
Enabled: false
653640
Style/DirEmpty:
654641
Enabled: false
655642
Style/DocumentDynamicEvalDefinition:
@@ -718,8 +705,6 @@ Style/RedundantHeredocDelimiterQuotes:
718705
Enabled: false
719706
Style/RedundantInitialize:
720707
Enabled: false
721-
Style/RedundantLineContinuation:
722-
Enabled: false
723708
Style/RedundantSelfAssignmentBranch:
724709
Enabled: false
725710
Style/RedundantStringEscape:

.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-
"Shopify.ruby-lsp"
4+
"rebornix.Ruby"
55
]
66
}

Gemfile

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,27 @@ group :development do
1919
gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
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))
22-
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
2422
gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
25-
gem "facterdb", '~> 2.1', require: false
26-
gem "metadata-json-lint", '~> 4.0', require: false
27-
gem "rspec-puppet-facts", '~> 4.0', require: false
23+
gem "facterdb", '~> 1.18', require: false
24+
gem "metadata-json-lint", '~> 3.0', require: false
25+
gem "puppetlabs_spec_helper", '~> 6.0', require: false
26+
gem "rspec-puppet-facts", '~> 2.0', require: false
27+
gem "codecov", '~> 0.2', require: false
2828
gem "dependency_checker", '~> 1.0.0', require: false
2929
gem "parallel_tests", '= 3.12.1', require: false
3030
gem "pry", '~> 0.10', require: false
31-
gem "simplecov-console", '~> 0.9', require: false
31+
gem "simplecov-console", '~> 0.5', require: false
3232
gem "puppet-debugger", '~> 1.0', require: false
33-
gem "rubocop", '~> 1.50.0', require: false
33+
gem "rubocop", '= 1.48.1', require: false
3434
gem "rubocop-performance", '= 1.16.0', require: false
3535
gem "rubocop-rspec", '= 2.19.0', require: false
3636
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
37-
gem "rexml", '>= 3.0.0', '< 3.2.7', require: false
3837
gem "github_changelog_generator", require: false
3938
gem "faraday", '= 1.10.3', require: false
4039
end
41-
group :development, :release_prep do
42-
gem "puppet-strings", '~> 4.0', require: false
43-
gem "puppetlabs_spec_helper", '~> 8.0', require: false
44-
gem "puppet-blacksmith", '~> 7.0', require: false
45-
end
4640
group :system_tests do
47-
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
48-
gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw]
49-
gem "serverspec", '~> 2.41', require: false
41+
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
42+
gem "serverspec", '~> 2.41', require: false
5043
end
5144

5245
puppet_version = ENV['PUPPET_GEM_VERSION']

Rakefile

Lines changed: 80 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,91 @@
11
# frozen_string_literal: true
22

33
require 'bundler'
4-
require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus'
4+
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
55
require 'puppetlabs_spec_helper/rake_tasks'
66
require 'puppet-syntax/tasks/puppet-syntax'
7-
require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings'
7+
require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any?
8+
require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any?
9+
10+
def changelog_user
11+
return unless Rake.application.top_level_tasks.include? "changelog"
12+
returnVal = "puppetlabs" || 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
842

943
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')
1644
PuppetLint.configuration.send('disable_unquoted_string_in_case')
1745
PuppetLint.configuration.send('disable_strict_indent')
1846
PuppetLint.configuration.send('disable_manifest_whitespace_opening_brace_befor')
19-
PuppetLint.configuration.fail_on_warnings = true
20-
PuppetLint.configuration.ignore_paths = [".vendor/**/*.pp", ".bundle/**/*.pp", "pkg/**/*.pp", "spec/**/*.pp", "tests/**/*.pp", "types/**/*.pp", "vendor/**/*.pp"]
47+
48+
49+
if Bundler.rubygems.find_name('github_changelog_generator').any?
50+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
51+
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?
52+
config.user = "#{changelog_user}"
53+
config.project = "#{changelog_project}"
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
2191

metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"version_requirement": ">= 7.18.0 < 9.0.0"
8282
}
8383
],
84-
"pdk-version": "3.3.0",
84+
"pdk-version": "2.7.1",
8585
"template-url": "https://github.com/puppetlabs/pdk-templates#main",
86-
"template-ref": "heads/main-0-gd3cc13f"
86+
"template-ref": "heads/main-0-g1ca5ee4"
8787
}

spec/default_facts.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
#
33
# Facts specified here will override the values provided by rspec-puppet-facts.
44
---
5-
networking:
6-
ip: "172.16.254.254"
7-
ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA"
8-
mac: "AA:AA:AA:AA:AA:AA"
5+
ipaddress: "172.16.254.254"
6+
ipaddress6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA"
97
is_pe: false
8+
macaddress: "AA:AA:AA:AA:AA:AA"
109
pe_build: 2021.4.0
11-
common_appdata: C:/ProgramData
10+
common_appdata: 'C:/ProgramData'
1211

spec/spec_helper.rb

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

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

3534
# read default_facts and merge them over what is provided by facterdb
3635
default_facts.each do |fact, value|
37-
add_custom_fact fact, value, merge_facts: true
36+
add_custom_fact fact, value
3837
end
3938

4039
RSpec.configure do |c|

0 commit comments

Comments
 (0)