Repository navigation
Conversation
Require RSpec 3, matching the root Gemfile; the specs already use RSpec 3 features such as instance_double. Spell out the rails/rails repository for edge. For Rails 8.0 and edge, which need Ruby 3.2, also require SimpleCov 1 and replace the :mswin and :mingw platforms, which Bundler now warns are deprecated, with :windows. Older Rails versions still run on Rubies whose Bundler doesn't know :windows, so leave their platforms alone. Drop the redundant ".0" from the version requirements while here.
Test Active Record 8.1 against all four adapters. On JRuby, only the SQLite JDBC adapter has a Rails 8.1 release so far, the 81.0.pre1 prerelease, so pin it in the sqlite3 gemfile and leave the JRuby platform block out of the mysql2 and postgresql ones.
The JDBC adapters were unpinned, so on JRuby the resolver paired Active Record 8.1 with an ancient 1.x adapter that has no upper bound on activerecord. Resolve Active Record 7.2 with the 72.x adapters instead, or 8.0 with the 80.0.pre1 prerelease on JRuby 10.1, which removed the Java APIs the 72.x adapters were compiled against. Check RUBY_ENGINE rather than using a platforms block, since Bundler evaluates those blocks on every platform. Also drop the redundant ".0" from the simplecov-lcov requirement, as in the gemfiles.
delayed_job 4.2.0's shared examples expect CRuby's backtrace format
on Ruby 3.4 and later, which JRuby 10 reports without the Class#
prefix. That is fixed on delayed_job's master branch, so only skip
the example with 4.2.0 and older.
Rails 7.2 started binding the values in where("run_at <= ?", time)
instead of quoting them, and the JDBC SQLite adapter binds zoned
times in local time rather than UTC, so with a Time.zone behind UTC
jobs aren't reserved until the offset has passed:
jruby/activerecord-jdbc-adapter#1202
Mark both as pending with the reason rather than letting every JRuby
job fail.
Split the matrix into four jobs so it stays readable: - adapters: all four adapters against every Rails version from 6.0 to edge on Ruby 4.0, or on Ruby 3.2 and Ubuntu 22.04 for Rails 6.0 and 6.1, as in delayed_job - rubies: SQLite against Rails 7.0 to edge on Ruby 3.2, 3.3, 3.4 and head, excluding Ruby 3.2 from Rails edge, which requires 3.3.1 - jruby: JRuby 10.0 against the Rails versions the JDBC adapters support, on SQLite, PostgreSQL and MySQL, and jruby-head on SQLite - legacy: the Rubies older than 3.2 against the Rails versions they support, as before, with the PostgreSQL 11 and MySQL 5.7 servers that Active Record before 4.2.6 needs Edge and head jobs continue on error. They replace the Canary workflow, which ran the same master gemfiles, so remove it. Pick the gemfile from the adapter and Rails version rather than listing each path. Move the other jobs' services to PostgreSQL 18 and MySQL 8.4, since PostgreSQL 11 and MySQL 5.7 are long past end of life. Set fail-on-error: false on the Coveralls steps so a coveralls.io outage cannot fail jobs whose tests passed. Remove the Rakefile's coverage task, which set an environment variable nothing read, and its Coveralls hook on a spec task, which required a coveralls gem that is not in any Gemfile. CI now reports coverage through the Coveralls action.
The jobs for Rails 3.0 through 5.2 ran on Ubuntu 20.04, whose runners GitHub has retired, so they sat queued until GitHub cancelled the whole run after 24 hours. Run them on 22.04 instead. Ruby 2.0 and 2.2 don't run there, so test Rails 3.0 through 3.2 and 4.0 on Ruby 2.1, the oldest supported Ruby, along with 4.1. Drop the step that downgraded libpq to a 20.04 package, which doesn't exist on 22.04.
delayed_job 4.2 depends on the logger gem, whose 1.3 release needs Ruby 2.3, so the specs failed to load on Ruby 2.1. Pin it in the gemfiles for Rails versions that run on Ruby 2.1, as delayed_job's own Gemfile does.
The Ruby 2.1 that setup-ruby installs is built against OpenSSL 1.0, and the old pg gem segfaulted it by loading Ubuntu 22.04's libpq, which links OpenSSL 3. Run those jobs in the ruby:2.1 image instead, whose Debian release has a matching libpq, with host networking so the specs still reach the PostgreSQL service on 127.0.0.1.
The 1.x releases of the activerecord-jdbc*-adapter gems have no upper bound on activerecord, so an unpinned resolve on JRuby can pair a modern Active Record with a 2016-era adapter that crashes on the long-removed alias_method_chain. Pin each gemfile to the adapter series for its Rails version, using the 80.0.pre1 prerelease for Rails 8.0 since the resolver never picks prereleases on its own. Several sqlite3 and postgresql gemfiles also pulled in the MySQL JDBC adapter by mistake, so JRuby could never connect with them.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI now has four jobs:
Edge and head jobs are allowed to fail, which replaces the Canary workflow. The other jobs use PostgreSQL 18 and MySQL 8.4, and coverage goes to Coveralls.
Getting JRuby working meant pinning the JDBC adapter for each Rails version (the 1.x adapters have no upper bound on activerecord and crash on modern Rails), adding gemfiles for Rails 8.1, and fixing a few sqlite3 and postgresql gemfiles that pulled in the MySQL adapter by mistake. Two shared examples are skipped on JRuby for upstream reasons: one is already fixed on delayed_job master, and the other is jruby/activerecord-jdbc-adapter#1202.
The Rails 8 and edge gemfiles switch to Bundler's
:windowsplatform, but the older ones keep:mswinand:mingw, since the Bundler versions on older Rubies don't know:windows.This builds on #263, so it includes its commits until it's merged.