Skip to content

(PA-9451) Add opt-in Puppet 9 / Ruby 4 support to shared workflows - #48

Open
cthorn42 wants to merge 3 commits into
mainfrom
PA-9451/main/puppet9-ruby4
Open

cthorn42 wants to merge 3 commits into
mainfrom
PA-9451/main/puppet9-ruby4

Conversation

@cthorn42

Copy link
Copy Markdown
Contributor

Summary

Lets callers opt into Puppet 9 unit tests on Ruby 4.0 without changing anything for existing Puppet 8 callers.

  • puppet_versions input (JSON list, default '["8"]') on both unit test workflows. Puppet 8 runs on Ruby 3.1; later versions run on Ruby 4.0. Job and check names for Puppet 8 are unchanged. The earlier attempt ((maint) Add Puppet 9 unit test matrix #45, reverted in Revert "(maint) Add Puppet 9 unit test matrix" #46) added Puppet 9 for every caller, which broke modules still pinned to puppetlabs_spec_helper 8.
  • ruby_version input (default '3.3') on static_code_analysis.yaml.
  • Nightly Windows, Puppet 9+: uses the published x64-mingw-ucrt gem instead of the universal gem plus pinned ffi workaround.
  • libcurl dev files on Linux for Puppet 9+: under Ruby 4, Bundler can resolve a faraday version that depends on patron. static_code_analysis.yaml already installs these.
  • Nightly: GEM_SOURCE and PUPPET_GEM_VERSION set for the whole job. GEM_SOURCE was only set on the bundler step, so bundle exec in the test step saw a different Gemfile source and re-resolved. That fails under Ruby 4's Bundler with a lockfile platform error. This also applies to Puppet 8 nightly jobs.
  • Released: PUPPET_GEM_VERSION pinned to ~> <major>.0. Without it, a dependency conflict on Windows made Bundler silently install Puppet 8.13 in the Puppet 9 job.

Usage

uses: "puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_released_puppet_gem.yaml@main"
with:
  puppet_versions: '["9"]'

Testing

Run against puppetlabs-puppet_agent via workflow_dispatch:

  • Puppet 9 / Ruby 4.0 (branch PA-9451/main/puppet9-unit-test-deps): all 5 unit test jobs passed (run), and static analysis on Ruby 4.0 passed (run). Logs show Puppet 9.1.0 (released) and the Puppet 9 nightly gem in use, including on Windows.
  • Puppet 8 / Ruby 3.1 (main pointed at this branch, default inputs): all unit test and daily nightly jobs passed with unchanged check names (unit, daily).
  • yamllint (repo config) and actionlint pass. actionlint reports nothing new in changed files.

Other callers' Gemfiles were checked: all read PUPPET_GEM_VERSION via location_for (mailalias_core ignores it when PUPPET_FORGE_TOKEN is set), so the ~> 8.0 pin resolves the same Puppet 8 they get today.

🤖 Generated with Claude Code

cthorn42 and others added 3 commits October 26, 2026 18:52
Add a puppet_versions input (JSON list, default '["8"]') to the nightly
and released unit test workflows. Puppet 8 continues to run on Ruby 3.1;
later versions run on Ruby 4.0. Defaulting to Puppet 8 keeps existing
callers' jobs and check names unchanged, unlike the earlier attempt that
added Puppet 9 to every caller and broke modules still pinned to
puppetlabs_spec_helper 8.

For Puppet 9+ nightly on Windows, use the published x64-mingw-ucrt gem
instead of the universal gem plus pinned ffi workaround.

Add a ruby_version input (default '3.3') to the static code analysis
workflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Install libcurl development files on Linux for Puppet 9+. Under Ruby 4,
Bundler can resolve a faraday version that depends on patron, whose
native extension needs them. static_code_analysis.yaml already does this.

In the nightly workflow, GEM_SOURCE was only set for the bundler step.
The Gemfile uses it as its source, so `bundle exec` in the test step saw
a different source than `bundle update` resolved against and
re-resolved. Under the Bundler shipped with Ruby 4, that re-resolution
fails with a lockfile platform error. Set GEM_SOURCE for the whole job.
Move PUPPET_GEM_VERSION to the job as well, for consistency and to drop
the per-OS env_set_cmd syntax.

This applies to Puppet 8 nightly jobs too: their test step now sees the
same GEM_SOURCE and PUPPET_GEM_VERSION as their bundler step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Set PUPPET_GEM_VERSION to "~> <major>.0" for each job. Without it, a
dependency conflict on Windows made Bundler silently resolve Puppet 8 in
the Puppet 9 job. Puppet 8 jobs already resolve 8.x on Ruby 3.1, so this
doesn't change existing callers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cthorn42
cthorn42 requested a review from a team as a code owner October 27, 2026 03:18
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.

1 participant