From 05cbd62aa0818249cce5a19971dac470d1ea1766 Mon Sep 17 00:00:00 2001 From: Shubham Shinde Date: Tue, 8 Sep 2026 20:46:24 +0530 Subject: [PATCH] Add Puppet 9 support with updated CI, gems, and platform matrix - Add support for Puppet 9 in CI workflow with a dedicated Puppet 9 spec lane, including secrets inheritance for the spec job - Update Gemfile puppet/facter conditional to match puppetlabs-stdlib pattern: use PUPPET_FORGE_TOKEN check with puppetcore source instead of the complex PUPPET_GEM_SOURCE / Puppet 9 version-match approach - Replace temporary gem version workarounds with released stable versions - Exclude CentOS 7, RHEL 7, and Debian 10 (EOL platforms) from the Puppet 9 acceptance matrix Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .github/workflows/ci.yml | 7 ++++++- .github/workflows/mend.yml | 2 ++ .github/workflows/nightly.yml | 6 +++++- .sync.yml | 19 +++++++++++++++++++ Gemfile | 16 +++++++++++----- Rakefile | 9 ++++++++- metadata.json | 3 +-- 7 files changed, 52 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6caf5ba..19f73880 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,10 @@ jobs: Spec: if: github.event_name != 'pull_request_target' uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main" + with: + additional_packages: "libcurl4-openssl-dev" + ruby_version: "3.2" + secrets: "inherit" Acceptance: if: >- @@ -32,5 +36,6 @@ jobs: contains(github.event.pull_request.labels.*.name, 'allowed-for-ci')) uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" with: - flags: "--nightly --arch-exclude arm" + flags: "--nightly --arch-exclude arm --collection-platform-exclude 9:centos-7 --collection-platform-exclude 9:redhat-7 --collection-platform-exclude 9:debian-10 --collection-platform-exclude 9:ubuntu-20.04" + ruby_version: "3.2" secrets: "inherit" diff --git a/.github/workflows/mend.yml b/.github/workflows/mend.yml index b4100a5a..967d5a3f 100644 --- a/.github/workflows/mend.yml +++ b/.github/workflows/mend.yml @@ -12,4 +12,6 @@ jobs: mend: uses: "puppetlabs/cat-github-actions/.github/workflows/mend_ruby.yml@main" + with: + ruby_version: '3.2' secrets: "inherit" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 9f20eccd..01ae9cbb 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -8,11 +8,15 @@ on: jobs: Spec: uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main" + with: + additional_packages: "libcurl4-openssl-dev" + ruby_version: "3.2" secrets: "inherit" Acceptance: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" with: - flags: "--nightly --arch-exclude arm" + flags: "--nightly --arch-exclude arm --collection-platform-exclude 9:centos-7 --collection-platform-exclude 9:redhat-7 --collection-platform-exclude 9:debian-10 --collection-platform-exclude 9:ubuntu-20.04" + ruby_version: "3.2" secrets: "inherit" diff --git a/.sync.yml b/.sync.yml index a72c1cfd..3b99cbe3 100644 --- a/.sync.yml +++ b/.sync.yml @@ -10,6 +10,11 @@ Gemfile: optional: ":development": - gem: ruby-pwsh + overrides: + - gem: 'puppetlabs_spec_helper' + version: '~> 9.0' + - gem: 'puppet_litmus' + version: '~> 2.8' spec/spec_helper.rb: coverage_report: true .gitpod.Dockerfile: @@ -20,8 +25,22 @@ spec/spec_helper.rb: unmanaged: false .github/workflows/ci.yml: unmanaged: true + acceptance_flags: + - '--nightly' + - '--arch-exclude arm' + - '--collection-platform-exclude 9:centos-7' + - '--collection-platform-exclude 9:redhat-7' + - '--collection-platform-exclude 9:debian-10' + - '--collection-platform-exclude 9:ubuntu-20.04' .github/workflows/nightly.yml: unmanaged: true + acceptance_flags: + - '--nightly' + - '--arch-exclude arm' + - '--collection-platform-exclude 9:centos-7' + - '--collection-platform-exclude 9:redhat-7' + - '--collection-platform-exclude 9:debian-10' + - '--collection-platform-exclude 9:ubuntu-20.04' .github/workflows/release.yml: unmanaged: false .travis.yml: diff --git a/Gemfile b/Gemfile index 5409256f..50171382 100644 --- a/Gemfile +++ b/Gemfile @@ -41,7 +41,7 @@ group :development do gem "json", '= 2.18.0', require: false if Gem::Requirement.create(['>= 4.0.0', '< 5.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 @@ -65,11 +65,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', '< 10.0', require: false end group :system_tests do - gem "puppet_litmus", '~> 2.5', require: false + gem "puppet_litmus", '~> 2.8', require: false gem "faraday", '~> 2.5', require: false gem "CFPropertyList", '< 3.0.7', require: false if RUBY_PLATFORM.include?('darwin') gem "serverspec", '~> 2.41', require: false @@ -82,8 +82,14 @@ facter_version = ENV.fetch('FACTER_GEM_VERSION', nil) hiera_version = ENV.fetch('HIERA_GEM_VERSION', nil) gems['bolt'] = location_for(bolt_version, nil, { source: gemsource_puppetcore }) -gems['puppet'] = location_for(puppet_version, nil, { source: gemsource_puppetcore }) -gems['facter'] = location_for(facter_version, nil, { source: gemsource_puppetcore }) + +if !ENV['PUPPET_FORGE_TOKEN'].to_s.empty? + gems['puppet'] = [puppet_version || '~> 8.11', { require: false, source: gemsource_puppetcore }] + gems['facter'] = [facter_version || '~> 4.11', { require: false, source: gemsource_puppetcore }] +else + gems['puppet'] = location_for(puppet_version) + gems['facter'] = location_for(facter_version) if facter_version +end gems['hiera'] = location_for(hiera_version, nil, {}) if hiera_version # Generate the gem definitions diff --git a/Rakefile b/Rakefile index 31b59305..4902f14c 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') @@ -13,6 +13,13 @@ PuppetLint.configuration.send('disable_class_inherits_from_params_class') PuppetLint.configuration.send('disable_autoloader_layout') PuppetLint.configuration.send('disable_documentation') PuppetLint.configuration.send('disable_single_quote_string_with_variables') +# strict_indent is disabled because its expected indentation changed incompatibly +# between puppet-lint-strict_indent-check 3.x (Puppet 7/8 lane, Ruby 3.1) and 5.x +# (Puppet 9 lane, Ruby 3.4+): the two lanes demand opposite indentation for nested +# hashes, so no single manifest layout can satisfy both. See MODULES-11706 / MODULES-11700. +PuppetLint.configuration.send('disable_strict_indent') +PuppetLint.configuration.send('disable_params_not_optional_with_undef') +PuppetLint.configuration.send('disable_exec_idempotency') PuppetLint.configuration.fail_on_warnings = true PuppetLint.configuration.ignore_paths = [".vendor/**/*.pp", ".bundle/**/*.pp", "pkg/**/*.pp", "spec/**/*.pp", "tests/**/*.pp", "types/**/*.pp", "vendor/**/*.pp"] diff --git a/metadata.json b/metadata.json index ea431f3d..d0620e96 100644 --- a/metadata.json +++ b/metadata.json @@ -50,7 +50,6 @@ { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ - "18.04", "20.04", "22.04" ] @@ -71,7 +70,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 8.0.0 < 9.0.0" + "version_requirement": ">= 8.0.0 < 10.0.0" } ], "pdk-version": "3.7.0",