Skip to content

(MODULES-11710) Add Puppet 9 support - #1482

Open
skyamgarp wants to merge 1 commit into
mainfrom
MODULES-11710
Open

(MODULES-11710) Add Puppet 9 support#1482
skyamgarp wants to merge 1 commit into
mainfrom
MODULES-11710

Conversation

@skyamgarp

Copy link
Copy Markdown
Contributor

Summary

Adds Puppet 9 support to puppetlabs-stdlib, following the same pattern established in puppetlabs-apache#2638 (MODULES-11700).

Jira: MODULES-11710

What's included

  • metadata.json: raises the Puppet upper bound (< 9.0.0< 10.0.0) and drops EOL platforms that Puppet 8/9 don't ship agents for (EL7 family, CentOS 8, Debian 10, SLES 12, Ubuntu 18.04).
  • Version-conditional lint tooling (Gemfile): the Puppet 9 lane runs on Ruby 3.4+, where puppet-lint 4.x crashes; the Puppet 7/8 lane runs on Ruby 3.1, where voxpupuli-puppet-lint-plugins ~> 7.0 won't resolve. Gated behind a puppet9_stream check derived from PUPPET_GEM_VERSION, keeping released tooling on 7/8.
  • strict_indent disabled (Rakefile): puppet-lint-strict_indent-check demands opposite indentation between the 3.x (7/8) and 5.x (9) plugin versions, so no single manifest layout passes both lanes.
  • Puppet 9 gem source (Gemfile): the 8.99.x prerelease is fetched via PUPPET_GEM_SOURCE (internal Artifactory), reachable over Twingate in CI.
  • ci.yml: Spec job points at the cat-github-actions branch that wires PUPPET_GEM_SOURCE/Twingate for the Puppet 9 lane; Acceptance flags gain --collection-platform-exclude 9:ubuntu-20.04 (Focal has no Puppet 9 agent).

Dependencies

Like the Apache PR, this temporarily pins two companion branches; both should revert to released refs once merged:

  • puppet_litmus #627 — adds --collection-platform-exclude to matrix_from_metadata_v3 (Gemfile pins the branch).
  • cat-github-actions #182 — passes PUPPET_GEM_SOURCE + Twingate for the Puppet 9 spec lane (ci.yml Spec pins the branch).

Testing

  • bundle exec rake lint clean on Ruby 3.1 (Puppet 7/8 lane, current tooling).
  • bundle exec metadata-json-lint metadata.json clean.
  • Full classes/defines/functions/unit spec suite (1758 examples) passes; on_supported_os-driven specs correctly reflect the trimmed OS matrix.
  • Puppet 9 (Ruby 3.4 + Twingate/Artifactory) lane cannot be exercised locally; relies on CI once the companion branches are available.

🤖 Generated with Claude Code

@skyamgarp
skyamgarp force-pushed the MODULES-11710 branch 6 times, most recently from 600bcf7 to aa6accf Compare July 28, 2026 08:33

@shubhamshinde360 shubhamshinde360 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Holding merge till get the puppet_litmus and puppetlabs_spec_helper gems released.

Comment thread Gemfile Outdated
gem "deep_merge", '~> 1.2.2', require: false
gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
if puppet9_stream
gem "voxpupuli-puppet-lint-plugins", '~> 7.0', require: false

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing different linting based on the puppet version just feels wrong. IMO this needs to be cleaned up before it's merged

Comment thread metadata.json
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please tell me you don't plan to drop operating systems and don't even mention it in the PR title

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will address this in separate PR. Thanks.

Comment thread metadata.json
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 8.0.0 < 9.0.0"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it's wrong to bump this when there is no version 9 available yet. We simply don't know if it will be compatible

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this PR we are testing against internal Puppet 9 version.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine for testing, but IMO it shouldn't be merged before public/official releases are available.

Comment thread spec/functions/to_json_pretty_spec.rb Outdated
# JSON.pretty_generate's formatting of empty arrays/hashes changed between json gem
# versions (older gems emit "[\n\n]"/"{\n}", newer ones emit the compact "[]"/"{}"), so
# assert against whatever the loaded json gem actually produces rather than a fixed string.
it { is_expected.to run.with_params([]).and_return("#{JSON.pretty_generate([])}\n") }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this test worth if it matches the implementation exactly?

@skyamgarp
skyamgarp changed the base branch from main to drop-eol-os-support July 31, 2026 05:36
@skyamgarp
skyamgarp changed the base branch from drop-eol-os-support to main August 3, 2026 10:41
@skyamgarp
skyamgarp dismissed shubhamshinde360’s stale review August 3, 2026 10:41

The base branch was changed.

Comment thread Rakefile Outdated
# 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-11710.
PuppetLint.configuration.send('disable_strict_indent')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this is bad. The plugin is important and you should use the latest version, even on Puppet 8.

@skyamgarp
skyamgarp force-pushed the MODULES-11710 branch 4 times, most recently from cf16fd0 to ed9f1e8 Compare August 3, 2026 15:11
skyamgarp added a commit to puppetlabs/puppetlabs-ntp that referenced this pull request Aug 4, 2026
Widens the puppet requirement to admit 9.0.x. Follows the current
puppetlabs-stdlib#1482 pattern: voxpupuli-puppet-lint-plugins and
puppetlabs_spec_helper are bumped unconditionally (no per-lane
version split), since puppet-lint 7.0 (Ruby >= 3.2) is used across
both the Puppet 7/8 and Puppet 9 lanes. puppetlabs_spec_helper is
pinned to its git main branch until puppet-lint 5.x support ships in
a release (puppetlabs/puppetlabs_spec_helper#485, merged but
unreleased).

ci.yml and mend.yml bump ruby_version to 3.2 to match, and Acceptance/
mend point at a temporary cat-github-actions branch
(MODULES-11710-ruby-version-input) that adds a ruby_version input to
module_acceptance.yml/mend_ruby.yml — both hardcode Ruby 3.1
otherwise, which can't resolve the new Gemfile. Swap back to @main
once that branch merges.

The puppet/facter gem source resolution is unchanged: Puppet 9
(8.99.x) prereleases are fetched via PUPPET_GEM_SOURCE, falling back
to the existing puppetcore source when unset.

This module's manifests already comply with puppet-lint-strict_indent-
check 5.x, so no Rakefile change is needed (unlike the stdlib PR's
earlier iteration) — verified locally with `rake lint` on Ruby 3.2.

This branch intentionally does not touch operatingsystem_support;
that work is split into a separate PR (OS add/drop, mirroring the
same fleet-wide rollout) to keep pre-existing, separately-tracked
provisioning issues (CAT-2152, CAT-2511) off this PR.

Ref: puppetlabs/puppetlabs-stdlib#1482

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@skyamgarp
skyamgarp force-pushed the MODULES-11710 branch 4 times, most recently from 4fe4368 to 800bf93 Compare August 10, 2026 05:34
Bumps the puppet version_requirement to < 10.0.0, drops EOL platforms
Puppet 8/9 don't ship agents for (EL7 family, CentOS 8, Debian 10,
SLES 12, Ubuntu 18.04), gates lint tooling (voxpupuli-puppet-lint-plugins,
puppetlabs_spec_helper, puppet_litmus) and the puppet/facter gem source
behind a Puppet 9 (8.99.x) stream check in the Gemfile, disables the
strict_indent lint check whose rules conflict between the two plugin
versions, and wires ci.yml to the companion branches needed for the
Puppet 9 spec/acceptance lanes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
skyamgarp added a commit to puppetlabs/puppetlabs-ntp that referenced this pull request Aug 11, 2026
Puppet 9 ships no agent build for redhat-7, sles-12, debian-10,
ubuntu-18.04, or ubuntu-20.04 — confirmed by CI (all five failed
acceptance only on the puppetcore9-nightly collection). Adds
--collection-platform-exclude 9:<platform> for each so they stay in
the Puppet 8 acceptance lane while dropping out of Puppet 9, instead
of failing there.

That flag needs puppet_litmus's unreleased --collection-platform-
exclude support for matrix_from_metadata_v3 (merged to main in
puppetlabs/puppet_litmus#627, not yet in a release — latest is
v2.7.0), so the Gemfile now pins puppet_litmus to its git main branch
whenever PUPPET_FORGE_TOKEN is set (i.e. in CI), matching the current
puppetlabs-stdlib#1482 pattern.

Ref: puppetlabs/puppetlabs-stdlib#1482

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
skyamgarp added a commit to puppetlabs/puppetlabs-reboot that referenced this pull request Aug 12, 2026
…ease range

puppetlabs_spec_helper (released and main) still pins puppet-syntax ~> 4.1,
which requires puppet < 9. Puppet 9 is currently only available as 8.99.x
prereleases, so a loose CI constraint like '~> 9.0' asked bundler for a real
>= 9.0.0 gem and conflicted with that pin. Mirror stdlib's workaround
(puppetlabs/puppetlabs-stdlib#1482): remap loose 8.99/9-ish constraints to
'>= 8.99.0.a', '< 9' so they resolve within the prerelease range instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
skyamgarp added a commit to puppetlabs/puppetlabs-reboot that referenced this pull request Aug 12, 2026
- metadata.json: bump the puppet version_requirement upper bound from
  < 9.0.0 to < 10.0.0.
- ci.yml: exclude EOL platforms (EL7 family, CentOS 8, SLES 12,
  Debian 10) from the Puppet 9 acceptance lane only, since Puppet 9
  ships no agent for them. They remain supported for Puppet 8. Also
  install libcurl dev headers for the Spec job, needed to build the
  patron native extension pulled in transitively below.
- Gemfile:
  - temporarily point puppet_litmus at main, since
    --collection-platform-exclude support (puppetlabs/puppet_litmus#627)
    hasn't shipped in a release yet.
  - remap loose Puppet 9 constraints (e.g. '~> 9.0') to the actual
    8.99.x prerelease range ('>= 8.99.0.a', '< 9'), served from the
    source in PUPPET_GEM_SOURCE, since puppetlabs_spec_helper's
    puppet-syntax pin still requires puppet < 9.

Ref: puppetlabs/puppetlabs-stdlib#1482

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
skyamgarp added a commit to puppetlabs/puppetlabs-reboot that referenced this pull request Aug 12, 2026
- metadata.json: bump the puppet version_requirement upper bound from
  < 9.0.0 to < 10.0.0.
- ci.yml:
  - exclude EOL platforms (EL7 family, CentOS 8, SLES 12, Debian 10)
    from the Puppet 9 acceptance lane only, since Puppet 9 ships no
    agent for them. They remain supported for Puppet 8.
  - install libcurl dev headers for the Spec job, needed to build the
    patron native extension pulled in transitively via puppet_litmus.
  - bump ruby_version to 3.2 for the Spec job, required by the
    voxpupuli-puppet-lint-plugins bump below.
- Gemfile:
  - temporarily point puppet_litmus at main, since
    --collection-platform-exclude support (puppetlabs/puppet_litmus#627)
    hasn't shipped in a release yet.
  - remap loose Puppet 9 constraints (e.g. '~> 9.0') to the actual
    8.99.x prerelease range ('>= 8.99.0.a', '< 9'), served from the
    source in PUPPET_GEM_SOURCE, since puppetlabs_spec_helper's
    puppet-syntax pin still requires puppet < 9.
  - bump voxpupuli-puppet-lint-plugins to ~> 7.0, since puppet-lint 4.x
    crashes under Ruby 4.0 (used for the Puppet 9 lane).
  - temporarily point puppetlabs_spec_helper at main, since the
    puppet-lint ~> 5.1 needed by the bump above
    (puppetlabs/puppetlabs_spec_helper#485) hasn't shipped in a
    release yet.

Ref: puppetlabs/puppetlabs-stdlib#1482

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
skyamgarp added a commit to puppetlabs/puppetlabs-reboot that referenced this pull request Aug 12, 2026
- metadata.json: bump the puppet version_requirement upper bound from
  < 9.0.0 to < 10.0.0.
- ci.yml:
  - exclude EOL platforms (EL7 family, CentOS 8, SLES 12, Debian 10)
    from the Puppet 9 acceptance lane only, since Puppet 9 ships no
    agent for them. They remain supported for Puppet 8.
  - install libcurl dev headers for the Spec job, needed to build the
    patron native extension pulled in transitively via puppet_litmus.
  - bump ruby_version to 3.2 for the Spec job, required by the
    voxpupuli-puppet-lint-plugins bump below.
- Gemfile:
  - temporarily point puppet_litmus at main, since
    --collection-platform-exclude support (puppetlabs/puppet_litmus#627)
    hasn't shipped in a release yet.
  - remap loose Puppet 9 constraints (e.g. '~> 9.0') to the actual
    8.99.x prerelease range ('>= 8.99.0.a', '< 9'), served from the
    source in PUPPET_GEM_SOURCE, since puppetlabs_spec_helper's
    puppet-syntax pin still requires puppet < 9.
  - bump voxpupuli-puppet-lint-plugins to ~> 7.0, since puppet-lint 4.x
    crashes under Ruby 4.0 (used for the Puppet 9 lane).
  - temporarily point puppetlabs_spec_helper at main, since the
    puppet-lint ~> 5.1 needed by the bump above
    (puppetlabs/puppetlabs_spec_helper#485) hasn't shipped in a
    release yet.
- plans/init.pp: fix indentation flagged by the newer puppet-lint's
  strict_indent check (pre-existing style drift the older linter
  didn't catch).

Ref: puppetlabs/puppetlabs-stdlib#1482

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
skyamgarp added a commit to puppetlabs/puppetlabs-reboot that referenced this pull request Aug 12, 2026
- metadata.json: bump the puppet version_requirement upper bound from
  < 9.0.0 to < 10.0.0.
- ci.yml:
  - exclude EOL platforms (EL7 family, CentOS 8, SLES 12, Debian 10)
    from the Puppet 9 acceptance lane only, since Puppet 9 ships no
    agent for them. They remain supported for Puppet 8.
  - install libcurl dev headers for the Spec job, needed to build the
    patron native extension pulled in transitively via puppet_litmus.
  - bump ruby_version to 3.2 for the Spec job, required by the
    voxpupuli-puppet-lint-plugins bump below.
- Gemfile:
  - temporarily point puppet_litmus at main, since
    --collection-platform-exclude support (puppetlabs/puppet_litmus#627)
    hasn't shipped in a release yet.
  - remap loose Puppet 9 constraints (e.g. '~> 9.0') to the actual
    8.99.x prerelease range ('>= 8.99.0.a', '< 9'), served from the
    source in PUPPET_GEM_SOURCE, since puppetlabs_spec_helper's
    puppet-syntax pin still requires puppet < 9.
  - bump voxpupuli-puppet-lint-plugins to ~> 7.0, since puppet-lint 4.x
    crashes under Ruby 4.0 (used for the Puppet 9 lane).
  - temporarily point puppetlabs_spec_helper at main, since the
    puppet-lint ~> 5.1 needed by the bump above
    (puppetlabs/puppetlabs_spec_helper#485) hasn't shipped in a
    release yet.
- plans/init.pp: fix indentation flagged by the newer puppet-lint's
  strict_indent check (pre-existing style drift the older linter
  didn't catch).

Ref: puppetlabs/puppetlabs-stdlib#1482

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
skyamgarp added a commit to puppetlabs/puppetlabs-reboot that referenced this pull request Aug 12, 2026
- metadata.json: bump the puppet version_requirement upper bound from
  < 9.0.0 to < 10.0.0.
- ci.yml:
  - exclude EOL platforms (EL7 family, CentOS 8, SLES 12, Debian 10)
    from the Puppet 9 acceptance lane only, since Puppet 9 ships no
    agent for them. They remain supported for Puppet 8.
  - install libcurl dev headers for the Spec job, needed to build the
    patron native extension pulled in transitively via puppet_litmus.
  - bump ruby_version to 3.2 for both the Spec and Acceptance jobs,
    required by the voxpupuli-puppet-lint-plugins bump below.
- Gemfile:
  - temporarily point puppet_litmus at main, since
    --collection-platform-exclude support (puppetlabs/puppet_litmus#627)
    hasn't shipped in a release yet.
  - remap loose Puppet 9 constraints (e.g. '~> 9.0') to the actual
    8.99.x prerelease range ('>= 8.99.0.a', '< 9'), served from the
    source in PUPPET_GEM_SOURCE, since puppetlabs_spec_helper's
    puppet-syntax pin still requires puppet < 9.
  - bump voxpupuli-puppet-lint-plugins to ~> 7.0, since puppet-lint 4.x
    crashes under Ruby 4.0 (used for the Puppet 9 lane).
  - temporarily point puppetlabs_spec_helper at main, since the
    puppet-lint ~> 5.1 needed by the bump above
    (puppetlabs/puppetlabs_spec_helper#485) hasn't shipped in a
    release yet.
- plans/init.pp: fix indentation flagged by the newer puppet-lint's
  strict_indent check (pre-existing style drift the older linter
  didn't catch).

Ref: puppetlabs/puppetlabs-stdlib#1482

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
skyamgarp added a commit to puppetlabs/puppetlabs-reboot that referenced this pull request Aug 12, 2026
- metadata.json: bump the puppet version_requirement upper bound from
  < 9.0.0 to < 10.0.0.
- ci.yml:
  - exclude EOL platforms (EL7 family, CentOS 8, SLES 12, Debian 10)
    from the Puppet 9 acceptance lane only, since Puppet 9 ships no
    agent for them. They remain supported for Puppet 8.
  - exclude scientific-7 from every acceptance lane: Scientific
    Linux's upstream package mirrors are gone (discontinued distro),
    so provisioning it 404s regardless of Puppet version.
  - install libcurl dev headers for the Spec job, needed to build the
    patron native extension pulled in transitively via puppet_litmus.
  - bump ruby_version to 3.2 for both the Spec and Acceptance jobs,
    required by the voxpupuli-puppet-lint-plugins bump below.
- Gemfile:
  - temporarily point puppet_litmus at main, since
    --collection-platform-exclude support (puppetlabs/puppet_litmus#627)
    hasn't shipped in a release yet.
  - remap loose Puppet 9 constraints (e.g. '~> 9.0') to the actual
    8.99.x prerelease range ('>= 8.99.0.a', '< 9'), served from the
    source in PUPPET_GEM_SOURCE, since puppetlabs_spec_helper's
    puppet-syntax pin still requires puppet < 9.
  - bump voxpupuli-puppet-lint-plugins to ~> 7.0, since puppet-lint 4.x
    crashes under Ruby 4.0 (used for the Puppet 9 lane).
  - temporarily point puppetlabs_spec_helper at main, since the
    puppet-lint ~> 5.1 needed by the bump above
    (puppetlabs/puppetlabs_spec_helper#485) hasn't shipped in a
    release yet.
- plans/init.pp: fix indentation flagged by the newer puppet-lint's
  strict_indent check (pre-existing style drift the older linter
  didn't catch).

Ref: puppetlabs/puppetlabs-stdlib#1482

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants