diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f47b156..2bece58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,13 @@ on: jobs: Spec: uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main" + with: + # voxpupuli-puppet-lint-plugins 7.0 (needed for Puppet 9 support) requires + # ruby >= 3.2; the default (3.1) can no longer resolve the :development group. + ruby_version: "3.2" + # puppet_litmus -> bolt 4.x -> faraday-patron -> patron builds a libcurl native extension; + # the runner has no libcurl headers, so install them before bundle (Puppet 9 lane, Ruby 4). + additional_packages: "libcurl4-openssl-dev" secrets: "inherit" Acceptance: @@ -16,4 +23,7 @@ jobs: uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" secrets: "inherit" with: - flags: "--nightly" + flags: "--nightly --collection-platform-exclude 9:redhat-7 --collection-platform-exclude 9:centos-7 --collection-platform-exclude 9:oraclelinux-7 --collection-platform-exclude 9:scientific-7 --collection-platform-exclude 9:debian-10 --collection-platform-exclude 9:ubuntu-18.04 --collection-platform-exclude 9:ubuntu-20.04" + # voxpupuli-puppet-lint-plugins 7.0 (needed for Puppet 9 support) requires + # ruby >= 3.2; the default (3.1) can no longer resolve the :development group. + ruby_version: "3.2" diff --git a/.github/workflows/mend.yml b/.github/workflows/mend.yml index b4100a5..ad8040f 100644 --- a/.github/workflows/mend.yml +++ b/.github/workflows/mend.yml @@ -12,4 +12,8 @@ jobs: mend: uses: "puppetlabs/cat-github-actions/.github/workflows/mend_ruby.yml@main" + with: + # voxpupuli-puppet-lint-plugins 7.0 (needed for Puppet 9 support) requires + # ruby >= 3.2; `bundle lock` resolves all groups at the default ruby (3.1). + ruby_version: "3.2" secrets: "inherit" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 16b2be3..e3bdb3c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -8,6 +8,13 @@ on: jobs: Spec: uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main" + with: + # voxpupuli-puppet-lint-plugins 7.0 (needed for Puppet 9 support) requires + # ruby >= 3.2; the default (3.1) can no longer resolve the :development group. + ruby_version: "3.2" + # puppet_litmus -> bolt 4.x -> faraday-patron -> patron builds a libcurl native extension; + # the runner has no libcurl headers, so install them before bundle (Puppet 9 lane, Ruby 4). + additional_packages: "libcurl4-openssl-dev" secrets: "inherit" Acceptance: @@ -15,4 +22,5 @@ jobs: uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" secrets: "inherit" with: - flags: "--nightly" + flags: "--nightly --collection-platform-exclude 9:redhat-7 --collection-platform-exclude 9:centos-7 --collection-platform-exclude 9:oraclelinux-7 --collection-platform-exclude 9:scientific-7 --collection-platform-exclude 9:debian-10 --collection-platform-exclude 9:ubuntu-18.04 --collection-platform-exclude 9:ubuntu-20.04" + ruby_version: "3.2" diff --git a/.sync.yml b/.sync.yml index 4c06592..8df7546 100644 --- a/.sync.yml +++ b/.sync.yml @@ -8,6 +8,17 @@ Gemfile: optional: ":development": - gem: ruby-pwsh + # MODULES-11721: pin puppetlabs_spec_helper and puppet_litmus above pdk-templates' + # own defaults (>= 8.0 and ~> 2.5 respectively), which are loose enough for a + # scheduled `pdk update` to silently revert this PR: puppetlabs_spec_helper 8.0.0 + # still pins puppet-lint ~> 4.0 (conflicts with voxpupuli-puppet-lint-plugins ~> 7.0, + # needed for Puppet 9), and puppet_litmus below 2.8.0 doesn't support + # --collection-platform-exclude, which ci.yml/nightly.yml pass unconditionally. + overrides: + - gem: 'puppetlabs_spec_helper' + version: '~> 9.0' + - gem: 'puppet_litmus' + version: '~> 2.8' spec/spec_helper.rb: mock_with: ":rspec" coverage_report: true @@ -17,10 +28,37 @@ spec/spec_helper.rb: unmanaged: false .github/workflows/auto_release.yml: unmanaged: false +# MODULES-11721: ci.yml and nightly.yml are maintained by hand because they carry +# Puppet 9 customisations that pdk-templates cannot express -- the `ruby_version` +# and `additional_packages` inputs (no such keys in the templates). Leaving them +# managed means the scheduled `pdk update` PR silently reverts Puppet 9 support. +# acceptance_flags below is kept in step with the hand-written `flags:` -- that part +# IS expressible via the template's own acceptance_flags key, so it isn't itself a +# reason for unmanaged: true; these files stay unmanaged solely for ruby_version and +# additional_packages. They can go back to template management once pdk-templates +# supports those two inputs. .github/workflows/ci.yml: - unmanaged: false + unmanaged: true + acceptance_flags: + - '--nightly' + - '--collection-platform-exclude 9:redhat-7' + - '--collection-platform-exclude 9:centos-7' + - '--collection-platform-exclude 9:oraclelinux-7' + - '--collection-platform-exclude 9:scientific-7' + - '--collection-platform-exclude 9:debian-10' + - '--collection-platform-exclude 9:ubuntu-18.04' + - '--collection-platform-exclude 9:ubuntu-20.04' .github/workflows/nightly.yml: - unmanaged: false + unmanaged: true + acceptance_flags: + - '--nightly' + - '--collection-platform-exclude 9:redhat-7' + - '--collection-platform-exclude 9:centos-7' + - '--collection-platform-exclude 9:oraclelinux-7' + - '--collection-platform-exclude 9:scientific-7' + - '--collection-platform-exclude 9:debian-10' + - '--collection-platform-exclude 9:ubuntu-18.04' + - '--collection-platform-exclude 9:ubuntu-20.04' .github/workflows/release.yml: unmanaged: false .travis.yml: diff --git a/Gemfile b/Gemfile index e887977..897c259 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,7 @@ group :development do 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)) 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)) gem "deep_merge", '~> 1.2.2', require: false - gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false + gem "voxpupuli-puppet-lint-plugins", '~> 7.0', require: false gem "facterdb", '~> 2.1', require: false if Gem::Requirement.create(['< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "facterdb", '~> 3.0', require: false if Gem::Requirement.create(['>= 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "metadata-json-lint", '~> 4.0', require: false @@ -39,12 +39,11 @@ group :development do end group :development, :release_prep do gem "puppet-strings", '~> 4.0', require: false - gem "puppetlabs_spec_helper", '~> 8.0', require: false + gem "puppetlabs_spec_helper", '~> 9.0', require: false gem "puppet-blacksmith", '~> 7.0', require: false end group :system_tests do - gem "puppet_litmus", '~> 2.0', require: false, platforms: [:ruby, :x64_mingw] if !ENV['PUPPET_FORGE_TOKEN'].to_s.empty? - gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] if ENV['PUPPET_FORGE_TOKEN'].to_s.empty? + gem "puppet_litmus", '~> 2.8', require: false, platforms: [:ruby, :x64_mingw] gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "serverspec", '~> 2.41', require: false end @@ -61,7 +60,18 @@ hiera_version = ENV.fetch('HIERA_GEM_VERSION', nil) # If PUPPET_FORGE_TOKEN is set then use authenticated source for both puppet and facter, since facter is a transitive dependency of puppet # Otherwise, do as before and use location_for to fetch gems from the default source -if !ENV['PUPPET_FORGE_TOKEN'].to_s.empty? +if puppet_version.to_s.match?(/\A(?:~>\s*)?(?:8\.99|9)/) + # Puppet 9.0.0 is a released gem on the standard puppetcore source (confirmed: + # puppetlabs-windows_eventlog#100's CI resolves `puppet (9.0.0)` from + # gemsource_puppetcore with no PUPPET_GEM_SOURCE set) -- no separate internal/Twingate + # source or prerelease-specific version matching is needed for it anymore. Uses the + # literal array form (not location_for) because this file's location_for is the + # 2-arg variant that doesn't accept/merge a :source option. Still checked ahead of + # the PUPPET_FORGE_TOKEN branch below, since that branch hardcodes puppet ~> 8.11 + # and would otherwise silently override PUPPET_GEM_VERSION for a Puppet 9 CI leg. + gems['puppet'] = [puppet_version, { require: false, source: 'https://rubygems-puppetcore.puppet.com' }] + gems['facter'] = [facter_version, { require: false, source: 'https://rubygems-puppetcore.puppet.com' }] +elsif !ENV['PUPPET_FORGE_TOKEN'].to_s.empty? gems['puppet'] = ['~> 8.11', { require: false, source: 'https://rubygems-puppetcore.puppet.com' }] gems['facter'] = ['~> 4.11', { require: false, source: 'https://rubygems-puppetcore.puppet.com' }] else diff --git a/Rakefile b/Rakefile index 8522226..a10125e 100644 --- a/Rakefile +++ b/Rakefile @@ -3,7 +3,7 @@ require 'bundler' require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus' require 'puppetlabs_spec_helper/rake_tasks' -require 'puppet-syntax/tasks/puppet-syntax' +require 'puppetlabs-syntax/tasks/puppetlabs-syntax' require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings' PuppetLint.configuration.send('disable_relative') diff --git a/metadata.json b/metadata.json index 3d0dab5..2e5c9e6 100644 --- a/metadata.json +++ b/metadata.json @@ -100,7 +100,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 8.0.0 < 9.0.0" + "version_requirement": ">= 8.0.0 < 10.0.0" } ], "description": "Uses a combination of keytool and Ruby openssl library to manage entries in a Java keystore.",