From 36de0d7e32b0c7cd4f2d6f1bf951e15749fb633c Mon Sep 17 00:00:00 2001 From: Maqsood Ahmad Date: Wed, 22 Jul 2026 15:55:38 +0530 Subject: [PATCH] (MODULES-11704) Add Puppet 9 support Widen the puppet requirement to < 10.0.0 and refresh supported OSes (drop EOL/no-agent platforms; add RedHat 10 and Debian 13 where applicable). Gate the newer lint stack (puppet-lint 5.x) behind the Puppet 9 (8.99.x) stream since puppet-lint 4.x crashes on Ruby 3.4+, resolve Puppet 9 prerelease gems from PUPPET_GEM_SOURCE, and disable strict_indent (its expected indentation differs incompatibly between the 7/8 and 9 lint lanes). Point the Spec workflow at the Puppet 9 gem-source branch (installing libcurl headers for the patron native extension) and exclude ubuntu-20.04 from the Puppet 9 acceptance lane only. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/ci.yml | 16 +++++++++++++++- .github/workflows/mend.yml | 2 ++ Gemfile | 24 ++++++++++++++++++------ Rakefile | 5 +++++ manifests/download.pp | 2 +- metadata.json | 2 +- 6 files changed, 42 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c236bbc2..205c4853 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,11 +9,25 @@ on: jobs: Spec: uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main" + with: + # 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" + 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" + ruby_version: "3.2" + flags: >- + --nightly + --arch-exclude arm + --collection-platform-exclude 9:redhat-7 + --collection-platform-exclude 9:centos-7 + --collection-platform-exclude 9:oraclelinux-7 + --collection-platform-exclude 9:debian-10 + --collection-platform-exclude 9:ubuntu-18.04 + --collection-platform-exclude 9:ubuntu-20.04 secrets: "inherit" diff --git a/.github/workflows/mend.yml b/.github/workflows/mend.yml index b4100a5a..4cb71f29 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/Gemfile b/Gemfile index 4e7de031..8bcf959a 100644 --- a/Gemfile +++ b/Gemfile @@ -40,7 +40,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 @@ -60,12 +60,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", git: 'https://github.com/puppetlabs/puppetlabs_spec_helper.git', branch: 'main', 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", git: 'https://github.com/puppetlabs/puppet_litmus.git', branch: 'main', 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 @@ -75,8 +74,21 @@ puppet_version = ENV.fetch('PUPPET_GEM_VERSION', nil) facter_version = ENV.fetch('FACTER_GEM_VERSION', nil) hiera_version = ENV.fetch('HIERA_GEM_VERSION', nil) -gems['puppet'] = location_for(puppet_version, nil, { source: gemsource_puppetcore }) -gems['facter'] = location_for(facter_version, nil, { source: gemsource_puppetcore }) +if puppet_version.to_s.match?(/\A(?:~>\s*)?(?:8\.99|9)/) + # The Puppet 9 stream (8.99.x PRE-releases) is served from a source injected via the + # PUPPET_GEM_SOURCE env var (a CI secret / local export) so no internal host is committed + # here. The secret is often EMPTY (repos without it) and '' is truthy in Ruby, so guard on + # emptiness — not `||` — and fall back to the puppetcore source (auth'd via PUPPET_FORGE_TOKEN). + # The CI matrix labels this lane '~> 9.0' but carries no exact build, so use a prerelease-aware + # range that resolves the newest 8.99.x; an exact PUPPET_GEM_VERSION is honoured as-is. + puppet9_source = ENV['PUPPET_GEM_SOURCE'].to_s.empty? ? gemsource_puppetcore : ENV['PUPPET_GEM_SOURCE'] + puppet9_req = puppet_version.to_s.match?(/\d+\.\d+\.\d/) ? [puppet_version] : ['>= 8.99.0.a', '< 9'] + gems['puppet'] = [*puppet9_req, { require: false, source: puppet9_source }] + gems['facter'] = ['>= 4.11', { require: false, source: puppet9_source }] +else + gems['puppet'] = location_for(puppet_version, nil, { source: gemsource_puppetcore }) + gems['facter'] = location_for(facter_version, nil, { source: gemsource_puppetcore }) +end gems['hiera'] = location_for(hiera_version, nil, {}) if hiera_version # Generate the gem definitions diff --git a/Rakefile b/Rakefile index 31b59305..c88def60 100644 --- a/Rakefile +++ b/Rakefile @@ -13,6 +13,11 @@ 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-11704 / MODULES-11700. +PuppetLint.configuration.send('disable_strict_indent') 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/manifests/download.pp b/manifests/download.pp index 4d451ffc..a62360e3 100644 --- a/manifests/download.pp +++ b/manifests/download.pp @@ -334,7 +334,7 @@ proxy_type => $proxy_type, require => [ Package['unzip'], - Exec["Install Oracle java_se ${java_se} ${version} ${release_major} ${release_minor}"] + Exec["Install Oracle java_se ${java_se} ${version} ${release_major} ${release_minor}"], ], } } diff --git a/metadata.json b/metadata.json index 60caa856..a883a6b0 100644 --- a/metadata.json +++ b/metadata.json @@ -81,7 +81,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 8.0.0 < 9.0.0" + "version_requirement": ">= 8.0.0 < 10.0.0" } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main",