From 0df9004760ae1755a542723e4ef9a05192baffcc Mon Sep 17 00:00:00 2001 From: tvpartytonight Date: Wed, 30 Sep 2026 12:50:12 -0700 Subject: [PATCH] (maint) Fix nightly puppet gem install on Windows bundler step The Windows x64-mingw build of puppet is only published via Puppet's nightly download infra, never to the artifactory rubygems mirror used as GEM_SOURCE. The module Gemfile also pins puppet to an explicit :source, so Bundler only ever fetches that gem from the declared remote and 404s trying to redownload a version that was already installed locally in the previous step. Extract the downloaded nightly gem into a plain directory with its gemspec alongside it, and point PUPPET_GEM_VERSION at that directory via a file:// URL. The Gemfile's location_for helper treats a file:// value as a path: source and drops the :source pin entirely, so Bundler resolves puppet locally instead of talking to GEM_SOURCE. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/unit_tests_with_nightly_puppet_gem.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml b/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml index 27f9012..d262fcc 100644 --- a/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml +++ b/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml @@ -54,6 +54,7 @@ jobs: gem sources --add https://artifactory.delivery.puppetlabs.net/artifactory/api/gems/rubygems/ gem sources --remove https://rubygems.org/ gem install puppet.gem -N + ruby -e "require 'rubygems/package'; require 'fileutils'; pkg = Gem::Package.new('puppet.gem'); spec = pkg.spec; dir = 'puppet_gem_extracted'; FileUtils.mkdir_p(dir); pkg.extract_files(dir); File.write(File.join(dir, spec.name + '.gemspec'), spec.to_ruby)" - name: Prepare testing environment with bundler env: @@ -62,7 +63,7 @@ jobs: git config --global core.longpaths true bundle config set system 'true' bundle config set --local without 'release' - ${{ matrix.env_set_cmd }}PUPPET_GEM_VERSION=$(ruby -e 'puts /puppet\s+\((.+)\)/.match(`gem list -eld puppet`)[1]') + ${{ matrix.env_set_cmd }}PUPPET_GEM_VERSION="file://puppet_gem_extracted" bundle update --jobs 4 --retry 3 - name: Run unit tests