From dce6ca196918ab3c1f68d96584db0bad054f977f Mon Sep 17 00:00:00 2001 From: Dana Doherty Date: Mon, 28 Apr 2025 16:16:12 +0100 Subject: [PATCH 01/13] resolve conflicts --- .github/workflows/workflow-restarter-test.yml | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 .github/workflows/workflow-restarter-test.yml diff --git a/.github/workflows/workflow-restarter-test.yml b/.github/workflows/workflow-restarter-test.yml new file mode 100644 index 00000000..68b5258a --- /dev/null +++ b/.github/workflows/workflow-restarter-test.yml @@ -0,0 +1,109 @@ +name: Workflow Restarter TEST + +on: + workflow_dispatch: + inputs: + fail: + description: > + For (linux_tests, windows_tests) jobs: + 'true' = (fail, succeed) and + 'false' = (succeed, fail) + required: true + default: 'true' +env: + SOURCE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + linux_tests: + name: Linux, Puppet ${{ matrix.cfg.puppet_version }}, Ruby ${{ matrix.cfg.ruby }} + runs-on: ubuntu-latest + strategy: + matrix: + cfg: + - {puppet_version: '7', ruby: '2.7'} + - {puppet_version: '7', ruby: 'jruby-9.3.7.0'} + - {puppet_version: '8', ruby: '3.2'} + - {puppet_version: '8', ruby: 'jruby-9.4.2.0'} + env: + PUPPET_GEM_VERSION: ~> ${{ matrix.cfg.puppet_version }} + steps: + - name: Checkout current PR + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Ruby version ${{ matrix.cfg.ruby }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.cfg.ruby }} + - name: Update rubygems and install gems + run: | + bundle config set without development + bundle install --jobs 4 --retry 3 + + - name: Rubocop + run: | + bundle exec rake rubocop + + - name: Run tests + run: | + bundle exec rake spec + + # Starting with version 3.2, Ruby no longer bundles libffi, which is necessary for tests on Windows. Due to a discrepancy between the C + # library the Windows Puppet gem is built against and what GitHub runners use (MinGW and ucrt, respectively) we can't install the + # Windows-specific Puppet gem that includes libffi. To work around these issues, we have a separate "integration" group that we include + # when testing Puppet 8 / Ruby 3.2 on Windows. See PA-5406 for more. + windows_tests: + name: Windows, Puppet ${{ matrix.cfg.puppet_version }}, Ruby ${{ matrix.cfg.ruby }} + runs-on: windows-latest + strategy: + matrix: + cfg: + - {puppet_version: '7', ruby: '2.7'} + - {puppet_version: '8', ruby: '3.2', extra: 'bundle config set with integration'} + env: + PUPPET_GEM_VERSION: ~> ${{ matrix.cfg.puppet_version }} + steps: + - name: Checkout current PR + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Ruby version ${{ matrix.cfg.ruby }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.cfg.ruby }} + - name: Update rubygems and install gems + run: | + bundle config set without development + ${{ matrix.cfg.extra }} + bundle install --jobs 4 --retry 3 + + - name: Rubocop + run: | + bundle exec rake rubocop + + - name: Run tests + run: | + bundle exec rake spec + + on-failure-workflow-restarter-proxy: + # (1) run this job after the "acceptance" job and... + needs: [linux_tests, windows_tests] + # (2) continue ONLY IF "acceptance" fails + if: always() && needs.linux_tests.result == 'failure' || needs.windows_tests.result == 'failure' + runs-on: ubuntu-latest + steps: + # (3) checkout this repository in order to "see" the following custom action + - name: Checkout repository + uses: actions/checkout@v4 + + # (4) "use" the custom action to retrigger the failed "acceptance job" above + # NOTE: pass the SOURCE_GITHUB_TOKEN to the custom action because (a) it must have + # this to trigger the reusable workflow that restarts the failed job; and + # (b) custom actions do not have access to the calling workflow's secrets + - name: Trigger reusable workflow + uses: "puppetlabs/cat-github-actions/.github/actions/workflow-restarter-proxy@main" + env: + SOURCE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + repository: ${{ github.repository }} + run_id: ${{ github.run_id }} From 4594c3b740c218d91f55f61c9cdea5c7a13e73f0 Mon Sep 17 00:00:00 2001 From: Dana Doherty Date: Mon, 28 Apr 2025 12:47:23 +0100 Subject: [PATCH 02/13] update nkf --- Gemfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Gemfile b/Gemfile index d9c2169b..d3d3336f 100644 --- a/Gemfile +++ b/Gemfile @@ -10,6 +10,14 @@ group :tests do gem 'rspec', '~> 3.0' gem 'simplecov-console' + platforms :mswin, :mingw, :x64_mingw do + gem 'nkf', '= 0.1.2' + end + + platforms :ruby do + gem 'nkf', '>= 0.1.2' + end + # the test gems required for module testing gem 'puppetlabs_spec_helper', '~> 8.0' gem 'rspec-puppet' From 80ef10895b64453d83a7484430f2db3061f1e12e Mon Sep 17 00:00:00 2001 From: Dana Doherty Date: Mon, 28 Apr 2025 13:35:32 +0100 Subject: [PATCH 03/13] update nightly run --- .github/workflows/nightly.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index b69d1179..1c568210 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,8 +1,10 @@ name: "nightly" on: - schedule: - - cron: "0 0 * * *" +# schedule: +# - cron: "0 0 * * *" + workflow_dispatch: + jobs: linux_tests: From 933f1e796fdf56c1de7c97b54b6bb063505f569d Mon Sep 17 00:00:00 2001 From: Dana Doherty Date: Mon, 28 Apr 2025 15:58:09 +0100 Subject: [PATCH 04/13] update --- .github/workflows/nightly.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1c568210..62f51b3a 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,6 +3,9 @@ name: "nightly" on: # schedule: # - cron: "0 0 * * *" + pull_request: + branches: + - "main" workflow_dispatch: From 6d0af7b08d923c58a82e4484eea3b08c6d5a8592 Mon Sep 17 00:00:00 2001 From: Dana Doherty Date: Mon, 28 Apr 2025 16:09:06 +0100 Subject: [PATCH 05/13] update --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 62f51b3a..35282b99 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -5,7 +5,7 @@ on: # - cron: "0 0 * * *" pull_request: branches: - - "main" + - "maint-fix-nightlies" workflow_dispatch: From ee1c2c6e3b56bce2e3c8dc55cda6180f7416150a Mon Sep 17 00:00:00 2001 From: Dana Doherty Date: Mon, 28 Apr 2025 16:47:11 +0100 Subject: [PATCH 06/13] remove workflow restrater test --- .github/workflows/workflow-restarter-test.yml | 109 ------------------ 1 file changed, 109 deletions(-) delete mode 100644 .github/workflows/workflow-restarter-test.yml diff --git a/.github/workflows/workflow-restarter-test.yml b/.github/workflows/workflow-restarter-test.yml deleted file mode 100644 index 68b5258a..00000000 --- a/.github/workflows/workflow-restarter-test.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: Workflow Restarter TEST - -on: - workflow_dispatch: - inputs: - fail: - description: > - For (linux_tests, windows_tests) jobs: - 'true' = (fail, succeed) and - 'false' = (succeed, fail) - required: true - default: 'true' -env: - SOURCE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -jobs: - linux_tests: - name: Linux, Puppet ${{ matrix.cfg.puppet_version }}, Ruby ${{ matrix.cfg.ruby }} - runs-on: ubuntu-latest - strategy: - matrix: - cfg: - - {puppet_version: '7', ruby: '2.7'} - - {puppet_version: '7', ruby: 'jruby-9.3.7.0'} - - {puppet_version: '8', ruby: '3.2'} - - {puppet_version: '8', ruby: 'jruby-9.4.2.0'} - env: - PUPPET_GEM_VERSION: ~> ${{ matrix.cfg.puppet_version }} - steps: - - name: Checkout current PR - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install Ruby version ${{ matrix.cfg.ruby }} - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.cfg.ruby }} - - name: Update rubygems and install gems - run: | - bundle config set without development - bundle install --jobs 4 --retry 3 - - - name: Rubocop - run: | - bundle exec rake rubocop - - - name: Run tests - run: | - bundle exec rake spec - - # Starting with version 3.2, Ruby no longer bundles libffi, which is necessary for tests on Windows. Due to a discrepancy between the C - # library the Windows Puppet gem is built against and what GitHub runners use (MinGW and ucrt, respectively) we can't install the - # Windows-specific Puppet gem that includes libffi. To work around these issues, we have a separate "integration" group that we include - # when testing Puppet 8 / Ruby 3.2 on Windows. See PA-5406 for more. - windows_tests: - name: Windows, Puppet ${{ matrix.cfg.puppet_version }}, Ruby ${{ matrix.cfg.ruby }} - runs-on: windows-latest - strategy: - matrix: - cfg: - - {puppet_version: '7', ruby: '2.7'} - - {puppet_version: '8', ruby: '3.2', extra: 'bundle config set with integration'} - env: - PUPPET_GEM_VERSION: ~> ${{ matrix.cfg.puppet_version }} - steps: - - name: Checkout current PR - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install Ruby version ${{ matrix.cfg.ruby }} - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.cfg.ruby }} - - name: Update rubygems and install gems - run: | - bundle config set without development - ${{ matrix.cfg.extra }} - bundle install --jobs 4 --retry 3 - - - name: Rubocop - run: | - bundle exec rake rubocop - - - name: Run tests - run: | - bundle exec rake spec - - on-failure-workflow-restarter-proxy: - # (1) run this job after the "acceptance" job and... - needs: [linux_tests, windows_tests] - # (2) continue ONLY IF "acceptance" fails - if: always() && needs.linux_tests.result == 'failure' || needs.windows_tests.result == 'failure' - runs-on: ubuntu-latest - steps: - # (3) checkout this repository in order to "see" the following custom action - - name: Checkout repository - uses: actions/checkout@v4 - - # (4) "use" the custom action to retrigger the failed "acceptance job" above - # NOTE: pass the SOURCE_GITHUB_TOKEN to the custom action because (a) it must have - # this to trigger the reusable workflow that restarts the failed job; and - # (b) custom actions do not have access to the calling workflow's secrets - - name: Trigger reusable workflow - uses: "puppetlabs/cat-github-actions/.github/actions/workflow-restarter-proxy@main" - env: - SOURCE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - repository: ${{ github.repository }} - run_id: ${{ github.run_id }} From 07e13b1db8dec6e70c76005a8bfc8d51855ae685 Mon Sep 17 00:00:00 2001 From: Dana Doherty Date: Mon, 28 Apr 2025 16:48:56 +0100 Subject: [PATCH 07/13] update Gemgile --- Gemfile | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index d3d3336f..0ce0f33f 100644 --- a/Gemfile +++ b/Gemfile @@ -10,14 +10,6 @@ group :tests do gem 'rspec', '~> 3.0' gem 'simplecov-console' - platforms :mswin, :mingw, :x64_mingw do - gem 'nkf', '= 0.1.2' - end - - platforms :ruby do - gem 'nkf', '>= 0.1.2' - end - # the test gems required for module testing gem 'puppetlabs_spec_helper', '~> 8.0' gem 'rspec-puppet' @@ -44,6 +36,7 @@ end group :integration do # Pin due to an issue with FFI, Windows, and Facter. See FACT-3434 gem 'ffi', '1.15.5' + gem 'nkf', '= 0.1.2' end # Find a location or specific version for a gem. place_or_version can be a From 2b5dbb8a0fb9350a72083ce20e9b7fa15893e132 Mon Sep 17 00:00:00 2001 From: Dana Doherty Date: Mon, 28 Apr 2025 17:01:26 +0100 Subject: [PATCH 08/13] update Gemgile --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index 0ce0f33f..a66a9a86 100644 --- a/Gemfile +++ b/Gemfile @@ -37,6 +37,7 @@ group :integration do # Pin due to an issue with FFI, Windows, and Facter. See FACT-3434 gem 'ffi', '1.15.5' gem 'nkf', '= 0.1.2' + end # Find a location or specific version for a gem. place_or_version can be a From 743565e106df7da9273daadf15e4c6d46230df09 Mon Sep 17 00:00:00 2001 From: Dana Doherty Date: Mon, 28 Apr 2025 17:26:28 +0100 Subject: [PATCH 09/13] with integration --- .github/workflows/ci.yml | 2 +- .github/workflows/nightly.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97163c33..9c8e5036 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,7 @@ jobs: run: | bundle config set without development ${{ matrix.cfg.extra }} - bundle install --jobs 4 --retry 3 + bundle install --jobs 4 --retry 3 --with integration - name: Rubocop run: | diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 35282b99..498fa706 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -68,7 +68,7 @@ jobs: run: | bundle config set without development ${{ matrix.cfg.extra }} - bundle install --jobs 4 --retry 3 + bundle install --jobs 4 --retry 3 --with integration - name: Rubocop run: | From ca636d17a25564ea4797658d20aab6dec04fe120 Mon Sep 17 00:00:00 2001 From: Dana Doherty Date: Mon, 28 Apr 2025 17:41:52 +0100 Subject: [PATCH 10/13] with integration --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index a66a9a86..9c65a3d1 100644 --- a/Gemfile +++ b/Gemfile @@ -36,6 +36,7 @@ end group :integration do # Pin due to an issue with FFI, Windows, and Facter. See FACT-3434 gem 'ffi', '1.15.5' + gem 'bigdecimal' '=1.4.4' gem 'nkf', '= 0.1.2' end From 6725df6b1f626417869cc87ce71de068af0cf8c4 Mon Sep 17 00:00:00 2001 From: Dana Doherty Date: Mon, 28 Apr 2025 17:45:45 +0100 Subject: [PATCH 11/13] with integration --- .github/workflows/ci.yml | 3 ++- Gemfile | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c8e5036..da459d63 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,8 @@ jobs: run: | bundle config set without development ${{ matrix.cfg.extra }} - bundle install --jobs 4 --retry 3 --with integration + bundle config set with integration + bundle install --jobs 4 --retry 3 - name: Rubocop run: | diff --git a/Gemfile b/Gemfile index 9c65a3d1..144afbee 100644 --- a/Gemfile +++ b/Gemfile @@ -37,7 +37,7 @@ group :integration do # Pin due to an issue with FFI, Windows, and Facter. See FACT-3434 gem 'ffi', '1.15.5' gem 'bigdecimal' '=1.4.4' - gem 'nkf', '= 0.1.2' + gem 'nkf', '=0.1.2' end From 0712bc0e2f3fb16091c39ec18f399dd237bd6ff1 Mon Sep 17 00:00:00 2001 From: Dana Doherty Date: Mon, 28 Apr 2025 17:49:12 +0100 Subject: [PATCH 12/13] with integration --- Gemfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Gemfile b/Gemfile index 144afbee..b091ef62 100644 --- a/Gemfile +++ b/Gemfile @@ -36,7 +36,6 @@ end group :integration do # Pin due to an issue with FFI, Windows, and Facter. See FACT-3434 gem 'ffi', '1.15.5' - gem 'bigdecimal' '=1.4.4' gem 'nkf', '=0.1.2' end From c236947ea32f13cf022b6c1a7a529c3765be3c1d Mon Sep 17 00:00:00 2001 From: Dana Doherty Date: Mon, 28 Apr 2025 17:54:32 +0100 Subject: [PATCH 13/13] with integration --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da459d63..135b5caf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,9 +63,8 @@ jobs: ruby-version: ${{ matrix.cfg.ruby }} - name: Update rubygems and install gems run: | - bundle config set without development - ${{ matrix.cfg.extra }} bundle config set with integration + ${{ matrix.cfg.extra }} bundle install --jobs 4 --retry 3 - name: Rubocop