Skip to content

Cache JRuby's Maven jars in the database E2E workflow - #480

Open
parndt wants to merge 3 commits into
mainfrom
cache-jruby-maven-jars
Open

parndt wants to merge 3 commits into
mainfrom
cache-jruby-maven-jars

Conversation

@parndt

@parndt parndt commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

The JRuby database E2E jobs fail now and then before any test runs. Installing rbs on JRuby fetches its jars from Maven Central, and the generated test app gets rbs through irb and rdoc 8, so every run depends on Maven Central being reachable from CI. When it isn't, bundle install stalls for two minutes and fails.

This restores the local Maven repository before the E2E script and saves it afterwards, keyed on the test app's lockfile, so most runs skip the fetch, and retries bundle install for the runs that still need it. It also moves setup-ruby to the version the synced CI workflow uses, but pins JRuby 10.1.2.0, since 10.1.3.0 drops keyword arguments forwarded through an initialize(...) between two prepended ruby2_keywords initializers, which breaks Hanami's DB provider.

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.
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.
@parndt
parndt requested review from a team and timriley November 24, 2026 04:58
@parndt
parndt marked this pull request as ready for review November 24, 2026 04:58
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.
Comment on lines +141 to +144
# JRuby 10.1.3.0 drops keyword arguments forwarded through `initialize(...)` between two
# 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 }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually need this workaround here for JRuby, @parndt? AFAIK we worked around this bug in all the places it impacted us.

@parndt parndt Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workaround in hanami/hanami#1667 is only on main, and the E2E app is generated with hanami new, so it gets released hanami (3.0.3), which doesn't have it. Only hanami-cli, hanami-reloader, dry-cli, and hanami-db are pointed at main there. I'd backport hanami/hanami#1667 to release-3.0, since apps on JRuby 10.1.3 with a database hit it too, and drop this pin once that's released.

Up to you.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could also use Hanami from main instead of pinning down JRuby version. It's more about testing CLI, so I think having different version of Hanami is okay.

I think I wouldn't backport the fix, as 3.0 does not officially support JRuby.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants