Skip to content

Commit d7cee48

Browse files
Merge pull request #375 from puppetlabs/CAT-2281-Remove_puppet_7_test_infrastructure
(CAT-2281) Remove puppet 7 infrastructure
2 parents c5d70da + 020cd90 commit d7cee48

File tree

10 files changed

+79
-49
lines changed

10 files changed

+79
-49
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
ruby_version:
21-
- '2.7'
2221
- '3.2'
2322
include:
24-
- ruby_version: '2.7'
25-
puppet_version: '~> 7.0'
2623
- ruby_version: '3.2'
2724
puppet_version: '~> 8.0'
2825
name: "spec (ruby ${{ matrix.ruby_version }} | puppet ${{ matrix.puppet_version }})"
@@ -38,11 +35,8 @@ jobs:
3835
strategy:
3936
matrix:
4037
ruby_version:
41-
- "2.7"
4238
- "3.2"
4339
include:
44-
- ruby-version: '2.7'
45-
puppet_version: '~> 7.0'
4640
- ruby_version: '3.2'
4741
puppet_version: '~> 8.0'
4842
runs_on:

.github/workflows/custom_acceptance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
ruby_version:
1414
description: "The target Ruby version."
1515
required: false
16-
default: "2.7"
16+
default: "3.1"
1717
type: "string"
1818
puppet_version:
1919
description: "The target Puppet version."

.github/workflows/nightly.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
ruby_version:
14-
- '2.7'
1514
- '3.2'
1615
include:
17-
- ruby_version: '2.7'
18-
puppet_version: '~> 7.0'
1916
- ruby_version: '3.2'
2017
puppet_version: '~> 8.0'
2118
name: "spec (ruby ${{ matrix.ruby_version }} | puppet ${{ matrix.puppet_version }})"
@@ -30,11 +27,8 @@ jobs:
3027
strategy:
3128
matrix:
3229
ruby_version:
33-
- "2.7"
3430
- "3.2"
3531
include:
36-
- ruby-version: '2.7'
37-
puppet_version: '~> 7.0'
3832
- ruby_version: '3.2'
3933
puppet_version: '~> 8.0'
4034
runs_on:

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ AllCops:
1212
- vendor/bundle/**/*
1313
NewCops: enable
1414
SuggestExtensions: false
15-
TargetRubyVersion: '2.7'
15+
TargetRubyVersion: '3.1'
1616

1717
# Disabled
1818
Style/ClassAndModuleChildren:

.rubocop_todo.yml

Lines changed: 66 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2024-01-30 16:36:55 UTC using RuboCop version 1.50.2.
3+
# on 2025-04-09 15:12:12 UTC using RuboCop version 1.70.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 1
10-
# This cop supports safe autocorrection (--autocorrect).
11-
# Configuration parameters: Severity, Include.
12-
# Include: **/*.gemspec
13-
Gemspec/RequireMFA:
14-
Exclude:
15-
- 'ruby-pwsh.gemspec'
169

1710
# Offense count: 1
18-
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
11+
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
1912
Lint/DuplicateBranch:
2013
Exclude:
2114
- 'lib/puppet/provider/dsc_base_provider/dsc_base_provider.rb'
@@ -32,28 +25,29 @@ Lint/IncompatibleIoSelectWithFiberScheduler:
3225
Exclude:
3326
- 'lib/pwsh.rb'
3427

35-
# Offense count: 17
28+
29+
# Offense count: 16
3630
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
3731
Metrics/AbcSize:
38-
Max: 83
32+
Max: 63
3933

40-
# Offense count: 2
34+
# Offense count: 1
4135
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
4236
# AllowedMethods: refine
4337
Metrics/BlockLength:
44-
Max: 35
38+
Max: 28
4539

46-
# Offense count: 2
40+
# Offense count: 1
4741
# Configuration parameters: CountComments, CountAsOne.
4842
Metrics/ClassLength:
49-
Max: 553
43+
Max: 296
5044

5145
# Offense count: 12
5246
# Configuration parameters: AllowedMethods, AllowedPatterns.
5347
Metrics/CyclomaticComplexity:
5448
Max: 24
5549

56-
# Offense count: 23
50+
# Offense count: 22
5751
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
5852
Metrics/MethodLength:
5953
Max: 42
@@ -63,12 +57,21 @@ Metrics/MethodLength:
6357
Metrics/PerceivedComplexity:
6458
Max: 24
6559

60+
# Offense count: 1
61+
# This cop supports safe autocorrection (--autocorrect).
62+
# Configuration parameters: EnforcedStyle, BlockForwardingName.
63+
# SupportedStyles: anonymous, explicit
64+
Naming/BlockForwarding:
65+
Exclude:
66+
- 'lib/pwsh.rb'
67+
6668
# Offense count: 1
6769
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
6870
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
6971
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
7072
Naming/FileName:
7173
Exclude:
74+
- 'Rakefile.rb'
7275
- 'lib/ruby-pwsh.rb'
7376

7477
# Offense count: 1
@@ -118,12 +121,12 @@ RSpec/DescribeClass:
118121
- 'spec/acceptance/dsc/complex.rb'
119122
- 'spec/unit/pwsh_spec.rb'
120123

121-
# Offense count: 32
124+
# Offense count: 38
122125
# Configuration parameters: CountAsOne.
123126
RSpec/ExampleLength:
124127
Max: 70
125128

126-
# Offense count: 105
129+
# Offense count: 151
127130
# Configuration parameters: .
128131
# SupportedStyles: have_received, receive
129132
RSpec/MessageSpies:
@@ -134,7 +137,7 @@ RSpec/MultipleDescribes:
134137
Exclude:
135138
- 'spec/unit/pwsh_spec.rb'
136139

137-
# Offense count: 151
140+
# Offense count: 157
138141
RSpec/MultipleExpectations:
139142
Max: 15
140143

@@ -156,22 +159,64 @@ RSpec/NoExpectationExample:
156159
- 'spec/unit/pwsh/windows_powershell_spec.rb'
157160
- 'spec/unit/pwsh_spec.rb'
158161

159-
# Offense count: 56
162+
# Offense count: 86
160163
RSpec/StubbedMock:
161164
Exclude:
162165
- 'spec/unit/puppet/provider/dsc_base_provider/dsc_base_provider_spec.rb'
163166
- 'spec/unit/pwsh/util_spec.rb'
164167
- 'spec/unit/pwsh/windows_powershell_spec.rb'
165168

166-
# Offense count: 65
169+
# Offense count: 71
167170
RSpec/SubjectStub:
168171
Exclude:
169172
- 'spec/unit/puppet/provider/dsc_base_provider/dsc_base_provider_spec.rb'
170173

174+
171175
# Offense count: 1
172176
# Configuration parameters: AllowedConstants.
173177
Style/Documentation:
174178
Exclude:
175179
- 'spec/**/*'
176180
- 'test/**/*'
177181
- 'lib/puppet/provider/dsc_base_provider/dsc_base_provider.rb'
182+
183+
# Offense count: 3
184+
# This cop supports unsafe autocorrection (--autocorrect-all).
185+
# Configuration parameters: AllowedReceivers.
186+
# AllowedReceivers: Thread.current
187+
Style/HashEachMethods:
188+
Exclude:
189+
- 'lib/puppet/provider/dsc_base_provider/dsc_base_provider.rb'
190+
191+
# Offense count: 2
192+
# This cop supports unsafe autocorrection (--autocorrect-all).
193+
Style/HashExcept:
194+
Exclude:
195+
- 'lib/puppet/provider/dsc_base_provider/dsc_base_provider.rb'
196+
- 'spec/unit/puppet/provider/dsc_base_provider/dsc_base_provider_spec.rb'
197+
198+
# Offense count: 2
199+
# This cop supports unsafe autocorrection (--autocorrect-all).
200+
Style/MapIntoArray:
201+
Exclude:
202+
- 'lib/puppet/provider/dsc_base_provider/dsc_base_provider.rb'
203+
204+
205+
# Offense count: 1
206+
# This cop supports safe autocorrection (--autocorrect).
207+
Style/RedundantRegexpArgument:
208+
Exclude:
209+
- 'spec/unit/pwsh_spec.rb'
210+
211+
# Offense count: 1
212+
# This cop supports safe autocorrection (--autocorrect).
213+
Style/RedundantSelfAssignmentBranch:
214+
Exclude:
215+
- 'lib/puppet/provider/dsc_base_provider/dsc_base_provider.rb'
216+
217+
# Offense count: 1
218+
# This cop supports unsafe autocorrection (--autocorrect-all).
219+
# Configuration parameters: AllowedMethods, AllowedPatterns.
220+
Style/ReturnNilInPredicateMethodDefinition:
221+
Exclude:
222+
- 'lib/puppet/provider/dsc_base_provider/dsc_base_provider.rb'

Gemfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,8 @@ def location_for(place_or_version, fake_version = nil)
1414
end
1515

1616
group :development do
17-
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
18-
gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
19-
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))
2017
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))
2118
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))
2319
gem "deep_merge", '~> 1.0', require: false
2420
gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
2521
gem "facterdb", '~> 1.18', require: false
@@ -30,7 +26,7 @@ group :development do
3026
gem "pry", '~> 0.10', require: false
3127
gem "simplecov-console", '~> 0.9', require: false
3228
gem "puppet-debugger", '~> 1.0', require: false
33-
gem "rubocop", '~> 1.50.0', require: false
29+
gem "rubocop", '~> 1.70.0', require: false
3430
gem "rubocop-performance", '1.22.1', require: false
3531
gem "rubocop-rspec", '= 2.19.0', require: false
3632
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]

lib/puppet/provider/dsc_base_provider/dsc_base_provider.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,8 @@ def invoke_get_method(context, name_hash) # rubocop:disable Metrics/AbcSize
384384
# Canonicalize the results to match the type definition representation;
385385
# failure to do so will prevent the resource_api from comparing the result
386386
# to the should hash retrieved from the resource definition in the manifest.
387-
data.keys.each do |key| # rubocop:disable Style/HashEachMethods
388-
type_key = "dsc_#{key.downcase}".to_sym
387+
data.keys.each do |key|
388+
type_key = :"dsc_#{key.downcase}"
389389
data[type_key] = data.delete(key)
390390

391391
# Special handling for CIM Instances
@@ -598,7 +598,7 @@ def logon_failed_already?(credential_hash)
598598
# @param enumerable [Enumerable] a string, array, hash, or other object to attempt to recursively downcase
599599
def downcase_hash_keys!(enumerable)
600600
if enumerable.is_a?(Hash)
601-
enumerable.keys.each do |key| # rubocop:disable Style/HashEachMethods
601+
enumerable.keys.each do |key|
602602
name = key.dup.downcase
603603
enumerable[name] = enumerable.delete(key)
604604
downcase_hash_keys!(enumerable[name]) if enumerable[name].is_a?(Enumerable)
@@ -1063,7 +1063,7 @@ def escape_quotes(text)
10631063
# With multiple methods which need to discover secrets it is necessary to keep a single regex
10641064
# which can discover them. This will lazily match everything in a single-quoted string which
10651065
# ends with the secret postfix id and mark the actual contents of the string as the secret.
1066-
SECRET_DATA_REGEX = /'(?<secret>[^']+)+?#{Regexp.quote(SECRET_POSTFIX)}'/.freeze
1066+
SECRET_DATA_REGEX = /'(?<secret>[^']+)+?#{Regexp.quote(SECRET_POSTFIX)}'/
10671067

10681068
# Strings containing sensitive data have a secrets postfix. These strings cannot be passed
10691069
# directly either to debug streams or to PowerShell and must be handled; this method contains

lib/pwsh.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ def self.instance(cmd, args, options = {})
6868
#
6969
# @return [Bool] true if enabled
7070
def self.win32console_enabled?
71-
@win32console_enabled ||= defined?(Win32) &&
72-
defined?(Win32::Console) &&
73-
Win32::Console.instance_of?(Class)
71+
@win32console_enabled ||=
72+
defined?(Win32::Console) &&
73+
Win32::Console.instance_of?(Class)
7474
end
7575

7676
# TODO: This thing isn't called anywhere and the variable it sets is never referenced...

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"requirements": [
7979
{
8080
"name": "puppet",
81-
"version_requirement": ">= 7.0.0 < 9.0.0"
81+
"version_requirement": ">= 8.0.0 < 9.0.0"
8282
}
8383
],
8484
"pdk-version": "3.0.1",

ruby-pwsh.gemspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ Gem::Specification.new do |spec|
3232
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
3333
spec.require_paths = ['lib']
3434

35-
spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
35+
spec.required_ruby_version = Gem::Requirement.new('>= 3.1.0')
36+
spec.metadata['rubygems_mfa_required'] = 'true'
3637
end

0 commit comments

Comments
 (0)