Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/database-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 21 additions & 2 deletions .github/workflows/database-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,28 @@ 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 }}
# 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 }}
Comment on lines +141 to +144

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.

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') }}