Repository navigation
(CAT-2946) Fix the Puppet 8 nightly raising puppet floor to 8.17 - #403
Closed
gavindidrichsen wants to merge 10 commits into
Closed
gavindidrichsen wants to merge 10 commits into
gavindidrichsen wants to merge 10 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #403 +/- ##
==========================================
- Coverage 90.77% 88.98% -1.80%
==========================================
Files 6 6
Lines 1257 853 -404
==========================================
- Hits 1141 759 -382
+ Misses 116 94 -22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
@gavindidrichsen : Won't raising the Puppet 8 floor to 8.17 mean that it requires the private Puppet Core and there will no longer be any unit tests run on forks? |
Run `pdk update` to move template-ref from tags/3.2.0 to heads/main (de9a08b). The update is mechanical and touches only the managed files: .gitignore, .pdkignore, .puppet-lint.rc, .rubocop.yml, Gemfile and metadata.json. The part that matters for CI is the Gemfile. pdk-templates PR #662 added puppet_floor_version, which defaults PUPPET_GEM_VERSION to '~> 8.17' on Ruby 3.1-3.3. Without it Bundler resolves multi_json to 1.21 first, which puppet 8.17+ cannot use, and silently backtracks puppet to 8.16.0. That backtrack is what breaks the Puppet 8 spec job (FrozenError in puppet/util/monkey_patches.rb). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Gavin Didrichsen <gavin.didrichsen@gmail.com>
Style/RegexpLiteral rewrote the expected_cim_instance_array_regex
literal from /.../ to %r{...} but left the `}` after 'two' unescaped.
That closes the %r{} early and makes the spec file a syntax error
(Lint/Syntax). Escape the brace so the pattern matches the same text.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The pdk update replaced .rubocop.yml with the template's version, which no longer inherited .rubocop_todo.yml, so the module's known offences were reported again. Set include_todos in .sync.yml so the template renders `inherit_from: .rubocop_todo.yml` (with merged Excludes) instead of hand-editing a managed file that the next pdk update would overwrite. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The autocorrect in 0db45e4 also rewrote production code. Style/ClassAndModuleChildren turned `module Pwsh` / `module Util` into `module Pwsh::Util` and `class Pwsh::WindowsPowerShell`, which raises `NameError: uninitialized constant Pwsh` at load time. It also changed behaviour: `return nil` became `return false` in a predicate, and several `select` blocks became `slice`. This PR is about the Puppet 8 CI floor, so keep lib/ exactly as on main and let the rubocop todo file carry any offences there. With lib/ restored, the unit specs that can run without a pwsh binary pass (231 examples, 0 failures). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
main disabled Style/ClassAndModuleChildren in its hand-edited .rubocop.yml. The template profile enforces compact style, which is what broke the module loading in 0db45e4. Disable it with a cop_overrides entry in .sync.yml so the setting survives the next pdk update. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Apply only the autocorrects rubocop marks safe, in one pass: Style/RegexpLiteral, Style/TernaryParentheses, Style/TrailingCommaIn*Literal, Style/SymbolArray, Style/WordArray and Style/BlockDelimiters (37 offences in lib/pwsh.rb, lib/pwsh/util.rb and the dsc_base_provider). No module or class structure changes. Every touched file passes `ruby -c`, and the four spec files that run without a pwsh binary pass (231 examples, 0 failures, 1 pending). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Performance/StringBytesize: `msg.bytes.length` becomes `msg.bytesize`, the same value without building an array. - Lint/BooleanSymbol: the `:true`/`:false` symbols in format_powershell_value are intentional (Puppet can pass them), so keep them and say so with an inline disable. Style/HashSlice is not applied: slice calls namevar_attributes once instead of once per entry, which changes the call count a unit test asserts (3 calls expected, 1 made). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Merge repeated `allow(...).to receive` stubs into receive_messages (27 offences). The unsafe autocorrect put the general stubs after the specific `with` stubs, so they overrode them and three ps_script_content examples failed. Keep the general stubs first so the specific ones win. 231 examples, 0 failures, 1 pending. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add Style/HashSlice, Lint/UselessConstantScoping, RSpec/SpecFilePathSuffix and RSpec/SpecFilePathFormat (14 offences) to .rubocop_todo.yml, each with the reason it is not changed in this PR. rubocop now reports no offences. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
gavindidrichsen
force-pushed
the
fix-puppet8-floor-multi-json
branch
from
October 28, 2026 16:49
9852b35 to
46227a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the nightly
spec (ruby 3.2 | puppet ~> 8.0)job, which has failed every night since 2026-10-22 (e.g. run 40248590141).Two commits:
pdk updateto the latest pdk-templates (PDK 4.0.1, templateheads/main). Mechanical; touches only managed files (.gitignore,.pdkignore,.puppet-lint.rc,.rubocop.yml,Gemfile,metadata.json).ci.ymlandnightly.ymlfrom~> 8.0to~> 8.17.Additional Context
FrozenError: can't modify frozen Hashatpuppet-8.16.0/lib/puppet/util/monkey_patches.rb:56(SSLContext). That is a bug in Puppet 8.16.0 itself, which is fixed in later 8.x. CI should never have resolved 8.16.0. It did because of a Bundler resolution trap: with onlypuppet ~> 8.0, Bundler picksmulti_json1.21 first; Puppet 8.17+ capsmulti_jsonat<= 1.19.0, so Bundler silently backtrackspuppetto 8.16.0, the newest release with no such cap. Same trap as bolt-private PRs #123 and #126, and pdk-templates #662 (ADR 0001).puppet_floor_versionto the template Gemfile, defaultingPUPPET_GEM_VERSIONto~> 8.17. This module was still on template3.2.0, so it lacked that. The default only applies whenPUPPET_GEM_VERSIONis unset, andci.yml/nightly.yml(bothunmanaged: truein.sync.yml) set it to~> 8.0explicitly, so the pdk update alone would not change CI. Hence the second commit.bundle installresolves puppet 8.16.0. Afterpdk updateand a newbundle install: puppet 8.22.Known risks (please check CI)
pdk updatereplaces the Gemfile and removes two hand edits that were in it:gem "ffi", platforms: [:mswin, :mingw, :x64_mingw]in thesystem_testsgroup (commit 4744b3c restored it for Windows). Watch the Windows acceptance job.gemsource_facterscoping from the same commit. The template now routes facter through puppetcore on every Ruby, which that commit said crashedrequire 'facter'on Ruby 3.2. I have not shown whether this still happens with the current facter build.If either shows up red, the fix is to add them back through
.sync.yml(or keep the Gemfile unmanaged) in a follow-up commit on this PR.Related Issues (if any)
Jira: CAT-2946.
Nightly failures since 2026-10-22; bolt-private #123, #126; pdk-templates #662.
Docs assessment
Read the repo
CONTRIBUTING.mdand PR template. No documentation change needed: no behaviour change for users of the gem or module, and the CHANGELOG is generated at release prep.Checklist
bundle installresolves puppet 8.22 locally; CI to confirm.)🤖 Generated with Claude Code