Skip to content

(CAT-2763) Fix nightly Windows spec: flip to puppet + declare Windows platform gems - #3

Merged
LukasAud merged 8 commits into
masterfrom
cat_2763_release_puppetlabs_syntax
Aug 20, 2026
Merged

(CAT-2763) Fix nightly Windows spec: flip to puppet + declare Windows platform gems#3
LukasAud merged 8 commits into
masterfrom
cat_2763_release_puppetlabs_syntax

Conversation

@gavindidrichsen

Copy link
Copy Markdown
Collaborator

Summary

Fixes the failing nightly Windows spec jobs on master (both Ruby 3.2/Puppet 8 and Ruby 4.0/Puppet 9 fail with LoadError: cannot load such file -- win32ole / -- ffi).

Two coupled problems, one PR:

  1. R7 fork-stance flip had not landed yet. Prior PRs (CAT-2763) Add DevX CODEOWNERS #1/(CAT-2763) refactor from openvox to puppet #2 touched only CODEOWNERS and .github/**; the gemspec still declared openvox. This PR flips the runtime dep to puppet '>= 8', '< 10' (range widened for imminent Puppet 9 / Ruby 4.0).
  2. The Linux-built rubygems.org artefacts of both openvox and puppet lack their Windows-platform runtime deps. Both upstream gemspecs guard ffi / win32ole with if platform == 'x64-mingw32' / if Gem.win_platform?, evaluated on the packaging host — so the Linux-published gem carries neither dep. Ruby 3.4+ (Ruby 4.0 too) removed win32ole from default gems, making the missing declaration fatal for the first time. Declaring ffi and win32ole in the Gemfile under platforms :mingw, :x64_mingw, :mswin compensates at bundle-install time on the CI host, where the platform check is meaningful.

Local verification: bundle exec rake spec on macOS with puppet 8.10.0 → 44 examples, 0 failures.

Test plan

  • nightly workflow (or CI on this PR) runs the Windows matrix and both jobs go green
  • Ubuntu matrix still passes
  • Confirm openvox no longer appears in the resolved lockfile on any platform

Commits

  • 48b975c (CAT-2763) Flip runtime dep from openvox to puppet
  • 613a5b4 (CAT-2763) Declare Windows platform runtime deps (ffi, win32ole)

Per fork stance R7 in the CAT-2760 project knowledge base: puppetlabs-syntax
is explicitly Puppet-core, not core-agnostic. Flip the gemspec runtime dep
from `openvox` (Vox's upstream choice) to `puppet` and widen the range to
`>= 8, < 10` in preparation for the Puppet 9 / Ruby 4.0 rollout.

This is the piece that was missed by PR #1 (CODEOWNERS) and PR #2 (workflow
switch to puppetlabs/cat-github-actions), both of which touched .github/ and
CODEOWNERS only. The nightly workflow surfaced the miss on Windows.
Fixes the nightly Windows spec failures:

  # Ruby 3.2 / Puppet 8
  Failure/Error: require 'puppet'
  LoadError: cannot load such file -- ffi

  # Ruby 4.0 / Puppet 9
  Failure/Error: require 'puppet'
  LoadError: cannot load such file -- win32ole

Both upstream puppet.gemspec and openvox.gemspec guard the ffi/win32ole
runtime deps with build-host platform checks
(`Gem.win_platform?` / `platform == 'x64-mingw32'`). Those evaluate on
the packaging host at gem-build time, not the install host at install
time, so the Linux-published rubygems.org artefacts of both puppet and
openvox ship without the deps. Ruby 3.4+ removed win32ole from default
gems, which is what made the missing declaration fatal for the first
time on Ruby 4.0.

Declare both deps in this Gemfile under a `platforms :mingw, :x64_mingw,
:mswin` block — evaluated on the install host at bundle time, so bundler
only pulls them on Windows.

Also flips the CI matrix override (`PUPPET_VERSION`) from openvox to
puppet, to match the gemspec flip in the previous commit.
@gavindidrichsen
gavindidrichsen requested a review from a team as a code owner August 19, 2026 16:07
The public rubygems.org catalogue tops out at puppet 8.10.0; no 9.x gem
has been published there yet. Bundler resolving puppet ~> 9.0 against
public rubygems falls back to puppet 8.x, whose transitive facter pins
Ruby < 4.0 and fails the Ruby 4.0 / Puppet 9 matrix cell at bundle
install.

Puppet 9 IS published to the private Puppetcore registry at
https://rubygems-puppetcore.puppet.com. Route the puppet gem through
gemsource_puppetcore (via the {source:} option on location_for) so
bundler resolves against Puppetcore when PUPPET_FORGE_TOKEN is set. The
reusable puppetlabs/cat-github-actions/gem_ci.yml@main already wires
that env var from the puppetlabs org-level PUPPET_FORGE_TOKEN_PUBLIC
secret, so no workflow-side change is needed.

Fork PRs get no token under GitHub's pull_request platform policy, so
gemsource_puppetcore falls through to gemsource_default (public
rubygems.org) via the `if ENV['PUPPET_FORGE_TOKEN']` guard - no auth
attempted, no exposure.

Pattern mirrors puppetlabs/rspec-puppet's Gemfile, whose nightly has
been green for 13 consecutive days on the same Ruby 4.0 / Puppet 9
matrix cell.
The ci.yml and mend.yml workflows were triggering on branch "main", but
the repo's default branch is "master". This meant ci.yml never ran on
any push or pull request against master, and mend.yml never ran on PRs.
PR #3's checks page confirms this: only Vox's leftover Test workflow
fired; the puppetlabs cat-github-actions gem_ci reusable workflow did
not.

Fix both files to trigger on "master" so subsequent PRs get automatic
CI coverage. The nightly.yml workflow is unchanged - it triggers on
schedule + workflow_dispatch, which is branch-agnostic and already
works correctly.

The eventual master -> main default-branch rename is a separate,
deliberate outward-facing change and is NOT part of this PR.
@gavindidrichsen
gavindidrichsen force-pushed the cat_2763_release_puppetlabs_syntax branch from 23f04e6 to 9bf44a9 Compare August 20, 2026 08:36
Signed-off-by: Gavin Didrichsen <gavin.didrichsen@gmail.com>
@gavindidrichsen
gavindidrichsen force-pushed the cat_2763_release_puppetlabs_syntax branch from 9bf44a9 to ceb3321 Compare August 20, 2026 08:42
gavindidrichsen and others added 3 commits August 20, 2026 10:06
…ubocop offenses

Gemfile checked ENV['PUPPET_VERSION'] to trigger the puppet
gem/source override, but CI's gem_ci.yml reusable workflow only ever
sets PUPPET_GEM_VERSION, so the override silently never fired and
bundler fell back to public rubygems.org, which fails to resolve
puppet ~> 9.0 for the ruby 4.0 matrix leg. Rename to match, and
reorder gemsource_puppetcore so an explicit GEM_SOURCE (e.g. an
internal Artifactory mirror for VPN'd dev) takes priority over
PUPPET_FORGE_TOKEN-triggered Puppetcore routing.

Also fixes the two rubocop offenses blocking the ruby 3.2 legs:
a mixed named/numbered regex capture in Gemfile's location_for, and
a non-descriptive EOF heredoc delimiter in the gemspec.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ci.yml passed rake_task: "spec:coverage" to the shared gem_ci.yml
workflow, but the Rakefile only ever defined a plain "spec" task - no
spec:coverage namespace, no simplecov gem, no COVERAGE env wiring in
spec_helper.rb. This predates CAT-2763 (introduced in e9a10ce) and was
only now exposed because CI never got past the earlier bundle
install/rubocop failures to reach this step.

gem_ci.yml's Codecov-upload step is gated on ruby_version == '3.1',
which this repo's matrix (3.2/4.0) never satisfies anyway, so building
out real coverage collection would exercise a step that can never run.
Point rake_task at the existing "spec" task instead, matching what
nightly.yml already does by default.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Gavin Didrichsen <gavin.didrichsen@gmail.com>

@LukasAud LukasAud left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@LukasAud
LukasAud merged commit 23add21 into master Aug 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants