From a5a571a7360f6fd9e2328ea04e97c48c4c602341 Mon Sep 17 00:00:00 2001 From: Robb Kidd Date: Tue, 6 Aug 2024 17:39:22 -0400 Subject: [PATCH 1/5] exit the appraisal loop if tests fail --- .github/actions/test_gem/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test_gem/action.yml b/.github/actions/test_gem/action.yml index 401c30102..974d15388 100644 --- a/.github/actions/test_gem/action.yml +++ b/.github/actions/test_gem/action.yml @@ -100,7 +100,7 @@ runs: echo "::group::🔎 Appraising ${i}" BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle install --quiet --jobs=3 --retry=4 && \ BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle show && \ - BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle exec rake test + BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle exec rake test || exit echo "::endgroup::" done else From 4ac28e3a36c2f1bca3d69f62a4bae9f9f699d07f Mon Sep 17 00:00:00 2001 From: Robb Kidd Date: Wed, 7 Aug 2024 16:58:28 -0400 Subject: [PATCH 2/5] include gem_home perms workaround Remove write access to the world on GEM_HOME. Hopefully a temporary workaround until the runner image is fixed. See https://github.com/actions/runner-images/issues/10215 --- .github/actions/test_gem/action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/actions/test_gem/action.yml b/.github/actions/test_gem/action.yml index 974d15388..7b429a72a 100644 --- a/.github/actions/test_gem/action.yml +++ b/.github/actions/test_gem/action.yml @@ -82,6 +82,13 @@ runs: ruby-version: "${{ inputs.ruby }}" bundler: "latest" working-directory: "${{ steps.setup.outputs.gem_dir }}" + # Perms workaround. See https://github.com/actions/runner-images/issues/10215 + - name: Fix GEM_HOME permissions on GitHub Actions Runner + if: "${{ steps.setup.outputs.appraisals == 'true' }}" + shell: bash + run: | + # 🛠️😭 Fix GEM_HOME permissions 😭🛠️ + chmod -R o-w $(gem env home) - name: Install dependencies and generate appraisals if: "${{ steps.setup.outputs.appraisals == 'true' }}" shell: bash From 0afe5b9ae1252596bf7d8d067db78bfdd456693d Mon Sep 17 00:00:00 2001 From: Robb Kidd Date: Wed, 7 Aug 2024 18:03:25 -0400 Subject: [PATCH 3/5] bound which Ruby versions gruf is tested against gruf releases with lower/upper limits for spec.required_ruby_version. So we won't test under Ruby versions that a gruf version won't successfully resolve for. --- instrumentation/gruf/Appraisals | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/instrumentation/gruf/Appraisals b/instrumentation/gruf/Appraisals index c07e47bb9..1ad02a912 100644 --- a/instrumentation/gruf/Appraisals +++ b/instrumentation/gruf/Appraisals @@ -4,14 +4,22 @@ # # SPDX-License-Identifier: Apache-2.0 -appraise 'gruf-2.17' do - gem 'gruf', '~> 2.17.0' +if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.3') + appraise 'gruf-2.17' do + gem 'gruf', '~> 2.17.0' + end + + appraise 'gruf-2.18' do + gem 'gruf', '~> 2.18.0' + end end -appraise 'gruf-2.18' do - gem 'gruf', '~> 2.18.0' +if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.4') + appraise 'gruf-2.19' do + gem 'gruf', '~> 2.19.0' + end end -appraise 'gruf-2.19' do - gem 'gruf', '~> 2.19.0' +appraise 'gruf-latest' do + gem 'gruf' end From d7ba5f48e8320cfdd60fc44cc129bc1ecb3b5030 Mon Sep 17 00:00:00 2001 From: Robb Kidd Date: Thu, 8 Aug 2024 12:36:24 -0400 Subject: [PATCH 4/5] set bundle path instead of chmod'ing sys gem path Alternative workaround to /opt/hostedtoolcache/Ruby being world writable in the ubuntu 20240708.1.0 GA runner image. See actions/runner-images#10215 --- .github/actions/test_gem/action.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/actions/test_gem/action.yml b/.github/actions/test_gem/action.yml index 7b429a72a..c4855e468 100644 --- a/.github/actions/test_gem/action.yml +++ b/.github/actions/test_gem/action.yml @@ -82,18 +82,12 @@ runs: ruby-version: "${{ inputs.ruby }}" bundler: "latest" working-directory: "${{ steps.setup.outputs.gem_dir }}" - # Perms workaround. See https://github.com/actions/runner-images/issues/10215 - - name: Fix GEM_HOME permissions on GitHub Actions Runner - if: "${{ steps.setup.outputs.appraisals == 'true' }}" - shell: bash - run: | - # 🛠️😭 Fix GEM_HOME permissions 😭🛠️ - chmod -R o-w $(gem env home) - name: Install dependencies and generate appraisals if: "${{ steps.setup.outputs.appraisals == 'true' }}" shell: bash run: | # 💎 Install dependencies and generate appraisals 💎 + bundle config path ${HOME}/.gem/ruby/${{ inputs.ruby }} bundle install --quiet --jobs=3 --retry=4 bundle exec appraisal generate working-directory: "${{ steps.setup.outputs.gem_dir }}" @@ -105,6 +99,7 @@ runs: if [[ -f "Appraisals" ]]; then for i in `bundle exec appraisal list | sed 's/-/_/g' `; do echo "::group::🔎 Appraising ${i}" + bundle config path ${HOME}/.gem/ruby/${{ inputs.ruby }} BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle install --quiet --jobs=3 --retry=4 && \ BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle show && \ BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle exec rake test || exit From 7e26393e343a23b8a9b7833d71599a0ec971ae49 Mon Sep 17 00:00:00 2001 From: Robb Kidd Date: Thu, 8 Aug 2024 13:16:34 -0400 Subject: [PATCH 5/5] Revert "set bundle path instead of chmod'ing sys gem path" This reverts commit d7ba5f48e8320cfdd60fc44cc129bc1ecb3b5030. 'bundle config path' was not enough to workaround bundler's filesystem permission check. --- .github/actions/test_gem/action.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/actions/test_gem/action.yml b/.github/actions/test_gem/action.yml index c4855e468..7b429a72a 100644 --- a/.github/actions/test_gem/action.yml +++ b/.github/actions/test_gem/action.yml @@ -82,12 +82,18 @@ runs: ruby-version: "${{ inputs.ruby }}" bundler: "latest" working-directory: "${{ steps.setup.outputs.gem_dir }}" + # Perms workaround. See https://github.com/actions/runner-images/issues/10215 + - name: Fix GEM_HOME permissions on GitHub Actions Runner + if: "${{ steps.setup.outputs.appraisals == 'true' }}" + shell: bash + run: | + # 🛠️😭 Fix GEM_HOME permissions 😭🛠️ + chmod -R o-w $(gem env home) - name: Install dependencies and generate appraisals if: "${{ steps.setup.outputs.appraisals == 'true' }}" shell: bash run: | # 💎 Install dependencies and generate appraisals 💎 - bundle config path ${HOME}/.gem/ruby/${{ inputs.ruby }} bundle install --quiet --jobs=3 --retry=4 bundle exec appraisal generate working-directory: "${{ steps.setup.outputs.gem_dir }}" @@ -99,7 +105,6 @@ runs: if [[ -f "Appraisals" ]]; then for i in `bundle exec appraisal list | sed 's/-/_/g' `; do echo "::group::🔎 Appraising ${i}" - bundle config path ${HOME}/.gem/ruby/${{ inputs.ruby }} BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle install --quiet --jobs=3 --retry=4 && \ BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle show && \ BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle exec rake test || exit