From 53515f9d2d06c66dde782d847c96e2420b15bd0a Mon Sep 17 00:00:00 2001 From: Steven Pritchard Date: Thu, 30 Jul 2026 16:08:39 +0000 Subject: [PATCH 1/2] Remove interactive-debugger remnants and stale rspec-puppet scaffolding Follow-up to #52 (binding.pry removal), sweeping out the remaining hazards that could hang unattended runs: - debug::break() at the end of the puppetsync::batch plan (ran on every batch invocation) - debug::break() in record_stage_results' default case, replaced with a hard failure: unrecorded results would let failed targets pass later stages' ok-so-far filters, same reasoning as #64 - The nwops/debug module dependency in bolt-project.yaml (no callers remain) Also removes dist/puppetsync/spec/ (rspec-puppet scaffolding whose only spec tested puppetsync::parse_puppetfile, a function that no longer exists; the live test suite is the top-level spec/ run by CI). Verified: parser validation, bolt plan show, list_pipeline_stages dry run, the idempotency e2e (which exercises record_stage_results on every stage), rspec (154 examples), and a grep confirming no debug:: references remain. Co-Authored-By: Claude Fable 5 --- CHANGELOG.md | 9 +++ bolt-project.yaml | 1 - .../functions/record_stage_results.pp | 4 +- dist/puppetsync/plans/batch.pp | 1 - .../spec/functions/parse_puppetfile_spec.rb | 29 --------- dist/puppetsync/spec/spec_helper.rb | 60 ------------------- 6 files changed, 11 insertions(+), 93 deletions(-) delete mode 100644 dist/puppetsync/spec/functions/parse_puppetfile_spec.rb delete mode 100644 dist/puppetsync/spec/spec_helper.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 8388978..af5c520 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Removed +- Removed the remaining interactive-debugger hazards (follow-up to #52): + - `debug::break()` at the end of the `puppetsync::batch` plan + - `debug::break()` in `puppetsync::record_stage_results`, replaced with a + hard failure (unrecorded results would let failed targets pass later + stages' filters) + - The `nwops/debug` module dependency +- Removed the stale rspec-puppet scaffolding in `dist/puppetsync/spec/`, + which tested a function (`puppetsync::parse_puppetfile`) that no longer + exists - Removed the remaining GitLab support, completing the GLCI removal (#51): - `GITLAB_API_TOKEN` is no longer required to run any plan - Removed the `ensure_gitlab_remote` and `git_push_to_gitlab` pipeline diff --git a/bolt-project.yaml b/bolt-project.yaml index e465c37..69d4926 100644 --- a/bolt-project.yaml +++ b/bolt-project.yaml @@ -14,4 +14,3 @@ modules: - name: puppetlabs/stdlib - name: puppetlabs/ruby_task_helper - name: puppet/format - - name: nwops/debug # only needed for debugging plans with `debug::break` diff --git a/dist/puppetsync/functions/record_stage_results.pp b/dist/puppetsync/functions/record_stage_results.pp index d897d6a..dfe697c 100644 --- a/dist/puppetsync/functions/record_stage_results.pp +++ b/dist/puppetsync/functions/record_stage_results.pp @@ -38,8 +38,8 @@ function puppetsync::record_stage_results( } default: { - out::message("+++++++ DEFAULT puppetsync::record_stage_results (\$result = Tuple?)") - debug::break() + # Unrecorded results would let failed targets pass later stages' filters + fail( "puppetsync::record_stage_results('${stage_name}'): cannot record results of unexpected type '${type($results, 'generalized')}'" ) } } } diff --git a/dist/puppetsync/plans/batch.pp b/dist/puppetsync/plans/batch.pp index 7676663..0519db9 100644 --- a/dist/puppetsync/plans/batch.pp +++ b/dist/puppetsync/plans/batch.pp @@ -33,6 +33,5 @@ ctrl::sleep( $delay ) next($result) } - debug::break() return( $results ) } diff --git a/dist/puppetsync/spec/functions/parse_puppetfile_spec.rb b/dist/puppetsync/spec/functions/parse_puppetfile_spec.rb deleted file mode 100644 index fbd2df7..0000000 --- a/dist/puppetsync/spec/functions/parse_puppetfile_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -require 'spec_helper' - -describe 'puppetsync::parse_puppetfile' do - let(:pf) do - <<-PF - moduledir 'modules' - - mod 'stdlib', - :git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git', - :tag => 'v6.2.0' - - mod 'simplib', - :git => 'git@github.com:simp/pupmod-simp-simplib.git', - :tag => '4.2.0' - moduledir '_repos' - - mod 'simp-acpid', - :git => 'https://github.com/simp/pupmod-simp-acpid' - PF - end - - let(:pf_modules_hash) do - {"modules/stdlib"=>{"git"=>"https://github.com/puppetlabs/puppetlabs-stdlib.git", "tag"=>"v6.2.0", "name"=>"stdlib", "rel_path"=>"modules/stdlib", "mod_rel_path"=>"modules/stdlib", "mod_name"=>"stdlib", "install_path"=>"modules", "repo_name"=>"puppetlabs-stdlib"}, "modules/simplib"=>{"git"=>"git@github.com:simp/pupmod-simp-simplib.git", "tag"=>"4.2.0", "name"=>"simplib", "rel_path"=>"modules/simplib", "mod_rel_path"=>"modules/simplib", "mod_name"=>"simplib", "install_path"=>"modules", "repo_name"=>"pupmod-simp-simplib"}, "_repos/simp-acpid"=>{"git"=>"https://github.com/simp/pupmod-simp-acpid", "name"=>"simp-acpid", "rel_path"=>"_repos/simp-acpid", "mod_rel_path"=>"_repos/acpid", "mod_name"=>"acpid", "install_path"=>"_repos", "repo_name"=>"pupmod-simp-acpid"}} - end - - context 'when a simple array is passed' do - it { is_expected.to run.with_params(pf, '.').and_return(pf_modules_hash) } - end -end diff --git a/dist/puppetsync/spec/spec_helper.rb b/dist/puppetsync/spec/spec_helper.rb deleted file mode 100644 index 6cd5e8d..0000000 --- a/dist/puppetsync/spec/spec_helper.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true -RSpec.configure do |c| - c.mock_with :rspec -end -require 'puppetlabs_spec_helper/module_spec_helper' - -require 'puppetlabs_spec_helper/module_spec_helper' -require 'rspec-puppet-facts' - -require 'spec_helper_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_local.rb')) - -include RspecPuppetFacts - -default_facts = { - puppetversion: Puppet.version, - facterversion: Facter.version, -} - -default_fact_files = [ - File.expand_path(File.join(File.dirname(__FILE__), 'default_facts.yml')), - File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml')), -] - -default_fact_files.each do |f| - next unless File.exist?(f) && File.readable?(f) && File.size?(f) - - begin - default_facts.merge!(YAML.safe_load(File.read(f), [], [], true)) - rescue => e - RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" - end -end - -# read default_facts and merge them over what is provided by facterdb -default_facts.each do |fact, value| - add_custom_fact fact, value -end - -RSpec.configure do |c| - c.default_facts = default_facts - c.before :each do - # set to strictest setting for testing - # by default Puppet runs at warning level - Puppet.settings[:strict] = :warning - end - c.filter_run_excluding(bolt: true) unless ENV['GEM_BOLT'] - c.after(:suite) do - end -end - -# Ensures that a module is defined -# @param module_name Name of the module -def ensure_module_defined(module_name) - module_name.split('::').reduce(Object) do |last_module, next_module| - last_module.const_set(next_module, Module.new) unless last_module.const_defined?(next_module, false) - last_module.const_get(next_module, false) - end -end - -# 'spec_overrides' from sync.yml will appear below this line From 068f21dfd06e01d117430965c37e7dcec6e88d9f Mon Sep 17 00:00:00 2001 From: Steven Pritchard Date: Thu, 30 Jul 2026 16:39:17 +0000 Subject: [PATCH 2/2] Drop CHANGELOG.md hunk per the changelog freeze CHANGELOG.md is frozen (see #71); the squash-merge PR title carries this change's history. Co-Authored-By: Claude Fable 5 --- CHANGELOG.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af5c520..8388978 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,15 +53,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Removed -- Removed the remaining interactive-debugger hazards (follow-up to #52): - - `debug::break()` at the end of the `puppetsync::batch` plan - - `debug::break()` in `puppetsync::record_stage_results`, replaced with a - hard failure (unrecorded results would let failed targets pass later - stages' filters) - - The `nwops/debug` module dependency -- Removed the stale rspec-puppet scaffolding in `dist/puppetsync/spec/`, - which tested a function (`puppetsync::parse_puppetfile`) that no longer - exists - Removed the remaining GitLab support, completing the GLCI removal (#51): - `GITLAB_API_TOKEN` is no longer required to run any plan - Removed the `ensure_gitlab_remote` and `git_push_to_gitlab` pipeline