MODULES-11721: Add Puppet 9 support - #475
Conversation
e0ff713 to
751988a
Compare
751988a to
b971093
Compare
Follow-up: superseded the temporary git-pins with released gemsThis PR originally pinned
Updated this branch:
An initial version of this fix used Re-verified locally (Ruby 3.2.9, matching this module's own CI Ruby pin, fresh Follows the same corrected pattern already merged in puppetlabs-lvm#391 (MODULES-11719). |
Widens the puppet requirement in metadata.json to >= 8.0.0 < 10.0.0. The
module's CI tooling can't resolve or lint under Puppet 9 as-is, so most of
this change is dependency and workflow plumbing to make the Puppet 9 lane
actually run: voxpupuli-puppet-lint-plugins bumped to ~> 7.0 (puppet-lint
5.x), puppetlabs_spec_helper and puppet_litmus temporarily pinned to git
main (their released versions don't yet carry the puppet-lint relaxation
and --collection-platform-exclude respectively), and the Gemfile resolves
Puppet 9 (8.99.x) prereleases from PUPPET_GEM_SOURCE with a puppetcore
fallback and warning when that secret isn't configured.
ci.yml, nightly.yml and mend.yml gain ruby_version: "3.2" (voxpupuli
puppet-lint-plugins 7.0 requires ruby >= 3.2). The Acceptance flags in
ci.yml/nightly.yml gain --collection-platform-exclude for 9:redhat-7,
9:centos-7, 9:oraclelinux-7, 9:scientific-7 (all el7, no Puppet 9 agent),
9:debian-10, 9:ubuntu-18.04 and 9:ubuntu-20.04 -- confirmed against this
module's own metadata.json and matrix_from_metadata_v3 output, not copied
from another module. ci.yml/nightly.yml are marked unmanaged in .sync.yml
since pdk-templates can't express ruby_version or the collection excludes.
On the Ruby 4 / Puppet 9 lane, puppet_litmus pulls in bolt 4.x, which
depends on faraday-patron -> patron; patron builds a libcurl native
extension and the CI runner has no libcurl headers, so the Spec job in
ci.yml/nightly.yml now sets additional_packages: "libcurl4-openssl-dev"
to install them before bundle install (same fix as puppetlabs-lvm#391).
No manifest/type/provider/function/spec behaviour changes.
Follow-up: the two temporary git-branch pins from the paragraph above have
since been superseded by released gems -- puppetlabs_spec_helper 9.0.0
(relaxes puppet-lint to ~> 5.x, matching voxpupuli-puppet-lint-plugins
~> 7.0) and puppet_litmus 2.8.0 (adds --collection-platform-exclude to
matrix_from_metadata_v3). Both Gemfile entries are now plain, released
version constraints, matching the pattern puppetlabs-lvm#391 landed with.
puppetlabs_spec_helper 9.0.0 also renamed its puppet-syntax dependency to
puppetlabs-syntax, so the Rakefile's require was updated to match --
without it, nothing in the bundle provides the old puppet-syntax path and
the Rakefile raises LoadError.
Opus review pass: tightened the Gemfile's puppet_litmus constraint from
'~> 2.5' to '~> 2.8', since --collection-platform-exclude (which
ci.yml/nightly.yml pass unconditionally) only exists from 2.8.0 onward and
older 2.x releases hard-fail with OptionParser::InvalidOption instead of
degrading gracefully. Added a Gemfile: overrides: block in .sync.yml
pinning puppetlabs_spec_helper to '~> 9.0' and puppet_litmus to '~> 2.8',
so a scheduled `pdk update` can't silently widen back to pdk-templates'
own looser defaults ('>= 8.0' / '~> 2.5') and reintroduce the puppet-lint
4.0/collection-exclude problems this PR fixes. Also corrected the existing
.sync.yml comment on ci.yml/nightly.yml's unmanaged: true: it previously
implied --collection-platform-exclude/acceptance_flags couldn't be
expressed via the templates, but acceptance_flags is a real, supported
.sync.yml key (this file already uses it below) -- the only genuinely
inexpressible inputs are ruby_version and additional_packages, which are
now the sole stated reason.
Follow-up (from puppetlabs-windows_eventlog#100, MODULES-11729): dropped the
PUPPET_GEM_SOURCE-based Puppet 9 prerelease resolution. Confirmed via
windows_eventlog's own CI run (job 97686128656) that puppet 9.0.0 is now a real,
final release on the standard puppetcore source (rubygems-puppetcore.puppet.com,
reached via PUPPET_FORGE_TOKEN) with no PUPPET_GEM_SOURCE/Twingate source needed
-- that CI run resolved `puppet (9.0.0)` and `Bundle complete!` with
PUPPET_GEM_SOURCE unset. This module's own PUPPET_GEM_SOURCE-based path was still
resolving the older `8.99.0.113.gef6e57f` internal prerelease build instead of
the real release.
An Opus review of an initial version of this fix (which called `location_for`
with a third `source:` opts argument, matching windows_eventlog and puppetlabs-
vcsrepo's Gemfile) caught that this module's `location_for` is a 2-arg variant
that doesn't accept or merge a source option -- that call would have raised
`Bundler::Dsl::DSLError: wrong number of arguments` on every Puppet 9 CI job,
failing before gem resolution even starts. Used the literal array form instead
(this module has no `gemsource_puppetcore` variable, so the literal source URL
string is used, matching the style already used in the PUPPET_FORGE_TOKEN-gated
branch immediately below). The Puppet-9-must-be-checked-first ordering guard
against that branch's hardcoded `puppet ~> 8.11` is preserved.
Re-verified with a direct Bundler::Dsl.evaluate under PUPPET_GEM_VERSION="~> 9.0"
(no ArgumentError this time) and a full local run: rake lint clean, rake spec
62 examples, 0 failures.
Co-Authored-By: Claude <noreply@anthropic.com>
b971093 to
dbe9f00
Compare
Follow-up: dropped the internal Puppet 9 prerelease sourceCompared this PR against Fix: removed the Caught by Opus review before pushing: my first attempt called Re-verified with a direct |
Summary
Adds Puppet 9 support to
puppetlabs-java_ks. Widening the version bound inmetadata.jsonis a one-line change; the rest is the dependency and workflow work needed to make the Puppet 9 lane actually run. Same approach as puppetlabs/puppetlabs-firewall#1302.No behaviour changes — no
.pp, type, provider or spec file is touched.metadata.jsonpuppetrequirement:>= 8.0.0 < 9.0.0→>= 8.0.0 < 10.0.0.dependenciesis empty, so nothing else needed widening.operatingsystem_supportdeliberately unchanged — EOL platforms are dropped from the Puppet 9 lane only (see below), preserving their Puppet 8 coverage.Gemfilevoxpupuli-puppet-lint-plugins~> 5.0→~> 7.0puppet-lint5.x, needed for the Puppet 9 / Ruby 4 lane.puppetlabs_spec_helper~> 8.0→~> 9.0puppet-lint ~> 4.0, conflicting with the plugins bump above; 9.0.0 relaxes that to~> 5.x.puppet_litmus~> 2.0/~> 1.0(PUPPET_FORGE_TOKEN-conditional) →~> 2.8(unconditional)--collection-platform-exclude(used by this module's CI, see below) only exists from 2.8.0 onward.puppet/facterresolution[puppet_version, { require: false, source: '...puppetcore...' }]/similar for facter, checked ahead of the pre-existingPUPPET_FORGE_TOKENbranch (see below).This module went through two rounds of revision after the PR was first opened, both driven by comparing against sibling modules in the same epic once they landed:
puppetlabs_spec_helperandpuppet_litmuswere originally pinned to unreleased gitmainbranches, since neither released version had the features above yet. Both shipped as real releases shortly after, so the pins were swapped for the released versions. This also required updatingRakefile'srequire 'puppet-syntax/tasks/puppet-syntax'torequire 'puppetlabs-syntax/tasks/puppetlabs-syntax', sincepuppetlabs_spec_helper9.0.0 renamed that dependency.PUPPET_GEM_SOURCE-based branch, needed because at the time only an internal/Twingate source carried a Puppet 9 prerelease build. Comparing againstpuppetlabs-windows_eventlog#100(MODULES-11729) showed thatpuppet 9.0.0is now a real, final release on the standard puppetcore source — confirmed by CI here resolvingpuppet (9.0.0)directly, so that branch was simplified to a plain source lookup. An Opus review of that simplification caught that this module'slocation_forhelper is a 2-argument variant that can't accept/merge asource:option — using it with a third argument here would have raised a hard Bundler error on every Puppet 9 CI job. Fixed by using the literal array form instead, matching the style of the pre-existingPUPPET_FORGE_TOKENbranch immediately below it.This ordering is still load-bearing, not cosmetic. The pre-existing
elsif !ENV['PUPPET_FORGE_TOKEN'].to_s.empty?branch hardcodespuppet ~> 8.11, ignoringPUPPET_GEM_VERSION. CI sets both that token andPUPPET_GEM_VERSION=~> 9.0, so had the Puppet 9 check been placed after it, the Puppet 9 spec leg would have silently resolved Puppet 8.11 and reported green while never testing Puppet 9 at all..github/workflows/ci.yml,nightly.yml,mend.ymlruby_version: "3.2". Each job runsbundle lockover the:developmentgroup at the reusable workflow's default ruby (3.1), which can no longer resolvevoxpupuli-puppet-lint-plugins7.0 (requires ruby >= 3.2).secrets: inheritwas already present on this module's Spec job, so unlike firewall#1302 nothing needed adding there.--collection-platform-excludeflags on Acceptance (see below)..sync.ymlci.ymlandnightly.ymlmarkedunmanaged: true— they carryruby_version/additional_packagesinputs pdk-templates can't express. (--collection-platform-excludeitself is expressible via the template'sacceptance_flagskey — corrected a comment that previously implied otherwise.)overrides:entries under the existingGemfile:key (which already carried aruby-pwshoptional-gem entry) pinningpuppetlabs_spec_helper(~> 9.0) andpuppet_litmus(~> 2.8) above pdk-templates' own looser defaults, so a scheduledpdk updatecan't silently revert either.Additional Context
Which platforms are excluded from the Puppet 9 lane, and why
9:redhat-7,9:centos-7,9:oraclelinux-7,9:scientific-7,9:debian-10,9:ubuntu-18.04,9:ubuntu-20.04Seven entries rather than firewall's four, because firewall already drops the el-7 clones outright via unconditional
--platform-exclude, whereas this module genuinely tests CentOS 7 / OracleLinux 7 / Scientific 7 under Puppet 8. Every exclude is scoped to collection 9, so Puppet 8 coverage is untouched.Cross-checked against
puppet-agent-private/configs/platforms/on the 9.x line, which no longer containsel-7-*,debian-10-*,ubuntu-18.04-*orubuntu-20.04-*. SLES 12 is still built for Puppet 9, so9:sles-12is deliberately not excluded.No excludes were added for AIX 7.1, Solaris 11, or any Windows release: none of them appear in the generated matrix on any Puppet major, because litmus has no docker or
provision_serviceimage configured for them. That is a pre-existing coverage gap unrelated to Puppet 9, and inventing excludes for untested platforms would be misleading.Verification
Locally on ruby 3.2.9:
rake syntax,rake lint,rake metadata_lintall clean;rake parallel_spec62 examples, 0 failures.manifests/config.pp(the module's only manifest) already satisfies puppet-lint 5.x'sstrict_indent, so no whitespace edits were needed.provision.yamlwas left untouched — it looks stale (debian-8, ubuntu-1404) and is unused by GitHub Actions CI, which drives entirely offmatrix_from_metadata_v3.In CI: the Puppet 9 Spec lane resolves and installs the real
puppet (9.0.0)release from puppetcore and passes.Related Issues (if any)
Checklist
puppet 9.0.0.🤖 Generated with Claude Code