Skip to content

Commit 76f7bbb

Browse files
authored
Merge pull request #9037 from tvpartytonight/PUP-11716
(PUP-11716) Update for jruby 9.4 and mri ruby >= 3.1.0
2 parents e2f3a0c + 8ffb44c commit 76f7bbb

File tree

6 files changed

+13
-15
lines changed

6 files changed

+13
-15
lines changed

.gemspec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ Gem::Specification.new do |s|
2121
s.version = mdata ? mdata[1] : version
2222

2323
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1")
24-
# Bump this in PUP-11716
25-
s.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
24+
s.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
2625
s.authors = ["Puppet Labs"]
2726
s.date = "2012-08-17"
2827
s.description = "Puppet, an automated configuration management tool"

.github/workflows/checks.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
strategy:
1717
matrix:
1818
cfg:
19-
- {check: rubocop, os: ubuntu-latest, ruby: '2.7'}
20-
- {check: commits, os: ubuntu-latest, ruby: '2.7'}
21-
- {check: warnings, os: ubuntu-latest, ruby: '2.7'}
19+
- {check: rubocop, os: ubuntu-latest, ruby: '3.1'}
20+
- {check: commits, os: ubuntu-latest, ruby: '3.1'}
21+
- {check: warnings, os: ubuntu-latest, ruby: '3.1'}
2222

2323
runs-on: ${{ matrix.cfg.os }}
2424
steps:

.github/workflows/mend.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup Ruby
1616
uses: ruby/setup-ruby@v1
1717
with:
18-
ruby-version: 2.7
18+
ruby-version: 3.1
1919
- name: Create lock
2020
run: bundle lock
2121
- uses: actions/setup-java@v3

.github/workflows/rspec_tests.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ jobs:
1616
strategy:
1717
matrix:
1818
cfg:
19-
- {os: ubuntu-latest, ruby: '2.7'}
20-
- {os: ubuntu-latest, ruby: '3.0'}
19+
- {os: ubuntu-latest, ruby: '3.1'}
2120
- {os: ubuntu-20.04, ruby: '3.2'} # openssl 1.1.1
2221
- {os: ubuntu-22.04, ruby: '3.2'} # openssl 3
23-
- {os: ubuntu-latest, ruby: 'jruby-9.2.21.0'}
24-
- {os: windows-2019, ruby: '2.7'}
25-
- {os: windows-2019, ruby: '3.0'}
22+
- {os: ubuntu-latest, ruby: 'jruby-9.4.2.0'}
23+
- {os: windows-2019, ruby: '3.1'}
2624
- {os: windows-2019, ruby: '3.2'} # openssl 3
2725

2826
runs-on: ${{ matrix.cfg.os }}

lib/puppet.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
require_relative 'puppet/version'
22
require_relative 'puppet/concurrent/synchronized'
33

4-
# Update JRuby version constraints in PUP-11716
5-
if !defined?(JRUBY_VERSION) && Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new("2.7.0")
6-
raise LoadError, "Puppet #{Puppet.version} requires Ruby 2.7.0 or greater, found Ruby #{RUBY_VERSION.dup}."
4+
Puppet::OLDEST_RECOMMENDED_RUBY_VERSION = '3.1.0'
5+
if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new(Puppet::OLDEST_RECOMMENDED_RUBY_VERSION)
6+
raise LoadError, "Puppet #{Puppet.version} requires Ruby #{Puppet::OLDEST_RECOMMENDED_RUBY_VERSION} or greater, found Ruby #{RUBY_VERSION.dup}."
77
end
88

9-
Puppet::OLDEST_RECOMMENDED_RUBY_VERSION = '2.7.0'
109

1110
$LOAD_PATH.extend(Puppet::Concurrent::Synchronized)
1211

spec/unit/ssl/ssl_provider_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@
299299
end
300300

301301
it 'raises if client cert signature is invalid' do
302+
client_cert.public_key = wrong_key.public_key
302303
client_cert.sign(wrong_key, OpenSSL::Digest::SHA256.new)
303304
expect {
304305
subject.create_context(**config.merge(client_cert: client_cert))
@@ -339,6 +340,7 @@
339340

340341
it 'raises if intermediate CA signature is invalid' do
341342
int = global_cacerts.last
343+
int.public_key = wrong_key.public_key if Puppet::Util::Platform.jruby?
342344
int.sign(wrong_key, OpenSSL::Digest::SHA256.new)
343345

344346
expect {

0 commit comments

Comments
 (0)