From 70f2fc0200b739fabf521aa80ac1b3bfcd4a0119 Mon Sep 17 00:00:00 2001 From: Craig Gumbley Date: Tue, 25 Apr 2023 22:39:45 +0100 Subject: [PATCH] (MAINT) Force newer Puppet 7 Gem After the realease of Puppet 8 there seems to be some confusion with bundler causing it to pull older versions of Puppet 7. This breaks CI. This change forces puppet_maj_version == 7 to pull ~> 7.24. --- exe/matrix_from_metadata_v2 | 12 +++++++----- spec/exe/matrix_from_metadata_v2_spec.rb | 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/exe/matrix_from_metadata_v2 b/exe/matrix_from_metadata_v2 index a4ff542b..cfb3b945 100755 --- a/exe/matrix_from_metadata_v2 +++ b/exe/matrix_from_metadata_v2 @@ -142,11 +142,13 @@ if metadata.key?('requirements') && metadata['requirements'].length.positive? next unless Gem::Requirement.create(reqs).satisfied_by?(Gem::Version.new("#{collection[:puppet_maj_version]}.9999")) matrix[:collection] << "puppet#{collection[:puppet_maj_version]}-nightly" - spec_matrix[:include] << if collection[:puppet_maj_version] == 8 - { puppet_version: 'https://github.com/puppetlabs/puppet', ruby_version: collection[:ruby_version] } - else - { puppet_version: "~> #{collection[:puppet_maj_version]}.0", ruby_version: collection[:ruby_version] } - end + + include_version = { + 8 => "~> #{collection[:puppet_maj_version]}.0", + 7 => "~> #{collection[:puppet_maj_version]}.24", + 6 => "~> #{collection[:puppet_maj_version]}.0" + } + spec_matrix[:include] << { puppet_version: include_version[collection[:puppet_maj_version]], ruby_version: collection[:ruby_version] } end end end diff --git a/spec/exe/matrix_from_metadata_v2_spec.rb b/spec/exe/matrix_from_metadata_v2_spec.rb index d09eeab6..c7f65d34 100644 --- a/spec/exe/matrix_from_metadata_v2_spec.rb +++ b/spec/exe/matrix_from_metadata_v2_spec.rb @@ -33,7 +33,7 @@ ].join ) expect(github_output_content).to include( - 'spec_matrix={"include":[{"puppet_version":"~> 7.0","ruby_version":2.7},{"puppet_version":"https://github.com/puppetlabs/puppet","ruby_version":3.2}]}' + 'spec_matrix={"include":[{"puppet_version":"~> 7.24","ruby_version":2.7},{"puppet_version":"~> 8.0","ruby_version":3.2}]}' ) expect(result.stdout).to include("Created matrix with 8 cells:\n - Acceptance Test Cells: 6\n - Spec Test Cells: 2") end @@ -69,7 +69,7 @@ ].join ) expect(github_output_content).to include( - 'spec_matrix={"include":[{"puppet_version":"~> 7.0","ruby_version":2.7},{"puppet_version":"https://github.com/puppetlabs/puppet","ruby_version":3.2}]}' + 'spec_matrix={"include":[{"puppet_version":"~> 7.24","ruby_version":2.7},{"puppet_version":"~> 8.0","ruby_version":3.2}]}' ) expect(result.stdout).to include("Created matrix with 6 cells:\n - Acceptance Test Cells: 4\n - Spec Test Cells: 2") end @@ -105,7 +105,7 @@ ].join ) expect(github_output_content).to include( - 'spec_matrix={"include":[{"puppet_version":"~> 7.0","ruby_version":2.7},{"puppet_version":"https://github.com/puppetlabs/puppet","ruby_version":3.2}]}' + 'spec_matrix={"include":[{"puppet_version":"~> 7.24","ruby_version":2.7},{"puppet_version":"~> 8.0","ruby_version":3.2}]}' ) expect(result.stdout).to include("Created matrix with 4 cells:\n - Acceptance Test Cells: 2\n - Spec Test Cells: 2") end