Skip to content

Commit 5a63923

Browse files
committed
(PA-7897) pdk update --template-ref 3.6.1.1
Notable pdk template changes: * bumps rubocop to 1.73.x and updates rubocop.yml based on ruby 3.1 target version. * If PUPPET_FORGE_TOKEN env variable is defined, install bolt dependency from puppetcore rubygem source. BOLT_GEM_VERSION can also be used to constrain the gem, like PUPPET_GEM_VERSION. * puppet_litmus 1.6.1 added a minimum bolt 4 requirement. Exclude 1.6.1 until we're ready for bolt 4 in a separate ticket. * drops orchestrator_client pin * disable Style/FileNull as it breaks tests on windows
1 parent 9dd2dfd commit 5a63923

6 files changed

Lines changed: 46 additions & 43 deletions

File tree

.rubocop.yml

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
---
2-
require:
2+
plugins:
33
- rubocop-performance
44
- rubocop-rspec
5+
- rubocop-rspec_rails
6+
- rubocop-factory_bot
7+
- rubocop-capybara
58
AllCops:
69
NewCops: enable
710
DisplayCopNames: true
@@ -75,6 +78,8 @@ RSpec/NamedSubject:
7578
Enabled: false
7679
RSpec/SubjectStub:
7780
Enabled: false
81+
Style/FileNull:
82+
Enabled: false
7883
RSpec/MessageSpies:
7984
EnforcedStyle: receive
8085
Style/Documentation:
@@ -123,6 +128,12 @@ Capybara/CurrentPathExpectation:
123128
Enabled: false
124129
Capybara/VisibilityMatcher:
125130
Enabled: false
131+
FactoryBot/AttributeDefinedStatically:
132+
Enabled: false
133+
FactoryBot/CreateList:
134+
Enabled: false
135+
FactoryBot/FactoryClassName:
136+
Enabled: false
126137
Gemspec/DuplicatedAssignment:
127138
Enabled: false
128139
Gemspec/OrderedDependencies:
@@ -297,8 +308,6 @@ Performance/UriDefaultParser:
297308
Enabled: false
298309
RSpec/Be:
299310
Enabled: false
300-
RSpec/Capybara/FeatureMethods:
301-
Enabled: false
302311
RSpec/ContainExactly:
303312
Enabled: false
304313
RSpec/ContextMethod:
@@ -307,6 +316,8 @@ RSpec/ContextWording:
307316
Enabled: false
308317
RSpec/DescribeClass:
309318
Enabled: false
319+
RSpec/Dialect:
320+
Enabled: false
310321
RSpec/EmptyHook:
311322
Enabled: false
312323
RSpec/EmptyLineAfterExample:
@@ -323,12 +334,6 @@ RSpec/ExpectChange:
323334
Enabled: false
324335
RSpec/ExpectInHook:
325336
Enabled: false
326-
RSpec/FactoryBot/AttributeDefinedStatically:
327-
Enabled: false
328-
RSpec/FactoryBot/CreateList:
329-
Enabled: false
330-
RSpec/FactoryBot/FactoryClassName:
331-
Enabled: false
332337
RSpec/HooksBeforeExamples:
333338
Enabled: false
334339
RSpec/ImplicitBlockExpectation:
@@ -503,6 +508,12 @@ Capybara/SpecificFinders:
503508
Enabled: false
504509
Capybara/SpecificMatcher:
505510
Enabled: false
511+
FactoryBot/ConsistentParenthesesStyle:
512+
Enabled: false
513+
FactoryBot/FactoryNameStyle:
514+
Enabled: false
515+
FactoryBot/SyntaxMethods:
516+
Enabled: false
506517
Gemspec/DeprecatedAttributeAssignment:
507518
Enabled: false
508519
Gemspec/DevelopmentDependencies:
@@ -603,28 +614,12 @@ RSpec/DuplicatedMetadata:
603614
Enabled: false
604615
RSpec/ExcessiveDocstringSpacing:
605616
Enabled: false
606-
RSpec/FactoryBot/ConsistentParenthesesStyle:
607-
Enabled: false
608-
RSpec/FactoryBot/FactoryNameStyle:
609-
Enabled: false
610-
RSpec/FactoryBot/SyntaxMethods:
611-
Enabled: false
612617
RSpec/IdenticalEqualityAssertion:
613618
Enabled: false
614619
RSpec/NoExpectationExample:
615620
Enabled: false
616621
RSpec/PendingWithoutReason:
617622
Enabled: false
618-
RSpec/Rails/AvoidSetupHook:
619-
Enabled: false
620-
RSpec/Rails/HaveHttpStatus:
621-
Enabled: false
622-
RSpec/Rails/InferredSpecType:
623-
Enabled: false
624-
RSpec/Rails/MinitestAssertions:
625-
Enabled: false
626-
RSpec/Rails/TravelAround:
627-
Enabled: false
628623
RSpec/RedundantAround:
629624
Enabled: false
630625
RSpec/SkipBlockInsideExample:
@@ -635,6 +630,16 @@ RSpec/SubjectDeclaration:
635630
Enabled: false
636631
RSpec/VerifiedDoubleReference:
637632
Enabled: false
633+
RSpecRails/AvoidSetupHook:
634+
Enabled: false
635+
RSpecRails/HaveHttpStatus:
636+
Enabled: false
637+
RSpecRails/InferredSpecType:
638+
Enabled: false
639+
RSpecRails/MinitestAssertions:
640+
Enabled: false
641+
RSpecRails/TravelAround:
642+
Enabled: false
638643
Security/CompoundHash:
639644
Enabled: false
640645
Security/IoMethods:

.sync.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
Enabled: false
1010
Style/ClassAndModuleChildren:
1111
Enabled: false
12+
Style/FileNull:
13+
Enabled: false
1214
Gemfile:
1315
optional:
1416
":development":
@@ -29,17 +31,9 @@ Gemfile:
2931
- gem: beaker-module_install_helper
3032
- gem: beaker-puppet_install_helper
3133
- gem: nokogiri
32-
- gem: 'bolt'
33-
version: '~> 3.0'
34-
condition: 'ENV["GEM_BOLT"]'
3534
- gem: 'beaker-task_helper'
3635
version: '~> 1.9'
3736
condition: 'ENV["GEM_BOLT"]'
38-
# The Faraday requirements in orchestrator_client 0.7.1 causes Bundler to
39-
# resolve the dependency in unexpected ways and causes issues in CI
40-
- gem: 'orchestrator_client'
41-
version: '< 0.7.1'
42-
condition: 'ENV["GEM_BOLT"]'
4337
":system_tests":
4438
- gem: voxpupuli-acceptance
4539
version: '~> 3'

Gemfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,13 @@ group :development do
5252
gem "pry", '~> 0.10', require: false
5353
gem "simplecov-console", '~> 0.9', require: false
5454
gem "puppet-debugger", '~> 1.6', require: false
55-
gem "rubocop", '~> 1.50.0', require: false
56-
gem "rubocop-performance", '= 1.16.0', require: false
57-
gem "rubocop-rspec", '= 2.19.0', require: false
55+
gem "rubocop", '~> 1.73.0', require: false
56+
gem "rubocop-performance", '~> 1.24.0', require: false
57+
gem "rubocop-rspec", '~> 3.5.0', require: false
58+
gem "rubocop-rspec_rails", '~> 2.31.0', require: false
59+
gem "rubocop-factory_bot", '~> 2.27.0', require: false
60+
gem "rubocop-capybara", '~> 2.22.0', require: false
61+
gem "rubocop-ast", '< 1.43.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
5862
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
5963
gem "bigdecimal", '< 3.2.2', require: false, platforms: [:mswin, :mingw, :x64_mingw]
6064
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 6.0')
@@ -65,9 +69,7 @@ group :development do
6569
gem "beaker-module_install_helper", require: false
6670
gem "beaker-puppet_install_helper", require: false
6771
gem "nokogiri", require: false
68-
gem "bolt", '~> 3.0', require: false if ENV["GEM_BOLT"]
6972
gem "beaker-task_helper", '~> 1.9', require: false if ENV["GEM_BOLT"]
70-
gem "orchestrator_client", '< 0.7.1', require: false if ENV["GEM_BOLT"]
7173
end
7274
group :development, :release_prep do
7375
gem "puppet-strings", '~> 4.0', require: false
@@ -76,17 +78,19 @@ group :development, :release_prep do
7678
end
7779
group :system_tests do
7880
gem "puppet_litmus", '~> 2.0', require: false, platforms: [:ruby, :x64_mingw] if !ENV['PUPPET_FORGE_TOKEN'].to_s.empty?
79-
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] if ENV['PUPPET_FORGE_TOKEN'].to_s.empty?
81+
gem "puppet_litmus", '~> 1.0', '!= 1.6.1', require: false, platforms: [:ruby, :x64_mingw] if ENV["PUPPET_FORGE_TOKEN"].to_s.empty?
8082
gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw]
8183
gem "serverspec", '~> 2.41', require: false
8284
gem "voxpupuli-acceptance", '~> 3', require: false
8385
end
8486

8587
gems = {}
88+
bolt_version = ENV.fetch('BOLT_GEM_VERSION', nil)
8689
puppet_version = ENV.fetch('PUPPET_GEM_VERSION', nil)
8790
facter_version = ENV.fetch('FACTER_GEM_VERSION', nil)
8891
hiera_version = ENV.fetch('HIERA_GEM_VERSION', nil)
8992

93+
gems['bolt'] = location_for(bolt_version, nil, { source: gemsource_puppetcore })
9094
gems['puppet'] = location_for(puppet_version, nil, { source: gemsource_puppetcore })
9195
gems['facter'] = location_for(facter_version, nil, { source: gemsource_puppetcore })
9296
gems['hiera'] = location_for(hiera_version, nil, {}) if hiera_version

lib/facter/env_temp_variable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
Facter.add(:env_temp_variable) do
44
setcode do
5-
(ENV['TEMP'] || Dir.tmpdir)
5+
ENV['TEMP'] || Dir.tmpdir
66
end
77
end

metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@
8383
}
8484
],
8585
"pdk-version": "3.6.1",
86-
"template-url": "https://github.com/puppetlabs/pdk-templates#3.5.1",
87-
"template-ref": "tags/3.5.1-0-g9d5b193"
86+
"template-url": "https://github.com/puppetlabs/pdk-templates#3.6.1.1",
87+
"template-ref": "tags/3.6.1.1-0-g5fe78cc"
8888
}

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
begin
2929
require 'deep_merge'
30-
default_facts.deep_merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true))
30+
default_facts.deep_merge!(YAML.safe_load_file(f, permitted_classes: [], permitted_symbols: [], aliases: true))
3131
rescue StandardError => e
3232
RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}"
3333
end

0 commit comments

Comments
 (0)