From 45680bb178c51ca190746acc239f03bf8cf4eecd Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 13 Aug 2024 11:45:11 -0400 Subject: [PATCH 01/10] Update build matrix --- .github/workflows/ci.yml | 48 +++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31b73af00..cff283592 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,21 +12,13 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['2.7', '3.0', '3.1', '3.2', jruby-head, ruby-head] + ruby: ['3.1', '3.2', '3.3', jruby-head, ruby-head] rails_version: - - '6.0.0' - - '6.1.0' - '7.0.0' + - '7.1.0' + - '7.2.0' - 'edge' include: - # Rails 5.2 - - ruby: 2.6 - rails_version: '5.2.0' - - ruby: 2.7 - rails_version: '5.2.0' - - ruby: jruby-9.2 - rails_version: '5.2.0' - # Ruby 2.6 - ruby: 2.6 rails_version: '6.0.0' @@ -59,6 +51,40 @@ jobs: rails_version: '5.0.0' - ruby: 2.5 rails_version: '5.1.0' + - ruby: 2.6 + rails_version: '5.2.0' + - ruby: 2.7 + rails_version: '5.2.0' + - ruby: jruby-9.2 + rails_version: '5.2.0' + - ruby: 2.7 + rails_version: '6.0.0' + - ruby: 3.0 + rails_version: '6.0.0' + - ruby: 3.2 + rails_version: '6.0.0' + - ruby: jruby-9.4 + rails_version: '6.0.0' + - ruby: 2.7 + rails_version: '6.1.0' + - ruby: 3.0 + rails_version: '6.1.0' + - ruby: 3.2 + rails_version: '6.1.0' + - ruby: jruby-9.4 + rails_version: '6.0.0' + - ruby: 2.7 + rails_version: '7.0.0' + - ruby: 3.0 + rails_version: '7.0.0' + - ruby: jruby-9.4 + rails_version: '6.0.0' + + # EOL Ruby + - ruby: 2.7 + rails_version: '7.1.0' + - ruby: 3.0 + rails_version: '7.1.0' continue-on-error: ${{ matrix.rails_version == 'edge' || endsWith(matrix.ruby, 'head') }} From 7dfae6208eab29463eb8b4ddabc76abd3b1c9d4a Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 13 Aug 2024 11:45:35 -0400 Subject: [PATCH 02/10] Add sqlite restriction --- Gemfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index c66ff6e7e..d60e75898 100644 --- a/Gemfile +++ b/Gemfile @@ -7,6 +7,8 @@ platforms :ruby do # Rails 6 now requires sqlite 1.4 if ENV['RAILS_VERSION'] && ENV['RAILS_VERSION'] < '5.1' gem 'sqlite3', '< 1.4' + elsif ENV['RAILS_VERSION'] && ENV['RAILS_VERSION'] < '7.2' + gem 'sqlite3', '~> 1.4' else gem 'sqlite3' end From 8327175b6355aa816136c4a3ae4339a188585ef4 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 13 Aug 2024 11:56:50 -0400 Subject: [PATCH 03/10] Fix BasicObject cleanup --- lib/delayed/message_sending.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/delayed/message_sending.rb b/lib/delayed/message_sending.rb index 6e1e834a1..eeb7ee671 100644 --- a/lib/delayed/message_sending.rb +++ b/lib/delayed/message_sending.rb @@ -1,10 +1,14 @@ module Delayed class DelayProxy < BasicObject - undef_method :== - undef_method :equal? + # What additional methods exist on BasicObject has changed over time + (::BasicObject.instance_methods - [:__id__, :__send__, :instance_eval, :instance_exec]).each do |method| + undef_method method + end # Let DelayProxy raise exceptions. - define_method(:raise, ::Object.instance_method(:raise)) + def raise(*args) + ::Object.send(:raise, *args) + end def initialize(payload_class, target, options) @payload_class = payload_class From 2ded9a328b316de0a79c9f9af007197802877ba5 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 13 Aug 2024 13:30:09 -0400 Subject: [PATCH 04/10] Fix rails 4.2 and 5.0 test dependencies --- Gemfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gemfile b/Gemfile index d60e75898..4b5fce9a7 100644 --- a/Gemfile +++ b/Gemfile @@ -53,6 +53,11 @@ group :test do elsif ENV['RAILS_VERSION'] gem 'actionmailer', "~> #{ENV['RAILS_VERSION']}" gem 'activerecord', "~> #{ENV['RAILS_VERSION']}" + if ENV['RAILS_VERSION'] < '5.1' + gem 'loofah', '2.3.1' + gem 'nokogiri', '< 1.11.0' + gem 'rails-html-sanitizer', '< 1.4.0' + end else gem 'actionmailer', ['>= 3.0', '< 8.0'] gem 'activerecord', ['>= 3.0', '< 8.0'] From e815df8d125b3da6254e4c47adbd852ac42b3523 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 13 Aug 2024 13:54:58 -0400 Subject: [PATCH 05/10] Ruby libraries moved out of standard lib in 3.4 --- Gemfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Gemfile b/Gemfile index 4b5fce9a7..ec2699867 100644 --- a/Gemfile +++ b/Gemfile @@ -71,6 +71,13 @@ group :test do else gem 'simplecov-lcov', :require => false end + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0') + # New dependencies with a deprecation notice in Ruby 3.3 and required in Ruby 3.4 + # Probably won't get released in rails 7.0 + gem 'base64' + gem 'bigdecimal' + gem 'mutex_m' + end if ENV['RAILS_VERSION'].nil? || ENV['RAILS_VERSION'] >= '6.0.0' gem 'zeitwerk', :require => false end From b27cdc97c73829d9ca5da3e611e38ecb514f20b7 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 13 Aug 2024 14:05:10 -0400 Subject: [PATCH 06/10] Handle ruby 3.4 message expectation --- lib/delayed/backend/shared_spec.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/delayed/backend/shared_spec.rb b/lib/delayed/backend/shared_spec.rb index 39f497670..b773666f8 100644 --- a/lib/delayed/backend/shared_spec.rb +++ b/lib/delayed/backend/shared_spec.rb @@ -595,7 +595,12 @@ def create_job(opts = {}) worker.work_off @job.reload expect(@job.last_error).to match(/did not work/) - expect(@job.last_error).to match(/sample_jobs.rb:\d+:in `perform'/) + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4.0') + # Ruby 3.4 produces a more verbose message + expect(@job.last_error).to match(/sample_jobs.rb:\d+:in 'ErrorJob#perform'/) + else + expect(@job.last_error).to match(/sample_jobs.rb:\d+:in `perform'/) + end expect(@job.attempts).to eq(1) expect(@job.run_at).to be > Delayed::Job.db_time_now - 10.minutes expect(@job.run_at).to be < Delayed::Job.db_time_now + 10.minutes From c9947ab1727dc7ee46182f66f4a03a17aef9b021 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 13 Aug 2024 14:12:28 -0400 Subject: [PATCH 07/10] Update actions/checkout --- .github/workflows/ci.yml | 2 +- .github/workflows/rubocop.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cff283592..d133056a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,7 +89,7 @@ jobs: continue-on-error: ${{ matrix.rails_version == 'edge' || endsWith(matrix.ruby, 'head') }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 env: RAILS_VERSION: ${{ matrix.rails_version }} diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 739473987..57bd319f0 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Ruby 2.7 uses: ruby/setup-ruby@v1 with: From 3cbf1a31cddfc144b49c7560c152cc8659386c01 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 13 Aug 2024 14:12:46 -0400 Subject: [PATCH 08/10] Run jruby-9.4 --- .github/workflows/ci.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d133056a2..c0248776f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['3.1', '3.2', '3.3', jruby-head, ruby-head] + ruby: ['3.1', '3.2', '3.3', jruby-9.4, jruby-head, ruby-head] rails_version: - '7.0.0' - '7.1.0' @@ -31,12 +31,6 @@ jobs: - ruby: jruby-9.2 rails_version: '6.1.0' - # jruby-9.4 - - ruby: jruby-9.4 - rails_version: '7.0.0' - - ruby: jruby-9.4 - rails_version: 'edge' - # # The past # From b5c1d6a419317092ed4b87b9940d86e64de8687a Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 13 Aug 2024 14:15:30 -0400 Subject: [PATCH 09/10] Switch to coveralls main --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0248776f..73334f9f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,7 +95,7 @@ jobs: RAILS_VERSION: ${{ matrix.rails_version }} run: bundle exec rspec - name: Coveralls Parallel - uses: coverallsapp/github-action@master + uses: coverallsapp/github-action@main with: github-token: ${{ secrets.github_token }} flag-name: run-${{ matrix.ruby }}-${{ matrix.rails_version }} @@ -106,7 +106,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Coveralls Finished - uses: coverallsapp/github-action@master + uses: coverallsapp/github-action@main with: github-token: ${{ secrets.github_token }} parallel-finished: true From 604fb961a7e849a869091338d0a9d87a1368381b Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 13 Aug 2024 14:17:15 -0400 Subject: [PATCH 10/10] Update actions/cache --- .github/workflows/rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 57bd319f0..9d1e97905 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -15,7 +15,7 @@ jobs: - name: Generate lockfile for cache key run: bundle lock - name: Cache gems - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: vendor/bundle key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }}