From d0f72bd3e0012852cd973b43d429a7a1c8ee0eca Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Tue, 24 Nov 2026 17:16:33 +1300 Subject: [PATCH 1/3] Cache JRuby's Maven jars in the database E2E workflow On JRuby, installing rbs fetches its chicory jars from Maven Central through jar-dependencies. The generated test app gets rbs through irb and rdoc 8, and the fetch happens on every run, so whenever Maven Central is slow or unreachable from CI the job stalls for two minutes and fails before any test runs. It failed this way twice in a row on one PR. Restore the local Maven repository before the E2E script and save it afterwards, keyed on the test app's lockfile, so most runs skip the fetch. Retry `bundle install` as well, for the runs that still need to fetch. Also move setup-ruby to the same version as the synced CI workflow, which brings the E2E jobs from JRuby 10.1.2.0 to 10.1.3.0. --- .github/workflows/database-e2e.sh | 12 +++++++++++- .github/workflows/database-e2e.yml | 18 +++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/database-e2e.sh b/.github/workflows/database-e2e.sh index 5bdb397e..4249d0ba 100755 --- a/.github/workflows/database-e2e.sh +++ b/.github/workflows/database-e2e.sh @@ -61,7 +61,17 @@ if [ "$JRUBY" = "true" ]; then fi cd testapp -bundle install + +# Retry, since on JRuby some gems fetch their jars from Maven Central during install, which CI +# can't always reach. +for attempt in 1 2 3; do + bundle install && break + if [ "$attempt" -eq 3 ]; then + exit 1 + fi + echo "bundle install failed (attempt $attempt of 3), retrying" + sleep 10 +done # Create database bundle exec hanami db create | tee create.log diff --git a/.github/workflows/database-e2e.yml b/.github/workflows/database-e2e.yml index 6c6e8ae3..c15c8ade 100644 --- a/.github/workflows/database-e2e.yml +++ b/.github/workflows/database-e2e.yml @@ -136,9 +136,25 @@ jobs: ;; esac - name: Set up Ruby - uses: ruby/setup-ruby@7f797815d8adceb1c412e7abefdd1ab4abc47a5f # zizmor: ignore[cache-poisoning] + uses: ruby/setup-ruby@20eb24b0d509e2b9ed9b6d42ddfeb992915e0564 # v1.341.0 # zizmor: ignore[cache-poisoning] with: ruby-version: ${{ matrix.ruby }} bundler-cache: true + # On JRuby, installing some gems (such as rbs) fetches their jars from Maven Central, which CI + # can't always reach. The jars are kept in the local Maven repository, so restoring it lets + # most runs skip the fetch. + - name: Restore Maven repository + if: matrix.ruby == 'jruby' + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ~/.m2/repository + key: maven-jruby-${{ matrix.db }}-${{ github.run_id }} + restore-keys: maven-jruby-${{ matrix.db }}- - name: Run database E2E script run: bash .github/workflows/database-e2e.sh + - name: Save Maven repository + if: matrix.ruby == 'jruby' && hashFiles('testapp/Gemfile.lock') != '' + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ~/.m2/repository + key: maven-jruby-${{ matrix.db }}-${{ hashFiles('testapp/Gemfile.lock') }} From 92568dbbab38c87e3c13ebaafeb82a8afdd6b3f6 Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Tue, 24 Nov 2026 17:27:14 +1300 Subject: [PATCH 2/3] Pin JRuby 10.1.2.0 for the database E2E jobs JRuby 10.1.3.0, which the synced setup-ruby version brings in, drops keyword arguments forwarded through an initialize(...) that sits between two prepended ruby2_keywords initializers. Hanami's DB provider has that shape (dry-configurable's initializer is prepended to both the dry-system source and Hanami::Providers::DB), so hanami db create fails with "wrong number of arguments (given 1, expected 0)". Pin the previous JRuby until a fixed release is out, keeping the Maven cache and bundle install retry. --- .github/workflows/database-e2e.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/database-e2e.yml b/.github/workflows/database-e2e.yml index c15c8ade..c0af2e54 100644 --- a/.github/workflows/database-e2e.yml +++ b/.github/workflows/database-e2e.yml @@ -138,7 +138,9 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@20eb24b0d509e2b9ed9b6d42ddfeb992915e0564 # v1.341.0 # zizmor: ignore[cache-poisoning] with: - ruby-version: ${{ matrix.ruby }} + # JRuby 10.1.3.0 drops keyword arguments forwarded through `initialize(...)` between two + # prepended ruby2_keywords initializers, which breaks the DB provider. Unpin once fixed. + ruby-version: ${{ matrix.ruby == 'jruby' && 'jruby-10.1.2.0' || matrix.ruby }} bundler-cache: true # On JRuby, installing some gems (such as rbs) fetches their jars from Maven Central, which CI # can't always reach. The jars are kept in the local Maven repository, so restoring it lets From e24a23ca68193cc80c7afa5bc8f162fa577f6328 Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Tue, 24 Nov 2026 18:02:07 +1300 Subject: [PATCH 3/3] Link the JRuby issue from the E2E JRuby pin So it's clear when the pin can go: once jruby/jruby#10026, the 10.1.3.0 keyword forwarding regression, is fixed in a release. --- .github/workflows/database-e2e.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/database-e2e.yml b/.github/workflows/database-e2e.yml index c0af2e54..8ba9f055 100644 --- a/.github/workflows/database-e2e.yml +++ b/.github/workflows/database-e2e.yml @@ -139,7 +139,8 @@ jobs: uses: ruby/setup-ruby@20eb24b0d509e2b9ed9b6d42ddfeb992915e0564 # v1.341.0 # zizmor: ignore[cache-poisoning] with: # JRuby 10.1.3.0 drops keyword arguments forwarded through `initialize(...)` between two - # prepended ruby2_keywords initializers, which breaks the DB provider. Unpin once fixed. + # prepended ruby2_keywords initializers, which breaks the DB provider. Unpin once + # https://github.com/jruby/jruby/issues/10026 is fixed. ruby-version: ${{ matrix.ruby == 'jruby' && 'jruby-10.1.2.0' || matrix.ruby }} bundler-cache: true # On JRuby, installing some gems (such as rbs) fetches their jars from Maven Central, which CI