From 742263b3616f8a9535c3dbd6558d483fbc3abc90 Mon Sep 17 00:00:00 2001 From: Justin Stoller Date: Mon, 18 Mar 2024 15:38:25 -0700 Subject: [PATCH 01/12] (PE-35197) Cannot recover from typos in Puppetfile Previously, if loading module metadata raised an uncaught exception a user with automation that always used `--incremental` could not recover from a failed deployment. One specific case of this is a module without a proper implementation. In that case a RuntimeError is raised. This adds RuntimeError to the metadata loading rescue block. --- lib/r10k/module_loader/puppetfile.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/r10k/module_loader/puppetfile.rb b/lib/r10k/module_loader/puppetfile.rb index f08112c48..30d76336f 100644 --- a/lib/r10k/module_loader/puppetfile.rb +++ b/lib/r10k/module_loader/puppetfile.rb @@ -104,7 +104,7 @@ def load_metadata! @existing_module_versions_by_name = @existing_module_metadata.map {|mod| [ mod.name, mod.version ] }.to_h empty_load_output.merge(modules: @existing_module_metadata) - rescue SyntaxError, LoadError, ArgumentError, NameError => e + rescue SyntaxError, LoadError, ArgumentError, NameError, RuntimeError => e logger.warn _("Unable to preload Puppetfile because of %{msg}" % { msg: e.message }) end From ce47adc4d5ba7862b9c5feac10c535e4cd95f0a7 Mon Sep 17 00:00:00 2001 From: Justin Stoller Date: Mon, 18 Mar 2024 16:09:16 -0700 Subject: [PATCH 02/12] (PE-34196) Cannot load Puppetfile metadata Some issues that can be encountered when parsing Puppetfile metadata raise R10K::Error. Catch R10K::Errors in metadata parsing. --- lib/r10k/module_loader/puppetfile.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/r10k/module_loader/puppetfile.rb b/lib/r10k/module_loader/puppetfile.rb index 30d76336f..286405315 100644 --- a/lib/r10k/module_loader/puppetfile.rb +++ b/lib/r10k/module_loader/puppetfile.rb @@ -104,7 +104,7 @@ def load_metadata! @existing_module_versions_by_name = @existing_module_metadata.map {|mod| [ mod.name, mod.version ] }.to_h empty_load_output.merge(modules: @existing_module_metadata) - rescue SyntaxError, LoadError, ArgumentError, NameError, RuntimeError => e + rescue SyntaxError, LoadError, ArgumentError, NameError, RuntimeError, R10K::Error => e logger.warn _("Unable to preload Puppetfile because of %{msg}" % { msg: e.message }) end From 3fe0f6b638643265b6e73ff94ff510d6f2c475f3 Mon Sep 17 00:00:00 2001 From: Justin Stoller Date: Mon, 18 Mar 2024 16:22:40 -0700 Subject: [PATCH 03/12] (maint) Ensure existing_module_metadata is valid on metadata loading failure --- lib/r10k/module_loader/puppetfile.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/r10k/module_loader/puppetfile.rb b/lib/r10k/module_loader/puppetfile.rb index 286405315..2918c58d1 100644 --- a/lib/r10k/module_loader/puppetfile.rb +++ b/lib/r10k/module_loader/puppetfile.rb @@ -106,6 +106,9 @@ def load_metadata! rescue SyntaxError, LoadError, ArgumentError, NameError, RuntimeError, R10K::Error => e logger.warn _("Unable to preload Puppetfile because of %{msg}" % { msg: e.message }) + + @existing_module_metadata = [] + @existing_module_versions_by_name = {} end def add_module_metadata(name, info) From bd67909a742b4f8457f6631361078bf96c6c04c6 Mon Sep 17 00:00:00 2001 From: Justin Stoller Date: Mon, 18 Mar 2024 16:26:56 -0700 Subject: [PATCH 04/12] (maint) Catch ScriptError, StandardError families when parsing metadata Parsing metedata, for users who run `--incremental` with every deploy, must not raise exceptions that end deployment. To prevent that we have collected a large list of fairly basic execptions families. This consolidates us to the ScriptError and StandardError exception families, which contained all of the previous exceptions, but still doesn't catch things like SystemExit exceptions. --- lib/r10k/module_loader/puppetfile.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/r10k/module_loader/puppetfile.rb b/lib/r10k/module_loader/puppetfile.rb index 2918c58d1..cf0e4c573 100644 --- a/lib/r10k/module_loader/puppetfile.rb +++ b/lib/r10k/module_loader/puppetfile.rb @@ -104,7 +104,7 @@ def load_metadata! @existing_module_versions_by_name = @existing_module_metadata.map {|mod| [ mod.name, mod.version ] }.to_h empty_load_output.merge(modules: @existing_module_metadata) - rescue SyntaxError, LoadError, ArgumentError, NameError, RuntimeError, R10K::Error => e + rescue ScriptError, StandardError => e logger.warn _("Unable to preload Puppetfile because of %{msg}" % { msg: e.message }) @existing_module_metadata = [] From 78ff9344b91fb89ce74d0cf79971488c7e6c33b6 Mon Sep 17 00:00:00 2001 From: Justin Stoller Date: Tue, 19 Mar 2024 14:33:13 -0700 Subject: [PATCH 05/12] (maint) Update CHANGELOG for metadata robustness --- CHANGELOG.mkd | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.mkd b/CHANGELOG.mkd index ae3880d17..3408a65ad 100644 --- a/CHANGELOG.mkd +++ b/CHANGELOG.mkd @@ -3,6 +3,7 @@ CHANGELOG Unreleased ---------- +- Make metadata loading during incremental deploys more robust [PE-34917](https://perforce.atlassian.net/browse/PE-34917) 3.16.0 From f4a15a9aafdc34e6faee993aac73e4782da4a9ad Mon Sep 17 00:00:00 2001 From: Nick Burgan <13688219+nmburgan@users.noreply.github.com> Date: Tue, 19 Mar 2024 16:18:42 -0700 Subject: [PATCH 06/12] (maint) Update beaker-pe to 3 --- integration/Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/Gemfile b/integration/Gemfile index 515e05649..b455bae2a 100644 --- a/integration/Gemfile +++ b/integration/Gemfile @@ -11,7 +11,7 @@ def location_for(place, fake_version = nil) end gem 'beaker', *location_for(ENV['BEAKER_VERSION'] || '~> 4.5') -gem 'beaker-pe', '~> 2.0' +gem 'beaker-pe', '~> 3.0' gem 'beaker-answers' gem 'beaker-hostgenerator', *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION'] || '~> 1.1') gem 'beaker-abs', *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.4') From 1f667a83226b697737f2977d91b261cffe279926 Mon Sep 17 00:00:00 2001 From: Nick Burgan <13688219+nmburgan@users.noreply.github.com> Date: Tue, 19 Mar 2024 16:20:12 -0700 Subject: [PATCH 07/12] Update CHANGELOG.mkd --- CHANGELOG.mkd | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.mkd b/CHANGELOG.mkd index 17f3e086f..ee376276d 100644 --- a/CHANGELOG.mkd +++ b/CHANGELOG.mkd @@ -3,6 +3,7 @@ CHANGELOG Unreleased ---------- +- (maint) Update beaker-pe to 3 [#1376](https://github.com/puppetlabs/r10k/pull/1376) 4.0.1 ----- From 84d8500abb131f93231915c40126c189e69ba4c4 Mon Sep 17 00:00:00 2001 From: Justin Stoller Date: Wed, 20 Mar 2024 14:07:29 -0700 Subject: [PATCH 08/12] (maint) Use production forge for integration tests --- CHANGELOG.mkd | 1 + integration/Rakefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.mkd b/CHANGELOG.mkd index 3408a65ad..af4b24ac5 100644 --- a/CHANGELOG.mkd +++ b/CHANGELOG.mkd @@ -4,6 +4,7 @@ CHANGELOG Unreleased ---------- - Make metadata loading during incremental deploys more robust [PE-34917](https://perforce.atlassian.net/browse/PE-34917) +- Use the production forge for integration testing 3.16.0 diff --git a/integration/Rakefile b/integration/Rakefile index 9a47e9baf..88040dc8f 100644 --- a/integration/Rakefile +++ b/integration/Rakefile @@ -69,7 +69,7 @@ rototiller_task :beaker_hostgenerator do |t| # This is a hack :( t.add_flag(:name => '', :default => 'centos7-64mdca-64.fa', :override_env => 'TEST_TARGET') - t.add_flag(:name => '--global-config', :default => '{forge_host=forge-aio01-petest.puppetlabs.com}', :override_env => 'BHG_GLOBAL_CONFIG') + t.add_flag(:name => '--global-config', :default => '{forge_host=forgeapi.puppet.com}', :override_env => 'BHG_GLOBAL_CONFIG') end end From 9592586806f1d4ad5201755f38efd900212444aa Mon Sep 17 00:00:00 2001 From: Justin Stoller Date: Wed, 20 Mar 2024 14:10:23 -0700 Subject: [PATCH 09/12] (maint) Prepare for 3.16.1 --- CHANGELOG.mkd | 11 ++++++++++- lib/r10k/version.rb | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.mkd b/CHANGELOG.mkd index af4b24ac5..5cf179a60 100644 --- a/CHANGELOG.mkd +++ b/CHANGELOG.mkd @@ -3,12 +3,17 @@ CHANGELOG Unreleased ---------- + + +3.16.1 +------ + - Make metadata loading during incremental deploys more robust [PE-34917](https://perforce.atlassian.net/browse/PE-34917) - Use the production forge for integration testing - 3.16.0 ------ + - Emit more debug output when modules fail to sync [#1347](https://github.com/puppetlabs/r10k/pull/1347) - Update GitHub Actions & introduce dependabot [#1337](https://github.com/puppetlabs/r10k/pull/1337) - Update R10K proxy usage to follow newer rugged best practices [PE-35980](https://tickets.puppet.com/browse/PE-35980) @@ -16,19 +21,23 @@ Unreleased 3.15.4 ------ + - Pin dependencies to maintain support for old Ruby versions [#1329](https://github.com/puppetlabs/r10k/pull/1329) 3.15.3 ------ + - Fix dirty working copy debug logging [#1321](https://github.com/puppetlabs/r10k/pull/1321) - Allow gettext-setup < 2 for compatibility with Ruby 3.2 and Puppet 8 [#1325](https://github.com/puppetlabs/r10k/pull/1325) 3.15.2 ------ + - Implement exclude regex for puppetfile install [#1248](https://github.com/puppetlabs/r10k/issues/1248) 3.15.1 ------ + - Add TOC to configuration docs [#1298](https://github.com/puppetlabs/r10k/issues/1298) - Remove the spec folder from gemspec [#1316](https://github.com/puppetlabs/r10k/issues/1316) diff --git a/lib/r10k/version.rb b/lib/r10k/version.rb index c71c6e429..67eca680b 100644 --- a/lib/r10k/version.rb +++ b/lib/r10k/version.rb @@ -2,5 +2,5 @@ module R10K # When updating to a new major (X) or minor (Y) version, include `#major` or # `#minor` (respectively) in your commit message to trigger the appropriate # release. Otherwise, a new patch (Z) version will be released. - VERSION = '3.16.0' + VERSION = '3.16.1' end From da01c35df0fa87d678ac7c7f08d104b2b5641cf2 Mon Sep 17 00:00:00 2001 From: Nick Burgan-Illig Date: Wed, 20 Mar 2024 23:36:27 +0000 Subject: [PATCH 10/12] (maint) Stop puppet service during tests --- CHANGELOG.mkd | 1 + integration/pre-suite/00_pe_install.rb | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.mkd b/CHANGELOG.mkd index ee376276d..4ed3f0eed 100644 --- a/CHANGELOG.mkd +++ b/CHANGELOG.mkd @@ -4,6 +4,7 @@ CHANGELOG Unreleased ---------- - (maint) Update beaker-pe to 3 [#1376](https://github.com/puppetlabs/r10k/pull/1376) +- (maint) Stop puppet service during tests [#1377](https://github.com/puppetlabs/r10k/pull/1377) 4.0.1 ----- diff --git a/integration/pre-suite/00_pe_install.rb b/integration/pre-suite/00_pe_install.rb index e2ff86df4..bf49ec7d7 100755 --- a/integration/pre-suite/00_pe_install.rb +++ b/integration/pre-suite/00_pe_install.rb @@ -4,3 +4,6 @@ step 'Install PE' install_pe + +step 'Stop puppet service to avoid running into existing agent runs' +on(hosts, puppet('resource service puppet ensure=stopped')) From c3a17681201cd7b1dfa9a17b8741dc3df4b07b76 Mon Sep 17 00:00:00 2001 From: Nick Burgan-Illig Date: Wed, 20 Mar 2024 23:38:52 +0000 Subject: [PATCH 11/12] (maint) Update CODEOWNERS --- CODEOWNERS | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 074568eb5..b1ccfba95 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,2 +1 @@ -# This repo is owned by the dumpling team -* @puppetlabs/dumpling +* @puppetlabs/dumpling @puppetlabs/skeletor From 1f0df0138648d0d43eeceb7bee34e390c9ed7c07 Mon Sep 17 00:00:00 2001 From: Justin Stoller Date: Mon, 25 Mar 2024 10:17:38 -0700 Subject: [PATCH 12/12] (maint) Prepare 4.0.2 #patch release --- CHANGELOG.mkd | 6 ++++++ lib/r10k/version.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.mkd b/CHANGELOG.mkd index eb34379e2..a99749d72 100644 --- a/CHANGELOG.mkd +++ b/CHANGELOG.mkd @@ -3,6 +3,12 @@ CHANGELOG Unreleased ---------- + +4.0.2 +----- + +- Make metadata loading during incremental deploys more robust [PE-34917](https://perforce.atlassian.net/browse/PE-34917) +- Use the production forge for integration testing - (maint) Update beaker-pe to 3 [#1376](https://github.com/puppetlabs/r10k/pull/1376) - (maint) Stop puppet service during tests [#1377](https://github.com/puppetlabs/r10k/pull/1377) diff --git a/lib/r10k/version.rb b/lib/r10k/version.rb index 6fd644729..1424ac49b 100644 --- a/lib/r10k/version.rb +++ b/lib/r10k/version.rb @@ -2,5 +2,5 @@ module R10K # When updating to a new major (X) or minor (Y) version, include `#major` or # `#minor` (respectively) in your commit message to trigger the appropriate # release. Otherwise, a new patch (Z) version will be released. - VERSION = '4.0.1' + VERSION = '4.0.2' end