From 45ff74c4481bc834ec72faae2c071fee2a962b31 Mon Sep 17 00:00:00 2001 From: Shubham Shinde Date: Thu, 21 Aug 2025 17:52:30 +0530 Subject: [PATCH 1/5] (CAT-2377) Puppetcore updates --- .fixtures.yml | 4 +--- .github/workflows/ci.yml | 2 +- .github/workflows/nightly.yml | 2 +- .puppet-lint.rc | 9 +++++++++ .rubocop.yml | 2 +- Gemfile | 38 ++++++++++++++++++++++------------- Rakefile | 8 ++++++++ metadata.json | 6 +++--- 8 files changed, 48 insertions(+), 23 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index 90fee5f6..8cfb0560 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -2,9 +2,7 @@ fixtures: repositories: facts: 'https://github.com/puppetlabs/puppetlabs-facts.git' provision: 'https://github.com/puppetlabs/provision.git' - puppet_agent: - repo: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git' - ref: v4.21.0 + puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git' forge_modules: chocolatey: "puppetlabs/chocolatey" java: "puppetlabs/java" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42e7a6e0..f47b156d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,4 +16,4 @@ jobs: uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" secrets: "inherit" with: - runs_on: "ubuntu-24.04" + flags: "--nightly" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 6e3017ba..16b2be38 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -15,4 +15,4 @@ jobs: uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" secrets: "inherit" with: - runs_on: "ubuntu-24.04" + flags: "--nightly" diff --git a/.puppet-lint.rc b/.puppet-lint.rc index cc96ece0..646fc145 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1 +1,10 @@ +--fail-on-warnings --relative +--no-80chars-check +--no-140chars-check +--no-class_inherits_from_params_class-check +--no-autoloader_layout-check +--no-documentation-check +--no-single_quote_string_with_variables-check +--no-anchor_resource-check +--ignore-paths=.vendor/**/*.pp,.bundle/**/*.pp,pkg/**/*.pp,spec/**/*.pp,tests/**/*.pp,types/**/*.pp,vendor/**/*.pp \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml index 439ea84e..47b1aadb 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ require: AllCops: NewCops: enable DisplayCopNames: true - TargetRubyVersion: '2.6' + TargetRubyVersion: 3.1 Include: - "**/*.rb" Exclude: diff --git a/Gemfile b/Gemfile index 2c483db9..e887977d 100644 --- a/Gemfile +++ b/Gemfile @@ -14,51 +14,61 @@ def location_for(place_or_version, fake_version = nil) end group :development do - gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "deep_merge", '~> 1.2.2', require: false gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false - gem "facterdb", '~> 2.1', require: false + gem "facterdb", '~> 2.1', require: false if Gem::Requirement.create(['< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "facterdb", '~> 3.0', require: false if Gem::Requirement.create(['>= 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "metadata-json-lint", '~> 4.0', require: false - gem "rspec-puppet-facts", '~> 4.0', require: false + gem "json-schema", '< 5.1.1', require: false + gem "rspec-puppet-facts", '~> 4.0', require: false if Gem::Requirement.create(['< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "rspec-puppet-facts", '~> 5.0', require: false if Gem::Requirement.create(['>= 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "dependency_checker", '~> 1.0.0', require: false gem "parallel_tests", '= 3.12.1', require: false gem "pry", '~> 0.10', require: false gem "simplecov-console", '~> 0.9', require: false - gem "puppet-debugger", '~> 1.0', require: false + gem "puppet-debugger", '~> 1.6', require: false gem "rubocop", '~> 1.50.0', require: false gem "rubocop-performance", '= 1.16.0', require: false gem "rubocop-rspec", '= 2.19.0', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "rexml", '>= 3.3.9', require: false + gem "bigdecimal", '< 3.2.2', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "ruby-pwsh", require: false end group :development, :release_prep do gem "puppet-strings", '~> 4.0', require: false - gem "puppetlabs_spec_helper", '~> 7.0', require: false + gem "puppetlabs_spec_helper", '~> 8.0', require: false + gem "puppet-blacksmith", '~> 7.0', require: false end group :system_tests do - gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] + gem "puppet_litmus", '~> 2.0', require: false, platforms: [:ruby, :x64_mingw] if !ENV['PUPPET_FORGE_TOKEN'].to_s.empty? + gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] if ENV['PUPPET_FORGE_TOKEN'].to_s.empty? gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "serverspec", '~> 2.41', require: false end -puppet_version = ENV['PUPPET_GEM_VERSION'] -facter_version = ENV['FACTER_GEM_VERSION'] -hiera_version = ENV['HIERA_GEM_VERSION'] gems = {} -gems['puppet'] = location_for(puppet_version) +puppet_version = ENV.fetch('PUPPET_GEM_VERSION', nil) +facter_version = ENV.fetch('FACTER_GEM_VERSION', nil) +hiera_version = ENV.fetch('HIERA_GEM_VERSION', nil) # If facter or hiera versions have been specified via the environment # variables -gems['facter'] = location_for(facter_version) if facter_version +# If PUPPET_FORGE_TOKEN is set then use authenticated source for both puppet and facter, since facter is a transitive dependency of puppet +# Otherwise, do as before and use location_for to fetch gems from the default source +if !ENV['PUPPET_FORGE_TOKEN'].to_s.empty? + gems['puppet'] = ['~> 8.11', { require: false, source: 'https://rubygems-puppetcore.puppet.com' }] + gems['facter'] = ['~> 4.11', { require: false, source: 'https://rubygems-puppetcore.puppet.com' }] +else + gems['puppet'] = location_for(puppet_version) + gems['facter'] = location_for(facter_version) if facter_version +end + gems['hiera'] = location_for(hiera_version) if hiera_version gems.each do |gem_name, gem_params| diff --git a/Rakefile b/Rakefile index 77590fe6..85222267 100644 --- a/Rakefile +++ b/Rakefile @@ -7,3 +7,11 @@ require 'puppet-syntax/tasks/puppet-syntax' require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings' PuppetLint.configuration.send('disable_relative') +PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.send('disable_140chars') +PuppetLint.configuration.send('disable_class_inherits_from_params_class') +PuppetLint.configuration.send('disable_autoloader_layout') +PuppetLint.configuration.send('disable_documentation') +PuppetLint.configuration.send('disable_single_quote_string_with_variables') +PuppetLint.configuration.fail_on_warnings = true +PuppetLint.configuration.ignore_paths = [".vendor/**/*.pp", ".bundle/**/*.pp", "pkg/**/*.pp", "spec/**/*.pp", "tests/**/*.pp", "types/**/*.pp", "vendor/**/*.pp"] diff --git a/metadata.json b/metadata.json index acc6a8c9..3d0dab51 100644 --- a/metadata.json +++ b/metadata.json @@ -100,11 +100,11 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 7.0.0 < 9.0.0" + "version_requirement": ">= 8.0.0 < 9.0.0" } ], "description": "Uses a combination of keytool and Ruby openssl library to manage entries in a Java keystore.", + "pdk-version": "3.5.0 (ga43db72)", "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "tags/3.2.0.4-0-g5d17ec1", - "pdk-version": "3.2.0" + "template-ref": "heads/main-0-g11c0f3d" } From 3a28f48f03d454fb9a7f091019687a4bb0704268 Mon Sep 17 00:00:00 2001 From: Shubham Shinde Date: Fri, 5 Dec 2025 12:38:48 +0530 Subject: [PATCH 2/5] (CAT-2377) For debugging purposes --- .github/workflows/ci.yml | 4 +- metadata.json | 79 ---------------------------------------- 2 files changed, 2 insertions(+), 81 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f47b156d..f360cc9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,12 +8,12 @@ on: jobs: Spec: - uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main" + uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@ubuntu-22-test" secrets: "inherit" Acceptance: needs: Spec - uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" + uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@ubuntu-22-test" secrets: "inherit" with: flags: "--nightly" diff --git a/metadata.json b/metadata.json index 3d0dab51..2ed152fe 100644 --- a/metadata.json +++ b/metadata.json @@ -11,90 +11,11 @@ ], "operatingsystem_support": [ - { - "operatingsystem": "RedHat", - "operatingsystemrelease": [ - "7", - "8", - "9" - ] - }, - { - "operatingsystem": "CentOS", - "operatingsystemrelease": [ - "7", - "8" - ] - }, - { - "operatingsystem": "OracleLinux", - "operatingsystemrelease": [ - "7" - ] - }, - { - "operatingsystem": "Scientific", - "operatingsystemrelease": [ - "7" - ] - }, { "operatingsystem": "SLES", "operatingsystemrelease": [ - "12", - "15" - ] - }, - { - "operatingsystem": "Debian", - "operatingsystemrelease": [ - "10", - "11", "12" ] - }, - { - "operatingsystem": "Ubuntu", - "operatingsystemrelease": [ - "18.04", - "20.04", - "22.04" - ] - }, - { - "operatingsystem": "Solaris", - "operatingsystemrelease": [ - "11" - ] - }, - { - "operatingsystem": "AIX", - "operatingsystemrelease": [ - "7.1" - ] - }, - { - "operatingsystem": "Windows", - "operatingsystemrelease": [ - "2012", - "2012 R2", - "2016", - "2019", - "10", - "2022" - ] - }, - { - "operatingsystem": "Rocky", - "operatingsystemrelease": [ - "8" - ] - }, - { - "operatingsystem": "AlmaLinux", - "operatingsystemrelease": [ - "8" - ] } ], "requirements": [ From 49f43fc51bd380a4ac6984e5605a256fcbe267b1 Mon Sep 17 00:00:00 2001 From: Shubham Shinde Date: Mon, 8 Dec 2025 12:43:47 +0530 Subject: [PATCH 3/5] Update puppet_agent module to point to test branch --- .fixtures.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.fixtures.yml b/.fixtures.yml index 8cfb0560..45a6c3ac 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -2,7 +2,9 @@ fixtures: repositories: facts: 'https://github.com/puppetlabs/puppetlabs-facts.git' provision: 'https://github.com/puppetlabs/provision.git' - puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git' + puppet_agent: + repo: "https://github.com/puppetlabs/puppetlabs-puppet_agent.git" + ref: "CAT-2377" forge_modules: chocolatey: "puppetlabs/chocolatey" java: "puppetlabs/java" From 7f42c58ff2812c3beac7c073898ffb97252eefc7 Mon Sep 17 00:00:00 2001 From: Shubham Shinde Date: Mon, 8 Dec 2025 12:49:07 +0530 Subject: [PATCH 4/5] Fix pulling branch issue --- .fixtures.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index 45a6c3ac..a3b82185 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -3,8 +3,8 @@ fixtures: facts: 'https://github.com/puppetlabs/puppetlabs-facts.git' provision: 'https://github.com/puppetlabs/provision.git' puppet_agent: - repo: "https://github.com/puppetlabs/puppetlabs-puppet_agent.git" - ref: "CAT-2377" + repo: "https://github.com/shubhamshinde360/puppetlabs-puppet_agent.git" + ref: "v0.0.0" forge_modules: chocolatey: "puppetlabs/chocolatey" java: "puppetlabs/java" From eecfffc1d98c92725a7c4db96a7f2a05896db570 Mon Sep 17 00:00:00 2001 From: Shubham Shinde Date: Mon, 8 Dec 2025 13:51:28 +0530 Subject: [PATCH 5/5] Provision VMs only --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f360cc9c..271243f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,12 +8,12 @@ on: jobs: Spec: - uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@ubuntu-22-test" + uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@provision_only" secrets: "inherit" Acceptance: needs: Spec - uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@ubuntu-22-test" + uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@provision_only" secrets: "inherit" with: flags: "--nightly"