From 9db85f9148f9c4af39a1d2d5f63e1a7e902cd78d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Pitucha?= Date: Mon, 19 Aug 2019 08:01:47 +1000 Subject: [PATCH 01/63] Add metadata link Add links which are exposed on rubygems and help with update automation. --- delayed_job.gemspec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/delayed_job.gemspec b/delayed_job.gemspec index b45c7d1cf..f7bcb979c 100644 --- a/delayed_job.gemspec +++ b/delayed_job.gemspec @@ -14,4 +14,9 @@ Gem::Specification.new do |spec| spec.summary = 'Database-backed asynchronous priority queue system -- Extracted from Shopify' spec.test_files = Dir.glob('spec/**/*') spec.version = '4.1.8' + spec.metadata = { + "changelog_uri" => "https://github.com/collectiveidea/delayed_job/blob/master/CHANGELOG.md", + "bug_tracker_uri" => "https://github.com/collectiveidea/delayed_job/issues", + "source_code_uri" => "https://github.com/collectiveidea/delayed_job" + } end From a346ab87577d6f3436b029ee82c276c78ef96dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Pitucha?= Date: Mon, 19 Aug 2019 11:38:37 +1000 Subject: [PATCH 02/63] Fix quoting for rubocop --- delayed_job.gemspec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/delayed_job.gemspec b/delayed_job.gemspec index f7bcb979c..ab252b723 100644 --- a/delayed_job.gemspec +++ b/delayed_job.gemspec @@ -15,8 +15,8 @@ Gem::Specification.new do |spec| spec.test_files = Dir.glob('spec/**/*') spec.version = '4.1.8' spec.metadata = { - "changelog_uri" => "https://github.com/collectiveidea/delayed_job/blob/master/CHANGELOG.md", - "bug_tracker_uri" => "https://github.com/collectiveidea/delayed_job/issues", - "source_code_uri" => "https://github.com/collectiveidea/delayed_job" + 'changelog_uri' => 'https://github.com/collectiveidea/delayed_job/blob/master/CHANGELOG.md', + 'bug_tracker_uri' => 'https://github.com/collectiveidea/delayed_job/issues', + 'source_code_uri' => 'https://github.com/collectiveidea/delayed_job' } end From 7660286379d7232c8bf38ea44560b058bf9df125 Mon Sep 17 00:00:00 2001 From: Johnny Shields Date: Tue, 22 Sep 2020 18:25:14 +0900 Subject: [PATCH 03/63] Make .delay method work with ActionMailer::Parameterized::Mailer This PR unifies the DelayedJob behavior of ActionMailer::Base and ActionMailer::Parameterized::Mailer Now, the following syntax works equivalently: ```ruby # works currently MyMailer.delay.my_method # this PR makes the following work MyMailer.with(foo: 1, bar: 2).delay.my_method ``` Note that ActionMailer::Parameterized::Mailer does not inherit ActionMailer::Base (moreover, the `.with()` method returns an object instance, hence we use `include` rather than `extend`) --- lib/delayed_job.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/delayed_job.rb b/lib/delayed_job.rb index 511bf7b88..5146ed215 100644 --- a/lib/delayed_job.rb +++ b/lib/delayed_job.rb @@ -16,6 +16,7 @@ ActiveSupport.on_load(:action_mailer) do require 'delayed/performable_mailer' ActionMailer::Base.extend(Delayed::DelayMail) + ActionMailer::Parameterized::Mailer.include(Delayed::DelayMail) end module Delayed From fc0e9e219225e40cd8f78bc4d79f859e62c26c8c Mon Sep 17 00:00:00 2001 From: shields Date: Tue, 22 Sep 2020 18:38:38 +0900 Subject: [PATCH 04/63] Add specs --- lib/delayed_job.rb | 2 +- spec/performable_mailer_spec.rb | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/lib/delayed_job.rb b/lib/delayed_job.rb index 5146ed215..d38f2edbc 100644 --- a/lib/delayed_job.rb +++ b/lib/delayed_job.rb @@ -16,7 +16,7 @@ ActiveSupport.on_load(:action_mailer) do require 'delayed/performable_mailer' ActionMailer::Base.extend(Delayed::DelayMail) - ActionMailer::Parameterized::Mailer.include(Delayed::DelayMail) + ActionMailer::Parameterized::Mailer.include(Delayed::DelayMail) if defined?(ActionMailer::Parameterized::Mailer) end module Delayed diff --git a/spec/performable_mailer_spec.rb b/spec/performable_mailer_spec.rb index 520d96596..0cc9a4b6e 100644 --- a/spec/performable_mailer_spec.rb +++ b/spec/performable_mailer_spec.rb @@ -40,3 +40,29 @@ def signup(email) end end end + +if defined?(ActionMailer::Parameterized::Mailer) + describe ActionMailer::Parameterized::Mailer do + describe 'delay' do + it 'enqueues a PerformableEmail job' do + expect do + job = MyMailer.with(foo: 1, bar: 2).delay.signup('john@example.com') + expect(job.payload_object.class).to eq(Delayed::PerformableMailer) + expect(job.payload_object.object.class).to eq(ActionMailer::Parameterized::Mailer) + expect(job.payload_object.object.instance_variable_get('@mailer')).to eq(MyMailer) + expect(job.payload_object.object.instance_variable_get('@params')).to eq(foo: 1, bar: 2) + expect(job.payload_object.method_name).to eq(:signup) + expect(job.payload_object.args).to eq(['john@example.com']) + end.to change { Delayed::Job.count }.by(1) + end + end + + describe 'delay on a mail object' do + it 'raises an exception' do + expect do + MyMailer.with(foo: 1, bar: 2).signup('john@example.com').delay + end.to raise_error(RuntimeError) + end + end + end +end From 4878fcd255ed11ea6ea81b80fe9c85d716721bb7 Mon Sep 17 00:00:00 2001 From: shields Date: Tue, 22 Sep 2020 19:10:27 +0900 Subject: [PATCH 05/63] Add to and improve README for Mailers --- README.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3bf63336e..37998eb05 100644 --- a/README.md +++ b/README.md @@ -168,9 +168,10 @@ end If you ever want to call a `handle_asynchronously`'d method without Delayed Job, for instance while debugging something at the console, just add `_without_delay` to the method name. For instance, if your original method was `foo`, then call `foo_without_delay`. -Rails 3 Mailers -=============== -Due to how mailers are implemented in Rails 3, we had to do a little work around to get delayed_job to work. +Rails Mailers +============= +Delayed Job uses special syntax for Rails Mailers. +Do not call the `.deliver` method when using `.delay`. ```ruby # without delayed_job @@ -179,12 +180,16 @@ Notifier.signup(@user).deliver # with delayed_job Notifier.delay.signup(@user) -# with delayed_job running at a specific time +# delayed_job running at a specific time Notifier.delay(run_at: 5.minutes.from_now).signup(@user) + +# when using parameters, the .with method must be called before the .delay method +Notifier.with(foo: 1, bar: 2).delay.signup(@user) ``` -Remove the `.deliver` method to make it work. It's not ideal, but it's the best -we could do for now. +You may also wish to consider using +[Active Job with Action Mailer](https://edgeguides.rubyonrails.org/active_job_basics.html#action-mailer) +which provides convenient `.deliver_later` syntax that forwards to Delayed Job under-the-hood. Named Queues ============ From 75bec31fb407b7444e943ad40312f464754af5df Mon Sep 17 00:00:00 2001 From: shields Date: Tue, 22 Sep 2020 19:28:34 +0900 Subject: [PATCH 06/63] Fix rubocop --- spec/performable_mailer_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/performable_mailer_spec.rb b/spec/performable_mailer_spec.rb index 0cc9a4b6e..39796eea2 100644 --- a/spec/performable_mailer_spec.rb +++ b/spec/performable_mailer_spec.rb @@ -46,11 +46,11 @@ def signup(email) describe 'delay' do it 'enqueues a PerformableEmail job' do expect do - job = MyMailer.with(foo: 1, bar: 2).delay.signup('john@example.com') + job = MyMailer.with(:foo => 1, :bar => 2).delay.signup('john@example.com') expect(job.payload_object.class).to eq(Delayed::PerformableMailer) expect(job.payload_object.object.class).to eq(ActionMailer::Parameterized::Mailer) expect(job.payload_object.object.instance_variable_get('@mailer')).to eq(MyMailer) - expect(job.payload_object.object.instance_variable_get('@params')).to eq(foo: 1, bar: 2) + expect(job.payload_object.object.instance_variable_get('@params')).to eq(:foo => 1, :bar => 2) expect(job.payload_object.method_name).to eq(:signup) expect(job.payload_object.args).to eq(['john@example.com']) end.to change { Delayed::Job.count }.by(1) @@ -60,7 +60,7 @@ def signup(email) describe 'delay on a mail object' do it 'raises an exception' do expect do - MyMailer.with(foo: 1, bar: 2).signup('john@example.com').delay + MyMailer.with(:foo => 1, :bar => 2).signup('john@example.com').delay end.to raise_error(RuntimeError) end end From 065fc51b17abdf47908240032d84338f8c417564 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 8 Dec 2020 16:53:54 -0500 Subject: [PATCH 07/63] Add Github Action CI --- .github/workflows/ci.yml | 65 ++++++++++++++++++++++++++++++++++++++++ Gemfile | 4 +-- spec/helper.rb | 16 ++++++---- 3 files changed, 78 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..7fd338afe --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,65 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: [2.5, 2.6, 2.7, jruby, jruby-head, ruby-head] + rails_version: + - '~> 5.2.0' + - '~> 6.0.0' + - 'edge' + include: + # + # The past + # + # EOL Active Record + - ruby: 2.2 + rails_version: '~> 3.2.0' + - ruby: 2.1 + rails_version: '~> 4.1.0' + - ruby: 2.4 + rails_version: '~> 4.2.0' + - ruby: 2.4 + rails_version: '~> 5.0.0' + - ruby: 2.5 + rails_version: '~> 5.1.0' + + continue-on-error: ${{ matrix.rails_version == 'edge' || endsWith(matrix.ruby, 'head') }} + + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + env: + RAILS_VERSION: ${{ matrix.rails_version }} + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Run tests + env: + RAILS_VERSION: ${{ matrix.rails_version }} + run: bundle exec rspec + - name: Coveralls Parallel + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + flag-name: run-${{ matrix.ruby }}-${{ matrix.rails_version }} + parallel: true + + finish: + needs: test + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + parallel-finished: true diff --git a/Gemfile b/Gemfile index 0c349d188..c9a41ec1f 100644 --- a/Gemfile +++ b/Gemfile @@ -40,10 +40,10 @@ group :test do gem 'activerecord', (ENV['RAILS_VERSION'] || ['>= 3.0', '< 5.3']) end - gem 'coveralls', :require => false gem 'rspec', '>= 3' gem 'rubocop', '>= 0.25', '< 0.49' - gem 'simplecov', '>= 0.9' + gem 'simplecov', '>= 0.20.0', :require => false + gem 'simplecov-lcov', '>= 0.8.0', :require => false end gemspec diff --git a/spec/helper.rb b/spec/helper.rb index d07b28607..e3d528d1a 100644 --- a/spec/helper.rb +++ b/spec/helper.rb @@ -1,13 +1,19 @@ require 'simplecov' -require 'coveralls' +require 'simplecov-lcov' -SimpleCov.formatters = [SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter] +SimpleCov::Formatter::LcovFormatter.config do |c| + c.report_with_single_file = true + c.single_report_path = 'coverage/lcov.info' +end +SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new( + [ + SimpleCov::Formatter::HTMLFormatter, + SimpleCov::Formatter::LcovFormatter + ] +) SimpleCov.start do add_filter '/spec/' - # Each version of ruby and version of rails test different things - # This should probably just be removed. - minimum_coverage(85.0) end require 'logger' From 80aa67a2eaf91c318d539ac7552a35e2e5541b85 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 8 Dec 2020 16:54:19 -0500 Subject: [PATCH 08/63] Add rubocop Github Action --- .github/workflows/rubocop.yml | 30 ++++++++++++++++++++++++++++++ Gemfile | 5 ++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/rubocop.yml diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml new file mode 100644 index 000000000..739473987 --- /dev/null +++ b/.github/workflows/rubocop.yml @@ -0,0 +1,30 @@ +name: RuboCop + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby 2.7 + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + - name: Generate lockfile for cache key + run: bundle lock + - name: Cache gems + uses: actions/cache@v1 + with: + path: vendor/bundle + key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-rubocop- + - name: Install gems + run: | + bundle config path vendor/bundle + bundle config set without 'default test' + bundle install --jobs 4 --retry 3 + - name: Run RuboCop + run: bundle exec rubocop diff --git a/Gemfile b/Gemfile index c9a41ec1f..cd4e86fae 100644 --- a/Gemfile +++ b/Gemfile @@ -41,9 +41,12 @@ group :test do end gem 'rspec', '>= 3' - gem 'rubocop', '>= 0.25', '< 0.49' gem 'simplecov', '>= 0.20.0', :require => false gem 'simplecov-lcov', '>= 0.8.0', :require => false end +group :rubocop do + gem 'rubocop', '>= 0.25', '< 0.49' +end + gemspec From 8ad44ac4b910c9855997bc5fe473ee3c8bb4e08d Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 8 Dec 2020 16:54:50 -0500 Subject: [PATCH 09/63] Remove Travis CI --- .travis.yml | 62 ----------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3ebb7baf2..000000000 --- a/.travis.yml +++ /dev/null @@ -1,62 +0,0 @@ -language: ruby -branches: - only: - - master -env: - global: - - JRUBY_OPTS="$JRUBY_OPTS --debug" - matrix: - - RAILS_VERSION="~> 4.2.0" - - RAILS_VERSION="~> 5.1.0" - - RAILS_VERSION="~> 5.2.0" - - RAILS_VERSION="~> 6.0.0" - - RAILS_VERSION="edge" -rvm: - - 2.3.8 - - 2.4.5 - - 2.5.3 - - 2.6.1 - - jruby-9.2.7.0 - - jruby-head - - ruby-head -jdk: oraclejdk11 -matrix: - allow_failures: - - rvm: jruby-head - - rvm: ruby-head - - env: RAILS_VERSION="edge" - - rvm: jruby-9.2.7.0 - env: RAILS_VERSION="~> 5.1.0" - - rvm: jruby-9.2.7.0 - env: RAILS_VERSION="~> 5.2.0" - fast_finish: true - # legacy testing - # things still run and we don't have a good reason to break it - # but we don't need to keep running the full matrix - include: - - rvm: 2.3.8 - env: RAILS_VERSION="~> 3.0.0" - - rvm: 2.3.8 - env: RAILS_VERSION="~> 3.1.0" - - rvm: 2.3.8 - env: RAILS_VERSION="~> 3.2.0" - - rvm: 2.3.8 - env: RAILS_VERSION="~> 4.0.0" - - rvm: 2.3.8 - env: RAILS_VERSION="~> 4.1.0" - - rvm: 2.1.10 - env: RAILS_VERSION="~> 4.2.0" - - rvm: 2.2.10 - env: RAILS_VERSION="~> 4.2.0" - - rvm: 2.4.4 - env: RAILS_VERSION="~> 5.0.0" - exclude: - - rvm: 2.3.8 - env: RAILS_VERSION="~> 6.0.0" - - rvm: 2.4.5 - env: RAILS_VERSION="~> 6.0.0" - - rvm: 2.3.8 - env: RAILS_VERSION="edge" - - rvm: 2.4.5 - env: RAILS_VERSION="edge" -sudo: false From 0ca7b4a62d76fa9c13b6f61ad4db2f3dbb6a2ec0 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 8 Dec 2020 17:12:27 -0500 Subject: [PATCH 10/63] Fix simplecov issue --- Gemfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index cd4e86fae..5f70351a3 100644 --- a/Gemfile +++ b/Gemfile @@ -41,8 +41,13 @@ group :test do end gem 'rspec', '>= 3' - gem 'simplecov', '>= 0.20.0', :require => false - gem 'simplecov-lcov', '>= 0.8.0', :require => false + gem 'simplecov', :require => false + if /\A2.[12]/ =~ RUBY_VERSION + # 0.8.0 doesn't work with simplecov < 0.18.0 and older ruby can't run 0.18.0 + gem 'simplecov-lcov', '< 0.8.0', :require => false + else + gem 'simplecov-lcov', :require => false + end end group :rubocop do From 1a8f49cbea932b8a01f337ce7f7ad420056a1223 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 8 Dec 2020 17:25:47 -0500 Subject: [PATCH 11/63] Tweak version handling for cleaner display --- .github/workflows/ci.yml | 14 +++++++------- Gemfile | 15 ++++++++++----- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7fd338afe..2d9394839 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,8 +14,8 @@ jobs: matrix: ruby: [2.5, 2.6, 2.7, jruby, jruby-head, ruby-head] rails_version: - - '~> 5.2.0' - - '~> 6.0.0' + - '5.2.0' + - '6.0.0' - 'edge' include: # @@ -23,15 +23,15 @@ jobs: # # EOL Active Record - ruby: 2.2 - rails_version: '~> 3.2.0' + rails_version: '3.2.0' - ruby: 2.1 - rails_version: '~> 4.1.0' + rails_version: '4.1.0' - ruby: 2.4 - rails_version: '~> 4.2.0' + rails_version: '4.2.0' - ruby: 2.4 - rails_version: '~> 5.0.0' + rails_version: '5.0.0' - ruby: 2.5 - rails_version: '~> 5.1.0' + rails_version: '5.1.0' continue-on-error: ${{ matrix.rails_version == 'edge' || endsWith(matrix.ruby, 'head') }} diff --git a/Gemfile b/Gemfile index 5f70351a3..e88e39671 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ gem 'rake' platforms :ruby do # Rails 5.1 is the first to work with sqlite 1.4 # Rails 6 now requires sqlite 1.4 - if ENV['RAILS_VERSION'] && ENV['RAILS_VERSION'].split.last < '5.1' + if ENV['RAILS_VERSION'] && ENV['RAILS_VERSION'] < '5.1' gem 'sqlite3', '< 1.4' else gem 'sqlite3' @@ -13,7 +13,7 @@ platforms :ruby do end platforms :jruby do - if ENV['RAILS_VERSION'] == '~> 4.2.0' + if ENV['RAILS_VERSION'] == '4.2.0' gem 'activerecord-jdbcsqlite3-adapter', '< 50.0' else gem 'activerecord-jdbcsqlite3-adapter' @@ -22,8 +22,10 @@ platforms :jruby do gem 'mime-types', ['~> 2.6', '< 2.99'] if ENV['RAILS_VERSION'] == 'edge' gem 'railties', :github => 'rails/rails' + elsif ENV['RAILS_VERSION'] + gem 'railties', "~> #{ENV['RAILS_VERSION']}" else - gem 'railties', (ENV['RAILS_VERSION'] || ['>= 3.0', '< 5.3']) + gem 'railties', ['>= 3.0', '< 5.3'] end end @@ -35,9 +37,12 @@ group :test do if ENV['RAILS_VERSION'] == 'edge' gem 'actionmailer', :github => 'rails/rails' gem 'activerecord', :github => 'rails/rails' + elsif ENV['RAILS_VERSION'] + gem 'actionmailer', "~> #{ENV['RAILS_VERSION']}" + gem 'activerecord', "~> #{ENV['RAILS_VERSION']}" else - gem 'actionmailer', (ENV['RAILS_VERSION'] || ['>= 3.0', '< 5.3']) - gem 'activerecord', (ENV['RAILS_VERSION'] || ['>= 3.0', '< 5.3']) + gem 'actionmailer', ['>= 3.0', '< 5.3'] + gem 'activerecord', ['>= 3.0', '< 5.3'] end gem 'rspec', '>= 3' From 44412a57c5d5f3d941223508d6c6104a019b02a8 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Wed, 9 Dec 2020 10:19:54 -0500 Subject: [PATCH 12/63] Update build status badge --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 3bf63336e..453a904c8 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,11 @@ you're reading the documentation for the master branch. Delayed::Job ============ [![Gem Version](https://badge.fury.io/rb/delayed_job.svg)][gem] -[![Build Status](https://travis-ci.org/collectiveidea/delayed_job.svg?branch=master)][travis] +![CI](https://github.com/collectiveidea/delayed_job/workflows/CI/badge.svg) [![Code Climate](https://codeclimate.com/github/collectiveidea/delayed_job.svg)][codeclimate] [![Coverage Status](https://coveralls.io/repos/collectiveidea/delayed_job/badge.svg?branch=master)][coveralls] [gem]: https://rubygems.org/gems/delayed_job -[travis]: https://travis-ci.org/collectiveidea/delayed_job [codeclimate]: https://codeclimate.com/github/collectiveidea/delayed_job [coveralls]: https://coveralls.io/r/collectiveidea/delayed_job From 1f16417d19ce9e7dcd6566e193771cc995f10bf5 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Wed, 9 Dec 2020 11:34:37 -0500 Subject: [PATCH 13/63] Allow rails 6.1 --- .github/workflows/ci.yml | 1 + CHANGELOG.md | 4 ++++ Gemfile | 6 +++--- delayed_job.gemspec | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d9394839..1f78e0b26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ jobs: rails_version: - '5.2.0' - '6.0.0' + - '6.1.0.rc2' - 'edge' include: # diff --git a/CHANGELOG.md b/CHANGELOG.md index 48a472251..14a4a71f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +4.1.9 - not yet released +================= +* Support for Rails 6.1 + 4.1.8 - 2019-08-16 ================= * Support for Rails 6.0.0 diff --git a/Gemfile b/Gemfile index e88e39671..edeb51305 100644 --- a/Gemfile +++ b/Gemfile @@ -25,7 +25,7 @@ platforms :jruby do elsif ENV['RAILS_VERSION'] gem 'railties', "~> #{ENV['RAILS_VERSION']}" else - gem 'railties', ['>= 3.0', '< 5.3'] + gem 'railties', ['>= 3.0', '< 6.2'] end end @@ -41,8 +41,8 @@ group :test do gem 'actionmailer', "~> #{ENV['RAILS_VERSION']}" gem 'activerecord', "~> #{ENV['RAILS_VERSION']}" else - gem 'actionmailer', ['>= 3.0', '< 5.3'] - gem 'activerecord', ['>= 3.0', '< 5.3'] + gem 'actionmailer', ['>= 3.0', '< 6.2'] + gem 'activerecord', ['>= 3.0', '< 6.2'] end gem 'rspec', '>= 3' diff --git a/delayed_job.gemspec b/delayed_job.gemspec index b45c7d1cf..e40bcdcf7 100644 --- a/delayed_job.gemspec +++ b/delayed_job.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |spec| - spec.add_dependency 'activesupport', ['>= 3.0', '< 6.1'] + spec.add_dependency 'activesupport', ['>= 3.0', '< 6.2'] spec.authors = ['Brandon Keepers', 'Brian Ryckbost', 'Chris Gaffney', 'David Genord II', 'Erik Michaels-Ober', 'Matt Griffin', 'Steve Richert', 'Tobias Lütke'] spec.description = 'Delayed_job (or DJ) encapsulates the common pattern of asynchronously executing longer tasks in the background. It is a direct extraction from Shopify where the job table is responsible for a multitude of core tasks.' spec.email = ['brian@collectiveidea.com'] From 2b064f78b9bb78096a5d25e980d9cc2f2cbe609b Mon Sep 17 00:00:00 2001 From: David Genord II Date: Wed, 9 Dec 2020 11:48:31 -0500 Subject: [PATCH 14/63] Pull dev jdbcsqlite3 for edge and rails 6.1 We can remove the rails 6.1 part when 61.0 is released --- Gemfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index edeb51305..b83acb5bc 100644 --- a/Gemfile +++ b/Gemfile @@ -15,6 +15,8 @@ end platforms :jruby do if ENV['RAILS_VERSION'] == '4.2.0' gem 'activerecord-jdbcsqlite3-adapter', '< 50.0' + elsif ENV['RAILS_VERSION'] == 'edge' || ENV['RAILS_VERSION'] == '6.1.0.rc2' + gem 'activerecord-jdbcsqlite3-adapter', :github => 'jruby/activerecord-jdbc-adapter' else gem 'activerecord-jdbcsqlite3-adapter' end From baed6e813870e1144e7a4291bc71e06a67a533de Mon Sep 17 00:00:00 2001 From: David Genord II Date: Wed, 9 Dec 2020 15:17:46 -0500 Subject: [PATCH 15/63] Prepare 4.1.9 release --- CHANGELOG.md | 17 +++++++++-------- README.md | 4 ++-- delayed_job.gemspec | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14a4a71f7..51e2dcf0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,33 +1,34 @@ -4.1.9 - not yet released -================= +4.1.9 - 2020-12-09 +================== * Support for Rails 6.1 +* Add support for parameterized mailers via delay call (#1121) 4.1.8 - 2019-08-16 -================= +================== * Support for Rails 6.0.0 4.1.7 - 2019-06-20 -================= +================== * Fix loading Delayed::PerformableMailer when ActionMailer isn't loaded yet 4.1.6 - 2019-06-19 -================= +================== * Properly initialize ActionMailer outside railties (#1077) * Fix Psych load_tags support (#1093) * Replace REMOVED with FAILED in log message (#1048) * Misc doc updates (#1052, #1074, #1064, #1063) 4.1.5 - 2018-04-13 -================= +================== * Allow Rails 5.2 4.1.4 - 2017-12-29 -================= +================== * Use `yaml_tag` instead of deprecated `yaml_as` (#996) * Support ruby 2.5.0 4.1.3 - 2017-05-26 -================= +================== * Don't mutate the options hash (#877) * Log an error message when a deserialization error occurs (#894) * Adding the queue name to the log output (#917) diff --git a/README.md b/README.md index ded92378c..29ad10782 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ **If you're viewing this at https://github.com/collectiveidea/delayed_job, you're reading the documentation for the master branch. [View documentation for the latest release -(4.1.8).](https://github.com/collectiveidea/delayed_job/tree/v4.1.8)** +(4.1.9).](https://github.com/collectiveidea/delayed_job/tree/v4.1.9)** Delayed::Job ============ @@ -182,7 +182,7 @@ Notifier.delay.signup(@user) # delayed_job running at a specific time Notifier.delay(run_at: 5.minutes.from_now).signup(@user) -# when using parameters, the .with method must be called before the .delay method +# when using parameters, the .with method must be called before the .delay method Notifier.with(foo: 1, bar: 2).delay.signup(@user) ``` diff --git a/delayed_job.gemspec b/delayed_job.gemspec index 047125511..c9b60a781 100644 --- a/delayed_job.gemspec +++ b/delayed_job.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.summary = 'Database-backed asynchronous priority queue system -- Extracted from Shopify' spec.test_files = Dir.glob('spec/**/*') - spec.version = '4.1.8' + spec.version = '4.1.9' spec.metadata = { 'changelog_uri' => 'https://github.com/collectiveidea/delayed_job/blob/master/CHANGELOG.md', 'bug_tracker_uri' => 'https://github.com/collectiveidea/delayed_job/issues', From d6bc5cc1eb5ec7984443e852b299d8f110dea4d0 Mon Sep 17 00:00:00 2001 From: willnet Date: Mon, 11 Oct 2021 16:27:11 +0900 Subject: [PATCH 16/63] Add Rails7 support --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++---- Gemfile | 18 +++++++++++++----- delayed_job.gemspec | 2 +- 3 files changed, 40 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f78e0b26..29bcb0f80 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,13 +12,23 @@ jobs: strategy: fail-fast: false matrix: - ruby: [2.5, 2.6, 2.7, jruby, jruby-head, ruby-head] + ruby: [2.7, 3.0, ruby-head] rails_version: - - '5.2.0' - - '6.0.0' - - '6.1.0.rc2' + - '7.0.0.alpha2' - 'edge' include: + - ruby: 2.5 + rails_version: '6.1.0' + - ruby: 2.6 + rails_version: '6.1.0' + - ruby: 2.7 + rails_version: '6.1.0' + - ruby: 3.0 + rails_version: '6.1.0' + - ruby: jruby + rails_version: '6.1.0' + - ruby: jruby-head + rails_version: '6.1.0' # # The past # @@ -33,6 +43,18 @@ jobs: rails_version: '5.0.0' - ruby: 2.5 rails_version: '5.1.0' + - ruby: 2.5 + rails_version: '5.2.0' + - ruby: 2.5 + rails_version: '6.0.0' + - ruby: 2.6 + rails_version: '6.0.0' + - ruby: 2.7 + rails_version: '6.0.0' + - ruby: jruby + rails_version: '6.0.0' + - ruby: jruby-head + rails_version: '6.0.0' continue-on-error: ${{ matrix.rails_version == 'edge' || endsWith(matrix.ruby, 'head') }} diff --git a/Gemfile b/Gemfile index b83acb5bc..85d91dc3f 100644 --- a/Gemfile +++ b/Gemfile @@ -15,8 +15,16 @@ end platforms :jruby do if ENV['RAILS_VERSION'] == '4.2.0' gem 'activerecord-jdbcsqlite3-adapter', '< 50.0' - elsif ENV['RAILS_VERSION'] == 'edge' || ENV['RAILS_VERSION'] == '6.1.0.rc2' - gem 'activerecord-jdbcsqlite3-adapter', :github => 'jruby/activerecord-jdbc-adapter' + elsif ENV['RAILS_VERSION'] == '5.0.0' + gem 'activerecord-jdbcsqlite3-adapter', '~> 50.0' + elsif ENV['RAILS_VERSION'] == '5.1.0' + gem 'activerecord-jdbcsqlite3-adapter', '~> 51.0' + elsif ENV['RAILS_VERSION'] == '5.2.0' + gem 'activerecord-jdbcsqlite3-adapter', '~> 52.0' + elsif ENV['RAILS_VERSION'] == '6.0.0' + gem 'activerecord-jdbcsqlite3-adapter', '~> 60.0' + elsif ENV['RAILS_VERSION'] == '6.1.0' + gem 'activerecord-jdbcsqlite3-adapter', '~> 61.0' else gem 'activerecord-jdbcsqlite3-adapter' end @@ -27,7 +35,7 @@ platforms :jruby do elsif ENV['RAILS_VERSION'] gem 'railties', "~> #{ENV['RAILS_VERSION']}" else - gem 'railties', ['>= 3.0', '< 6.2'] + gem 'railties', ['>= 3.0', '< 7.0'] end end @@ -43,8 +51,8 @@ group :test do gem 'actionmailer', "~> #{ENV['RAILS_VERSION']}" gem 'activerecord', "~> #{ENV['RAILS_VERSION']}" else - gem 'actionmailer', ['>= 3.0', '< 6.2'] - gem 'activerecord', ['>= 3.0', '< 6.2'] + gem 'actionmailer', ['>= 3.0', '< 7.1'] + gem 'activerecord', ['>= 3.0', '< 7.1'] end gem 'rspec', '>= 3' diff --git a/delayed_job.gemspec b/delayed_job.gemspec index c9b60a781..23eec33e6 100644 --- a/delayed_job.gemspec +++ b/delayed_job.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |spec| - spec.add_dependency 'activesupport', ['>= 3.0', '< 6.2'] + spec.add_dependency 'activesupport', ['>= 3.0', '< 7.1'] spec.authors = ['Brandon Keepers', 'Brian Ryckbost', 'Chris Gaffney', 'David Genord II', 'Erik Michaels-Ober', 'Matt Griffin', 'Steve Richert', 'Tobias Lütke'] spec.description = 'Delayed_job (or DJ) encapsulates the common pattern of asynchronously executing longer tasks in the background. It is a direct extraction from Shopify where the job table is responsible for a multitude of core tasks.' spec.email = ['brian@collectiveidea.com'] From 9bd70707c388aea23394bb8dc7fbf2bea0750983 Mon Sep 17 00:00:00 2001 From: willnet Date: Mon, 11 Oct 2021 16:42:11 +0900 Subject: [PATCH 17/63] net/smtp isn't bundled by default from Ruby 3.1 ref: https://bugs.ruby-lang.org/issues/17873 --- Gemfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index 85d91dc3f..c309de164 100644 --- a/Gemfile +++ b/Gemfile @@ -10,6 +10,8 @@ platforms :ruby do else gem 'sqlite3' end + + gem 'net/smtp' if ENV['RAILS_VERSION'] == 'ruby-head' end platforms :jruby do From 56ae06889814c7619a68d7110c96cd6c06ed7f5a Mon Sep 17 00:00:00 2001 From: willnet Date: Mon, 11 Oct 2021 17:41:59 +0900 Subject: [PATCH 18/63] Split jruby version with 9.2.x and 9.3.x jruby 9.3 seems not to work with rails --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29bcb0f80..00fdfcd69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,9 @@ jobs: rails_version: '6.1.0' - ruby: 3.0 rails_version: '6.1.0' - - ruby: jruby + - ruby: jruby-9.2 + rails_version: '6.1.0' + - ruby: jruby-9.3 rails_version: '6.1.0' - ruby: jruby-head rails_version: '6.1.0' @@ -51,7 +53,9 @@ jobs: rails_version: '6.0.0' - ruby: 2.7 rails_version: '6.0.0' - - ruby: jruby + - ruby: jruby-9.2 + rails_version: '6.0.0' + - ruby: jruby-9.3 rails_version: '6.0.0' - ruby: jruby-head rails_version: '6.0.0' From 069b642b01d904ff136ef46fbf9eb3d319932a47 Mon Sep 17 00:00:00 2001 From: willnet Date: Mon, 18 Oct 2021 17:14:54 +0900 Subject: [PATCH 19/63] Add railties to use zeitwerk specs about autoload needs zeitwerk which raitlies depends on ref https://github.com/willnet/delayed_job/runs/3856963931?check_suite_focus=true --- Gemfile | 5 ++++- spec/delayed/command_spec.rb | 18 ++++++++++-------- spec/helper.rb | 12 ++++-------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Gemfile b/Gemfile index c309de164..28fe440bb 100644 --- a/Gemfile +++ b/Gemfile @@ -37,7 +37,7 @@ platforms :jruby do elsif ENV['RAILS_VERSION'] gem 'railties', "~> #{ENV['RAILS_VERSION']}" else - gem 'railties', ['>= 3.0', '< 7.0'] + gem 'railties', ['>= 3.0', '< 7.1'] end end @@ -49,12 +49,15 @@ group :test do if ENV['RAILS_VERSION'] == 'edge' gem 'actionmailer', :github => 'rails/rails' gem 'activerecord', :github => 'rails/rails' + gem 'railties', :github => 'rails/rails' elsif ENV['RAILS_VERSION'] gem 'actionmailer', "~> #{ENV['RAILS_VERSION']}" gem 'activerecord', "~> #{ENV['RAILS_VERSION']}" + gem 'railties', "~> #{ENV['RAILS_VERSION']}" else gem 'actionmailer', ['>= 3.0', '< 7.1'] gem 'activerecord', ['>= 3.0', '< 7.1'] + gem 'railties', ['>= 3.0', '< 7.1'] end gem 'rspec', '>= 3' diff --git a/spec/delayed/command_spec.rb b/spec/delayed/command_spec.rb index b57cd6efa..9ac6e0862 100644 --- a/spec/delayed/command_spec.rb +++ b/spec/delayed/command_spec.rb @@ -159,16 +159,18 @@ describe 'running worker pools defined by multiple --pool arguments' do it 'should run the correct worker processes' do command = Delayed::Command.new(['--pool=*:1', '--pool=test_queue:4', '--pool=mailers,misc:2']) - expect(FileUtils).to receive(:mkdir_p).with('./tmp/pids').once + pid_dir = File.expand_path('./tmp/pids') + log_dir = File.expand_path('./log') + expect(FileUtils).to receive(:mkdir_p).with(pid_dir).once [ - ['delayed_job.0', {:quiet => true, :pid_dir => './tmp/pids', :log_dir => './log', :queues => []}], - ['delayed_job.1', {:quiet => true, :pid_dir => './tmp/pids', :log_dir => './log', :queues => ['test_queue']}], - ['delayed_job.2', {:quiet => true, :pid_dir => './tmp/pids', :log_dir => './log', :queues => ['test_queue']}], - ['delayed_job.3', {:quiet => true, :pid_dir => './tmp/pids', :log_dir => './log', :queues => ['test_queue']}], - ['delayed_job.4', {:quiet => true, :pid_dir => './tmp/pids', :log_dir => './log', :queues => ['test_queue']}], - ['delayed_job.5', {:quiet => true, :pid_dir => './tmp/pids', :log_dir => './log', :queues => %w[mailers misc]}], - ['delayed_job.6', {:quiet => true, :pid_dir => './tmp/pids', :log_dir => './log', :queues => %w[mailers misc]}] + ['delayed_job.0', {:quiet => true, :pid_dir => pid_dir, :log_dir => log_dir, :queues => []}], + ['delayed_job.1', {:quiet => true, :pid_dir => pid_dir, :log_dir => log_dir, :queues => ['test_queue']}], + ['delayed_job.2', {:quiet => true, :pid_dir => pid_dir, :log_dir => log_dir, :queues => ['test_queue']}], + ['delayed_job.3', {:quiet => true, :pid_dir => pid_dir, :log_dir => log_dir, :queues => ['test_queue']}], + ['delayed_job.4', {:quiet => true, :pid_dir => pid_dir, :log_dir => log_dir, :queues => ['test_queue']}], + ['delayed_job.5', {:quiet => true, :pid_dir => pid_dir, :log_dir => log_dir, :queues => %w[mailers misc]}], + ['delayed_job.6', {:quiet => true, :pid_dir => pid_dir, :log_dir => log_dir, :queues => %w[mailers misc]}] ].each do |args| expect(command).to receive(:run_process).with(*args).once end diff --git a/spec/helper.rb b/spec/helper.rb index e3d528d1a..b39b6d8bf 100644 --- a/spec/helper.rb +++ b/spec/helper.rb @@ -21,6 +21,7 @@ require 'action_mailer' require 'active_record' +require 'rails' require 'delayed_job' require 'delayed/backend/shared_spec' @@ -36,14 +37,7 @@ end ENV['RAILS_ENV'] = 'test' -# Trigger AR to initialize -ActiveRecord::Base # rubocop:disable Void - -module Rails - def self.root - '.' - end -end +FakeApp = Class.new(Rails::Application) Delayed::Worker.backend = :test @@ -76,6 +70,8 @@ def whatever(n, _) handle_asynchronously :whatever end +FakeApp.initialize! + RSpec.configure do |config| config.after(:each) do Delayed::Worker.reset From 7246e56baa58d7f6e92981b58364779bbc84ca22 Mon Sep 17 00:00:00 2001 From: willnet Date: Mon, 18 Oct 2021 17:59:21 +0900 Subject: [PATCH 20/63] net/smtp isn't bundled with Ruby from 3.1.0-dev --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 28fe440bb..7174a2f63 100644 --- a/Gemfile +++ b/Gemfile @@ -59,7 +59,7 @@ group :test do gem 'activerecord', ['>= 3.0', '< 7.1'] gem 'railties', ['>= 3.0', '< 7.1'] end - + gem 'net-smtp' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0-dev') gem 'rspec', '>= 3' gem 'simplecov', :require => false if /\A2.[12]/ =~ RUBY_VERSION From 587f501fedf59c7331052e27d88cf70bdbde0eb0 Mon Sep 17 00:00:00 2001 From: willnet Date: Mon, 25 Oct 2021 17:17:22 +0900 Subject: [PATCH 21/63] Fix a warning from rails ``` config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly: * development - set it to false * test - set it to false (unless you use a tool that preloads your test environment) * production - set it to true ```` --- spec/helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/helper.rb b/spec/helper.rb index b39b6d8bf..f93219e48 100644 --- a/spec/helper.rb +++ b/spec/helper.rb @@ -38,6 +38,7 @@ ENV['RAILS_ENV'] = 'test' FakeApp = Class.new(Rails::Application) +FakeApp.config.eager_load = false Delayed::Worker.backend = :test From 80864629c1cd452a8eafa85e2ad69d6285f37c33 Mon Sep 17 00:00:00 2001 From: willnet Date: Mon, 25 Oct 2021 17:22:54 +0900 Subject: [PATCH 22/63] Fix a broken spec due to Psych >= 4 Since psych4.0, the load method has been safe_load, which causes the following error: YAML#load_dj retains the existing safeYAML support, but uses the version of psych that implements unsafe_load. In YAML#load_dj ``` 1) YAML autoloads the class of an anonymous struct Failure/Error: expect do yaml = "--- !ruby/struct\nn: 1\n" object = YAML.load(yaml) expect(object).to be_kind_of(Struct) expect(object.n).to eq(1) end.not_to raise_error expected no Exception, got # with backtrace: # (eval):2:in `struct' # ./spec/yaml_ext_spec.rb:28:in `block (3 levels) in ' # ./spec/yaml_ext_spec.rb:26:in `block (2 levels) in ' # ./spec/yaml_ext_spec.rb:26:in `block (2 levels) in ' ``` --- lib/delayed/syck_ext.rb | 8 ++++++-- spec/yaml_ext_spec.rb | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/delayed/syck_ext.rb b/lib/delayed/syck_ext.rb index c7cb8154a..52c310b63 100644 --- a/lib/delayed/syck_ext.rb +++ b/lib/delayed/syck_ext.rb @@ -36,7 +36,11 @@ def self.yaml_tag_read_class(name) module YAML def load_dj(yaml) # See https://github.com/dtao/safe_yaml - # When the method is there, we need to load our YAML like this... - respond_to?(:unsafe_load) ? load(yaml, :safe => false) : load(yaml) + # When the module is there, we need to load our YAML like this... + if Object.const_defined?(:SafeYAML) + load(yaml, :safe => false) + elsif respond_to?(:unsafe_load) # psych >= 3.3.2 + unsafe_load(yaml) + end end end diff --git a/spec/yaml_ext_spec.rb b/spec/yaml_ext_spec.rb index aebb9afce..83bceea35 100644 --- a/spec/yaml_ext_spec.rb +++ b/spec/yaml_ext_spec.rb @@ -25,7 +25,7 @@ it 'autoloads the class of an anonymous struct' do expect do yaml = "--- !ruby/struct\nn: 1\n" - object = YAML.load(yaml) + object = load_with_delayed_visitor(yaml) expect(object).to be_kind_of(Struct) expect(object.n).to eq(1) end.not_to raise_error From da97d704293369a69b1df528f3aa3413adcf04ab Mon Sep 17 00:00:00 2001 From: willnet Date: Mon, 25 Oct 2021 17:41:17 +0900 Subject: [PATCH 23/63] Fix a dependency error on ruby-head net-smtp 0.3.0 dependents digest 3.0.0, but edge ruby activates 3.1.0.pre2. The error was avoided by explicitly specifying the version in the Gemfile. ``` bundler: failed to load command: rspec (/home/runner/work/delayed_job/delayed_job/vendor/bundle/ruby/3.1.0/bin/rspec) /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/runtime.rb:309:in `check_for_activated_spec!': You have already activated digest 3.1.0.pre2, but your Gemfile requires digest 3.0.0. Since digest is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports digest as a default gem. (Gem::LoadError) from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/runtime.rb:25:in `block in setup' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/spec_set.rb:136:in `each' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/spec_set.rb:136:in `each' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/runtime.rb:24:in `map' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/runtime.rb:24:in `setup' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler.rb:149:in `setup' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/setup.rb:20:in `block in ' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/ui/shell.rb:136:in `with_level' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/ui/shell.rb:88:in `silence' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/setup.rb:20:in `' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/cli/exec.rb:56:in `require_relative' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/cli/exec.rb:56:in `kernel_load' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/cli/exec.rb:23:in `run' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/cli.rb:478:in `exec' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/cli.rb:31:in `dispatch' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/cli.rb:25:in `start' from /home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/bundler-2.3.0.dev/libexec/bundle:49:in `block in ' from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/friendly_errors.rb:128:in `with_friendly_errors' from /home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/bundler-2.3.0.dev/libexec/bundle:37:in `' from /home/runner/.rubies/ruby-head/bin/bundle:23:in `load' from /home/runner/.rubies/ruby-head/bin/bundle:23:in `
' ``` --- Gemfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 7174a2f63..d8595c005 100644 --- a/Gemfile +++ b/Gemfile @@ -59,7 +59,10 @@ group :test do gem 'activerecord', ['>= 3.0', '< 7.1'] gem 'railties', ['>= 3.0', '< 7.1'] end - gem 'net-smtp' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0-dev') + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0-dev') + gem 'digest', '>= 3.1.0.pre2' + gem 'net-smtp' + end gem 'rspec', '>= 3' gem 'simplecov', :require => false if /\A2.[12]/ =~ RUBY_VERSION From 7a63bc1e2ce0543a3e6319313996805df34734c9 Mon Sep 17 00:00:00 2001 From: willnet Date: Mon, 13 Dec 2021 17:13:49 +0900 Subject: [PATCH 24/63] Bump rails from 7.0.0.alpha2 to 7.0.0.rc1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00fdfcd69..a235ef0c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: matrix: ruby: [2.7, 3.0, ruby-head] rails_version: - - '7.0.0.alpha2' + - '7.0.0.rc1' - 'edge' include: - ruby: 2.5 From 5accab438177e4b02a29477a49cc2f96f1806194 Mon Sep 17 00:00:00 2001 From: willnet Date: Mon, 20 Dec 2021 16:58:11 +0900 Subject: [PATCH 25/63] Bump rails from 7.0.0.rc1 to 7.0.0 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a235ef0c9..538d41990 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: matrix: ruby: [2.7, 3.0, ruby-head] rails_version: - - '7.0.0.rc1' + - '7.0.0' - 'edge' include: - ruby: 2.5 From aedbbd1b2c5fae22d07aad83e0984fc0b1b38504 Mon Sep 17 00:00:00 2001 From: willnet Date: Mon, 27 Dec 2021 17:16:08 +0900 Subject: [PATCH 26/63] Ruby 3.1 released we don't have to add digest gem explicitly. --- .github/workflows/ci.yml | 2 +- Gemfile | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 538d41990..a9a7046c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [2.7, 3.0, ruby-head] + ruby: [2.7, 3.0, 3.1, ruby-head] rails_version: - '7.0.0' - 'edge' diff --git a/Gemfile b/Gemfile index d8595c005..e194953d3 100644 --- a/Gemfile +++ b/Gemfile @@ -59,10 +59,7 @@ group :test do gem 'activerecord', ['>= 3.0', '< 7.1'] gem 'railties', ['>= 3.0', '< 7.1'] end - if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0-dev') - gem 'digest', '>= 3.1.0.pre2' - gem 'net-smtp' - end + gem 'net-smtp' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0') gem 'rspec', '>= 3' gem 'simplecov', :require => false if /\A2.[12]/ =~ RUBY_VERSION From 6861d2b16be1ac592ca34f2696fd5af9b7ba5e8c Mon Sep 17 00:00:00 2001 From: willnet Date: Mon, 27 Dec 2021 17:18:38 +0900 Subject: [PATCH 27/63] Remove useless gem dependency --- Gemfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Gemfile b/Gemfile index e194953d3..3884b7cb1 100644 --- a/Gemfile +++ b/Gemfile @@ -10,8 +10,6 @@ platforms :ruby do else gem 'sqlite3' end - - gem 'net/smtp' if ENV['RAILS_VERSION'] == 'ruby-head' end platforms :jruby do From 562a46064fc6e7a765acf8b76c7aa2c7936ecaac Mon Sep 17 00:00:00 2001 From: willnet Date: Mon, 27 Dec 2021 18:01:31 +0900 Subject: [PATCH 28/63] syck has nothing to do with the pych 4.0 --- lib/delayed/syck_ext.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/delayed/syck_ext.rb b/lib/delayed/syck_ext.rb index 52c310b63..df04842d6 100644 --- a/lib/delayed/syck_ext.rb +++ b/lib/delayed/syck_ext.rb @@ -37,10 +37,6 @@ module YAML def load_dj(yaml) # See https://github.com/dtao/safe_yaml # When the module is there, we need to load our YAML like this... - if Object.const_defined?(:SafeYAML) - load(yaml, :safe => false) - elsif respond_to?(:unsafe_load) # psych >= 3.3.2 - unsafe_load(yaml) - end + respond_to?(:unsafe_load) ? load(yaml, :safe => false) : load(yaml) end end From 8a4ad455e1f170173f9497d52127e39b25ffdce8 Mon Sep 17 00:00:00 2001 From: willnet Date: Mon, 17 Jan 2022 16:50:15 +0900 Subject: [PATCH 29/63] Use Rails 7.0.1 instead of 7.0.0 on CI Rails 7.0.0 doesn't work with Ruby 3.1. ref: https://github.com/rails/rails/pull/43951 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9a7046c5..98d4f8459 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: matrix: ruby: [2.7, 3.0, 3.1, ruby-head] rails_version: - - '7.0.0' + - '7.0.1' - 'edge' include: - ruby: 2.5 From 462288be2fafd25a48b57d3a6d4fe92de600e857 Mon Sep 17 00:00:00 2001 From: willnet Date: Mon, 17 Jan 2022 16:56:24 +0900 Subject: [PATCH 30/63] Enclose every ruby version in quotations If we use Ruby 3.0 without quotations in YAML, It is interpreted as "3". If you specify 3 on GitHub Actions, it means the latest stable version of the 3 series, so 3.1 will be used. --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98d4f8459..12e65a525 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,18 +12,18 @@ jobs: strategy: fail-fast: false matrix: - ruby: [2.7, 3.0, 3.1, ruby-head] + ruby: ['2.7', '3.0', '3.1', 'ruby-head'] rails_version: - '7.0.1' - 'edge' include: - - ruby: 2.5 + - ruby: '2.5' rails_version: '6.1.0' - - ruby: 2.6 + - ruby: '2.6' rails_version: '6.1.0' - - ruby: 2.7 + - ruby: '2.7' rails_version: '6.1.0' - - ruby: 3.0 + - ruby: '3.0' rails_version: '6.1.0' - ruby: jruby-9.2 rails_version: '6.1.0' From c58252a6f0b7367def73d4583b475c080a6b05bc Mon Sep 17 00:00:00 2001 From: willnet Date: Mon, 17 Jan 2022 17:11:22 +0900 Subject: [PATCH 31/63] Remove duplicated gem dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When using Ruby 3.0 or 3.1, GitHub Actions fails likes following. ``` --- ERROR REPORT TEMPLATE ------------------------------------------------------- ``` NoMethodError: undefined method `metadata' for nil:NilClass /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/cli/common.rb:22:in `block in output_fund_metadata_summary' /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/cli/common.rb:22:in `count' /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/cli/common.rb:22:in `output_fund_metadata_summary' /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/cli/install.rb:85:in `run' /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/cli.rb:253:in `block in install' /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/settings.rb:131:in `temporary' /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/cli.rb:252:in `install' /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run' /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command' /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch' /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/cli.rb:31:in `dispatch' /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start' /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/cli.rb:25:in `start' /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.32/libexec/bundle:49:in `block in ' /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/friendly_errors.rb:103:in `with_friendly_errors' /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.32/libexec/bundle:37:in `' /opt/hostedtoolcache/Ruby/3.0.3/x64/bin/bundle:23:in `load' /opt/hostedtoolcache/Ruby/3.0.3/x64/bin/bundle:23:in `
' ``` ## Environment ``` Bundler 2.2.32 Platforms ruby, x86_64-linux Ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc18472ec107b14234933b017a33c14d) [x86_64-linux] Full Path /opt/hostedtoolcache/Ruby/3.0.3/x64/bin/ruby Config Dir /opt/hostedtoolcache/Ruby/3.0.3/x64/etc RubyGems 3.2.32 Gem Home /home/runner/work/delayed_job/delayed_job/vendor/bundle/ruby/3.0.0 Gem Path /home/runner/work/delayed_job/delayed_job/vendor/bundle/ruby/3.0.0 User Home /home/runner User Path /home/runner/.local/share/gem/ruby/3.0.0 Bin Dir /home/runner/work/delayed_job/delayed_job/vendor/bundle/ruby/3.0.0/bin OpenSSL Compiled OpenSSL 1.1.1f 31 Mar 2020 Loaded OpenSSL 1.1.1f 31 Mar 2020 Cert File /usr/lib/ssl/cert.pem Cert Dir /usr/lib/ssl/certs Tools Git 2.34.1 RVM not installed rbenv not installed chruby not installed ``` ## Bundler Build Metadata ``` Built At 2022-01-17 Git SHA unknown Released Version false ``` ## Bundler settings ``` jobs Set for your local app (/home/runner/work/delayed_job/delayed_job/.bundle/config): 4 path Set for your local app (/home/runner/work/delayed_job/delayed_job/.bundle/config): "/home/runner/work/delayed_job/delayed_job/vendor/bundle" ``` ## Gemfile ### Gemfile ```ruby source 'https://rubygems.org' gem 'rake' platforms :ruby do # Rails 5.1 is the first to work with sqlite 1.4 # Rails 6 now requires sqlite 1.4 if ENV['RAILS_VERSION'] && ENV['RAILS_VERSION'] < '5.1' gem 'sqlite3', '< 1.4' else gem 'sqlite3' end end platforms :jruby do if ENV['RAILS_VERSION'] == '4.2.0' gem 'activerecord-jdbcsqlite3-adapter', '< 50.0' elsif ENV['RAILS_VERSION'] == '5.0.0' gem 'activerecord-jdbcsqlite3-adapter', '~> 50.0' elsif ENV['RAILS_VERSION'] == '5.1.0' gem 'activerecord-jdbcsqlite3-adapter', '~> 51.0' elsif ENV['RAILS_VERSION'] == '5.2.0' gem 'activerecord-jdbcsqlite3-adapter', '~> 52.0' elsif ENV['RAILS_VERSION'] == '6.0.0' gem 'activerecord-jdbcsqlite3-adapter', '~> 60.0' elsif ENV['RAILS_VERSION'] == '6.1.0' gem 'activerecord-jdbcsqlite3-adapter', '~> 61.0' else gem 'activerecord-jdbcsqlite3-adapter' end gem 'jruby-openssl' gem 'mime-types', ['~> 2.6', '< 2.99'] if ENV['RAILS_VERSION'] == 'edge' gem 'railties', :github => 'rails/rails' elsif ENV['RAILS_VERSION'] gem 'railties', "~> #{ENV['RAILS_VERSION']}" else gem 'railties', ['>= 3.0', '< 7.1'] end end platforms :rbx do gem 'psych' end group :test do if ENV['RAILS_VERSION'] == 'edge' gem 'actionmailer', :github => 'rails/rails' gem 'activerecord', :github => 'rails/rails' gem 'railties', :github => 'rails/rails' elsif ENV['RAILS_VERSION'] gem 'actionmailer', "~> #{ENV['RAILS_VERSION']}" gem 'activerecord', "~> #{ENV['RAILS_VERSION']}" gem 'railties', "~> #{ENV['RAILS_VERSION']}" else gem 'actionmailer', ['>= 3.0', '< 7.1'] gem 'activerecord', ['>= 3.0', '< 7.1'] gem 'railties', ['>= 3.0', '< 7.1'] end gem 'net-smtp' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0') gem 'rspec', '>= 3' gem 'simplecov', :require => false if /\A2.[12]/ =~ RUBY_VERSION # 0.8.0 doesn't work with simplecov < 0.18.0 and older ruby can't run 0.18.0 gem 'simplecov-lcov', '< 0.8.0', :require => false else gem 'simplecov-lcov', :require => false end end group :rubocop do gem 'rubocop', '>= 0.25', '< 0.49' end gemspec ``` ### Gemfile.lock ``` PATH remote: . specs: delayed_job (4.1.9) activesupport (>= 3.0, < 7.1) GEM remote: https://rubygems.org/ specs: actionmailer (7.0.1) actionpack (= 7.0.1) actionview (= 7.0.1) activejob (= 7.0.1) activesupport (= 7.0.1) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) actionpack (7.0.1) actionview (= 7.0.1) activesupport (= 7.0.1) rack (~> 2.0, >= 2.2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) actionview (7.0.1) activesupport (= 7.0.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) activejob (7.0.1) activesupport (= 7.0.1) globalid (>= 0.3.6) activemodel (7.0.1) activesupport (= 7.0.1) activerecord (7.0.1) activemodel (= 7.0.1) activesupport (= 7.0.1) activesupport (7.0.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) ast (2.4.2) builder (3.2.4) concurrent-ruby (1.1.9) crass (1.0.6) diff-lcs (1.5.0) digest (3.1.0) docile (1.4.0) erubi (1.10.0) globalid (1.0.0) activesupport (>= 5.0) i18n (1.8.11) concurrent-ruby (~> 1.0) io-wait (0.2.1) loofah (2.13.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) mini_mime (1.1.2) minitest (5.15.0) net-imap (0.2.3) digest net-protocol strscan net-pop (0.1.1) digest net-protocol timeout net-protocol (0.1.2) io-wait timeout net-smtp (0.3.1) digest net-protocol timeout nokogiri (1.13.1-x86_64-linux) racc (~> 1.4) parser (2.7.2.0) ast (~> 2.4.1) powerpack (0.1.3) psych (4.0.3) stringio racc (1.6.0) rack (2.2.3) rack-test (1.1.0) rack (>= 1.0, < 3) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.4.2) loofah (~> 2.3) rainbow (2.2.2) rake rake (13.0.6) rspec (3.10.0) rspec-core (~> 3.10.0) rspec-expectations (~> 3.10.0) rspec-mocks (~> 3.10.0) rspec-core (3.10.1) rspec-support (~> 3.10.0) rspec-expectations (3.10.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.10.0) rspec-mocks (3.10.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.10.0) rspec-support (3.10.3) rubocop (0.48.1) parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) ruby-progressbar (1.11.0) simplecov (0.21.2) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov-lcov (0.8.0) simplecov_json_formatter (0.1.3) sqlite3 (1.4.2) stringio (3.0.1) strscan (3.0.1) timeout (0.2.0) tzinfo (2.0.4) concurrent-ruby (~> 1.0) unicode-display_width (1.8.0) PLATFORMS x86_64-linux DEPENDENCIES actionmailer (~> 7.0.1) activerecord (~> 7.0.1) activerecord-jdbcsqlite3-adapter delayed_job! jruby-openssl mime-types (~> 2.6, < 2.99) psych railties (~> 7.0.1) rake rspec (>= 3) rubocop (>= 0.25, < 0.49) simplecov simplecov-lcov sqlite3 BUNDLED WITH 2.2.32 ``` ## Gemspecs ### delayed_job.gemspec ```ruby # -*- encoding: utf-8 -*- Gem::Specification.new do |spec| spec.add_dependency 'activesupport', ['>= 3.0', '< 7.1'] spec.authors = ['Brandon Keepers', 'Brian Ryckbost', 'Chris Gaffney', 'David Genord II', 'Erik Michaels-Ober', 'Matt Griffin', 'Steve Richert', 'Tobias Lütke'] spec.description = 'Delayed_job (or DJ) encapsulates the common pattern of asynchronously executing longer tasks in the background. It is a direct extraction from Shopify where the job table is responsible for a multitude of core tasks.' spec.email = ['brian@collectiveidea.com'] spec.files = %w[CHANGELOG.md CONTRIBUTING.md LICENSE.md README.md Rakefile delayed_job.gemspec] spec.files += Dir.glob('{contrib,lib,recipes,spec}/**/*') # rubocop:disable SpaceAroundOperators spec.homepage = 'http://github.com/collectiveidea/delayed_job' spec.licenses = ['MIT'] spec.name = 'delayed_job' spec.require_paths = ['lib'] spec.summary = 'Database-backed asynchronous priority queue system -- Extracted from Shopify' spec.test_files = Dir.glob('spec/**/*') spec.version = '4.1.9' spec.metadata = { 'changelog_uri' => 'https://github.com/collectiveidea/delayed_job/blob/master/CHANGELOG.md', 'bug_tracker_uri' => 'https://github.com/collectiveidea/delayed_job/issues', 'source_code_uri' => 'https://github.com/collectiveidea/delayed_job' } end ``` --- TEMPLATE END ---------------------------------------------------------------- Unfortunately, an unexpected error occurred, and Bundler cannot continue. First, try this link to see if there are any existing issue reports for this error: https://github.com/rubygems/rubygems/search?q=undefined+method+%60metadata%27+for+nil+NilClass&type=Issues If there aren't any reports for this error yet, please fill in the new issue form located at https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md, and copy and paste the report template above in there. Took 13.62 seconds Error: The process '/opt/hostedtoolcache/Ruby/3.0.3/x64/bin/bundle' failed with exit code 1 ``` --- Gemfile | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Gemfile b/Gemfile index 3884b7cb1..d0ab2521e 100644 --- a/Gemfile +++ b/Gemfile @@ -30,13 +30,6 @@ platforms :jruby do end gem 'jruby-openssl' gem 'mime-types', ['~> 2.6', '< 2.99'] - if ENV['RAILS_VERSION'] == 'edge' - gem 'railties', :github => 'rails/rails' - elsif ENV['RAILS_VERSION'] - gem 'railties', "~> #{ENV['RAILS_VERSION']}" - else - gem 'railties', ['>= 3.0', '< 7.1'] - end end platforms :rbx do From 8ac60f04bfa8188429629cf79b942f88eca5a3ba Mon Sep 17 00:00:00 2001 From: David Genord II Date: Mon, 17 Jan 2022 16:50:08 -0500 Subject: [PATCH 32/63] Bring back full matrix --- .github/workflows/ci.yml | 52 ++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12e65a525..3e451964d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,25 +12,39 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['2.7', '3.0', '3.1', 'ruby-head'] + ruby: ['2.7', '3.0', '3.1', jruby-head, ruby-head] rails_version: - - '7.0.1' + - '6.0.0' + - '6.1.0' + - '7.0.0' - 'edge' include: - - ruby: '2.5' - rails_version: '6.1.0' - - ruby: '2.6' - rails_version: '6.1.0' - - ruby: '2.7' - rails_version: '6.1.0' - - ruby: '3.0' + # 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' + - ruby: 2.6 rails_version: '6.1.0' + + # jruby-9.2 + - ruby: jruby-9.2 + rails_version: '6.0.0' - ruby: jruby-9.2 rails_version: '6.1.0' + + # jruby-9.3 - ruby: jruby-9.3 - rails_version: '6.1.0' - - ruby: jruby-head - rails_version: '6.1.0' + rails_version: '7.0.0' + - ruby: jruby-9.3 + rails_version: 'edge' + # # The past # @@ -45,20 +59,6 @@ jobs: rails_version: '5.0.0' - ruby: 2.5 rails_version: '5.1.0' - - ruby: 2.5 - rails_version: '5.2.0' - - ruby: 2.5 - rails_version: '6.0.0' - - ruby: 2.6 - rails_version: '6.0.0' - - ruby: 2.7 - rails_version: '6.0.0' - - ruby: jruby-9.2 - rails_version: '6.0.0' - - ruby: jruby-9.3 - rails_version: '6.0.0' - - ruby: jruby-head - rails_version: '6.0.0' continue-on-error: ${{ matrix.rails_version == 'edge' || endsWith(matrix.ruby, 'head') }} From bc2c588c4d02a414561cc2d51c828bbe8be40c8b Mon Sep 17 00:00:00 2001 From: David Genord II Date: Mon, 17 Jan 2022 16:52:27 -0500 Subject: [PATCH 33/63] Revert "Add railties to use zeitwerk" This reverts commit 069b642b01d904ff136ef46fbf9eb3d319932a47. Delayed Job does not require Rails so the specs should not require it. # Conflicts: # Gemfile # spec/helper.rb --- Gemfile | 11 ++++++++--- spec/delayed/command_spec.rb | 18 ++++++++---------- spec/helper.rb | 13 ++++++++----- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/Gemfile b/Gemfile index d0ab2521e..8b3d6134d 100644 --- a/Gemfile +++ b/Gemfile @@ -30,6 +30,14 @@ platforms :jruby do end gem 'jruby-openssl' gem 'mime-types', ['~> 2.6', '< 2.99'] + + if ENV['RAILS_VERSION'] == 'edge' + gem 'railties', :github => 'rails/rails' + elsif ENV['RAILS_VERSION'] + gem 'railties', "~> #{ENV['RAILS_VERSION']}" + else + gem 'railties', ['>= 3.0', '< 7.1'] + end end platforms :rbx do @@ -40,15 +48,12 @@ group :test do if ENV['RAILS_VERSION'] == 'edge' gem 'actionmailer', :github => 'rails/rails' gem 'activerecord', :github => 'rails/rails' - gem 'railties', :github => 'rails/rails' elsif ENV['RAILS_VERSION'] gem 'actionmailer', "~> #{ENV['RAILS_VERSION']}" gem 'activerecord', "~> #{ENV['RAILS_VERSION']}" - gem 'railties', "~> #{ENV['RAILS_VERSION']}" else gem 'actionmailer', ['>= 3.0', '< 7.1'] gem 'activerecord', ['>= 3.0', '< 7.1'] - gem 'railties', ['>= 3.0', '< 7.1'] end gem 'net-smtp' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0') gem 'rspec', '>= 3' diff --git a/spec/delayed/command_spec.rb b/spec/delayed/command_spec.rb index 9ac6e0862..b57cd6efa 100644 --- a/spec/delayed/command_spec.rb +++ b/spec/delayed/command_spec.rb @@ -159,18 +159,16 @@ describe 'running worker pools defined by multiple --pool arguments' do it 'should run the correct worker processes' do command = Delayed::Command.new(['--pool=*:1', '--pool=test_queue:4', '--pool=mailers,misc:2']) - pid_dir = File.expand_path('./tmp/pids') - log_dir = File.expand_path('./log') - expect(FileUtils).to receive(:mkdir_p).with(pid_dir).once + expect(FileUtils).to receive(:mkdir_p).with('./tmp/pids').once [ - ['delayed_job.0', {:quiet => true, :pid_dir => pid_dir, :log_dir => log_dir, :queues => []}], - ['delayed_job.1', {:quiet => true, :pid_dir => pid_dir, :log_dir => log_dir, :queues => ['test_queue']}], - ['delayed_job.2', {:quiet => true, :pid_dir => pid_dir, :log_dir => log_dir, :queues => ['test_queue']}], - ['delayed_job.3', {:quiet => true, :pid_dir => pid_dir, :log_dir => log_dir, :queues => ['test_queue']}], - ['delayed_job.4', {:quiet => true, :pid_dir => pid_dir, :log_dir => log_dir, :queues => ['test_queue']}], - ['delayed_job.5', {:quiet => true, :pid_dir => pid_dir, :log_dir => log_dir, :queues => %w[mailers misc]}], - ['delayed_job.6', {:quiet => true, :pid_dir => pid_dir, :log_dir => log_dir, :queues => %w[mailers misc]}] + ['delayed_job.0', {:quiet => true, :pid_dir => './tmp/pids', :log_dir => './log', :queues => []}], + ['delayed_job.1', {:quiet => true, :pid_dir => './tmp/pids', :log_dir => './log', :queues => ['test_queue']}], + ['delayed_job.2', {:quiet => true, :pid_dir => './tmp/pids', :log_dir => './log', :queues => ['test_queue']}], + ['delayed_job.3', {:quiet => true, :pid_dir => './tmp/pids', :log_dir => './log', :queues => ['test_queue']}], + ['delayed_job.4', {:quiet => true, :pid_dir => './tmp/pids', :log_dir => './log', :queues => ['test_queue']}], + ['delayed_job.5', {:quiet => true, :pid_dir => './tmp/pids', :log_dir => './log', :queues => %w[mailers misc]}], + ['delayed_job.6', {:quiet => true, :pid_dir => './tmp/pids', :log_dir => './log', :queues => %w[mailers misc]}] ].each do |args| expect(command).to receive(:run_process).with(*args).once end diff --git a/spec/helper.rb b/spec/helper.rb index f93219e48..e3d528d1a 100644 --- a/spec/helper.rb +++ b/spec/helper.rb @@ -21,7 +21,6 @@ require 'action_mailer' require 'active_record' -require 'rails' require 'delayed_job' require 'delayed/backend/shared_spec' @@ -37,8 +36,14 @@ end ENV['RAILS_ENV'] = 'test' -FakeApp = Class.new(Rails::Application) -FakeApp.config.eager_load = false +# Trigger AR to initialize +ActiveRecord::Base # rubocop:disable Void + +module Rails + def self.root + '.' + end +end Delayed::Worker.backend = :test @@ -71,8 +76,6 @@ def whatever(n, _) handle_asynchronously :whatever end -FakeApp.initialize! - RSpec.configure do |config| config.after(:each) do Delayed::Worker.reset From 87ab1a68d889c91c0a7e0ec7fa236bb9d8da383a Mon Sep 17 00:00:00 2001 From: David Genord II Date: Mon, 17 Jan 2022 16:56:04 -0500 Subject: [PATCH 34/63] Fix remnant comment change --- lib/delayed/syck_ext.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/delayed/syck_ext.rb b/lib/delayed/syck_ext.rb index df04842d6..c7cb8154a 100644 --- a/lib/delayed/syck_ext.rb +++ b/lib/delayed/syck_ext.rb @@ -36,7 +36,7 @@ def self.yaml_tag_read_class(name) module YAML def load_dj(yaml) # See https://github.com/dtao/safe_yaml - # When the module is there, we need to load our YAML like this... + # When the method is there, we need to load our YAML like this... respond_to?(:unsafe_load) ? load(yaml, :safe => false) : load(yaml) end end From 8b6fd4b55d021acf263bbafeefb3ee8f44017f51 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Mon, 17 Jan 2022 17:01:07 -0500 Subject: [PATCH 35/63] Expand allowed version to less than 8.0 Rails should not break anything in 7.x releases. --- Gemfile | 6 +++--- delayed_job.gemspec | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 8b3d6134d..ddd092964 100644 --- a/Gemfile +++ b/Gemfile @@ -36,7 +36,7 @@ platforms :jruby do elsif ENV['RAILS_VERSION'] gem 'railties', "~> #{ENV['RAILS_VERSION']}" else - gem 'railties', ['>= 3.0', '< 7.1'] + gem 'railties', ['>= 3.0', '< 8.0'] end end @@ -52,8 +52,8 @@ group :test do gem 'actionmailer', "~> #{ENV['RAILS_VERSION']}" gem 'activerecord', "~> #{ENV['RAILS_VERSION']}" else - gem 'actionmailer', ['>= 3.0', '< 7.1'] - gem 'activerecord', ['>= 3.0', '< 7.1'] + gem 'actionmailer', ['>= 3.0', '< 8.0'] + gem 'activerecord', ['>= 3.0', '< 8.0'] end gem 'net-smtp' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0') gem 'rspec', '>= 3' diff --git a/delayed_job.gemspec b/delayed_job.gemspec index 23eec33e6..a61fe4717 100644 --- a/delayed_job.gemspec +++ b/delayed_job.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |spec| - spec.add_dependency 'activesupport', ['>= 3.0', '< 7.1'] + spec.add_dependency 'activesupport', ['>= 3.0', '< 8.0'] spec.authors = ['Brandon Keepers', 'Brian Ryckbost', 'Chris Gaffney', 'David Genord II', 'Erik Michaels-Ober', 'Matt Griffin', 'Steve Richert', 'Tobias Lütke'] spec.description = 'Delayed_job (or DJ) encapsulates the common pattern of asynchronously executing longer tasks in the background. It is a direct extraction from Shopify where the job table is responsible for a multitude of core tasks.' spec.email = ['brian@collectiveidea.com'] From c62b69ed19a50ee16bac0f041c7db776b5cc513f Mon Sep 17 00:00:00 2001 From: David Genord II Date: Mon, 17 Jan 2022 18:17:01 -0500 Subject: [PATCH 36/63] Setup zeitwerk ActiveSupport 7 drops classic dependency autoloading. This does a basic zeitwerk setup to test the newer Rails autoloading system --- Gemfile | 3 +++ spec/helper.rb | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index ddd092964..c66ff6e7e 100644 --- a/Gemfile +++ b/Gemfile @@ -64,6 +64,9 @@ group :test do else gem 'simplecov-lcov', :require => false end + if ENV['RAILS_VERSION'].nil? || ENV['RAILS_VERSION'] >= '6.0.0' + gem 'zeitwerk', :require => false + end end group :rubocop do diff --git a/spec/helper.rb b/spec/helper.rb index e3d528d1a..0ba9657e6 100644 --- a/spec/helper.rb +++ b/spec/helper.rb @@ -47,8 +47,21 @@ def self.root Delayed::Worker.backend = :test -# Add this directory so the ActiveSupport autoloading works -ActiveSupport::Dependencies.autoload_paths << File.dirname(__FILE__) +if ActiveSupport::VERSION::MAJOR < 7 + require 'active_support/dependencies' + + # Add this directory so the ActiveSupport autoloading works + ActiveSupport::Dependencies.autoload_paths << File.dirname(__FILE__) +else + # Rails 7 dropped classic dependency auto-loading. This does a basic + # zeitwerk setup to test against zeitwerk directly as the Rails zeitwerk + # setup is intertwined in the application boot process. + require 'zeitwerk' + + loader = Zeitwerk::Loader.new + loader.push_dir File.dirname(__FILE__) + loader.setup +end # Used to test interactions between DJ and an ORM ActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => ':memory:' From 11e0212fb112c5e11e4555ef1e24510819a66347 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Mon, 17 Jan 2022 19:36:42 -0500 Subject: [PATCH 37/63] Prepare 4.1.9 release --- CHANGELOG.md | 4 ++++ README.md | 2 +- delayed_job.gemspec | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51e2dcf0e..9d8f3c37d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +4.1.10 - 2022-01-17 +=================== +* Support for Rails 7.0. NOTE: If you are using Delayed Job independent of Rails, Active Support 7 has dropped classic dependency autoloading. You will need to add and setup zeitwerk for autoloading to continue working in ActiveSupport 7. + 4.1.9 - 2020-12-09 ================== * Support for Rails 6.1 diff --git a/README.md b/README.md index 29ad10782..c72ed2f6f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ **If you're viewing this at https://github.com/collectiveidea/delayed_job, you're reading the documentation for the master branch. [View documentation for the latest release -(4.1.9).](https://github.com/collectiveidea/delayed_job/tree/v4.1.9)** +(4.1.10).](https://github.com/collectiveidea/delayed_job/tree/v4.1.10)** Delayed::Job ============ diff --git a/delayed_job.gemspec b/delayed_job.gemspec index a61fe4717..ee290405e 100644 --- a/delayed_job.gemspec +++ b/delayed_job.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.summary = 'Database-backed asynchronous priority queue system -- Extracted from Shopify' spec.test_files = Dir.glob('spec/**/*') - spec.version = '4.1.9' + spec.version = '4.1.10' spec.metadata = { 'changelog_uri' => 'https://github.com/collectiveidea/delayed_job/blob/master/CHANGELOG.md', 'bug_tracker_uri' => 'https://github.com/collectiveidea/delayed_job/issues', From f5624ce694e6fba3170ee2ea93c160ef85ff2d95 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Tue, 10 May 2022 00:11:30 +0000 Subject: [PATCH 38/63] fix: ActiveSupport 7.0.3 Compatibility Fixes https://github.com/collectiveidea/delayed_job/issues/1168 --- lib/delayed/worker.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/delayed/worker.rb b/lib/delayed/worker.rb index 1a352f775..7b983a206 100644 --- a/lib/delayed/worker.rb +++ b/lib/delayed/worker.rb @@ -1,5 +1,6 @@ require 'timeout' require 'active_support/dependencies' +require 'active_support/core_ext/kernel/reporting' require 'active_support/core_ext/numeric/time' require 'active_support/core_ext/class/attribute_accessors' require 'active_support/hash_with_indifferent_access' From 7042b1ddb87d3b3f468e8350bc2101a283922ed6 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Wed, 28 Sep 2022 14:41:01 -0400 Subject: [PATCH 39/63] Prepare 4.1.11 release --- CHANGELOG.md | 4 ++++ README.md | 2 +- delayed_job.gemspec | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d8f3c37d..86d801219 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +4.1.11 - 2022-09-28 +=================== +* Fix missing require for Rails 7.0.3+ + 4.1.10 - 2022-01-17 =================== * Support for Rails 7.0. NOTE: If you are using Delayed Job independent of Rails, Active Support 7 has dropped classic dependency autoloading. You will need to add and setup zeitwerk for autoloading to continue working in ActiveSupport 7. diff --git a/README.md b/README.md index c72ed2f6f..ff7f2660b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ **If you're viewing this at https://github.com/collectiveidea/delayed_job, you're reading the documentation for the master branch. [View documentation for the latest release -(4.1.10).](https://github.com/collectiveidea/delayed_job/tree/v4.1.10)** +(4.1.11).](https://github.com/collectiveidea/delayed_job/tree/v4.1.11)** Delayed::Job ============ diff --git a/delayed_job.gemspec b/delayed_job.gemspec index ee290405e..0ed7afc33 100644 --- a/delayed_job.gemspec +++ b/delayed_job.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.summary = 'Database-backed asynchronous priority queue system -- Extracted from Shopify' spec.test_files = Dir.glob('spec/**/*') - spec.version = '4.1.10' + spec.version = '4.1.11' spec.metadata = { 'changelog_uri' => 'https://github.com/collectiveidea/delayed_job/blob/master/CHANGELOG.md', 'bug_tracker_uri' => 'https://github.com/collectiveidea/delayed_job/issues', From a83d1a4ac8dfa5851eb4f701428c2c6f2b41bc65 Mon Sep 17 00:00:00 2001 From: Orien Madgwick <497874+orien@users.noreply.github.com> Date: Sun, 15 Jan 2023 22:06:08 +1100 Subject: [PATCH 40/63] CI: add Ruby 3.2 to the test matrix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e451964d..8cb154edf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['2.7', '3.0', '3.1', jruby-head, ruby-head] + ruby: ['2.7', '3.0', '3.1', '3.2', jruby-head, ruby-head] rails_version: - '6.0.0' - '6.1.0' From c2f29f322d6bedf462084f2039d7a5e47f9b138d Mon Sep 17 00:00:00 2001 From: Orien Madgwick <497874+orien@users.noreply.github.com> Date: Sun, 15 Jan 2023 22:14:15 +1100 Subject: [PATCH 41/63] CI: use JRuby 9.4 to test Rails 7.0 and edge Rails 7 and above requires Ruby 2.7 compatibility, however JRuby 9.3.x provides only Ruby 2.6 compatibility. --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8cb154edf..31b73af00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,10 +39,10 @@ jobs: - ruby: jruby-9.2 rails_version: '6.1.0' - # jruby-9.3 - - ruby: jruby-9.3 + # jruby-9.4 + - ruby: jruby-9.4 rails_version: '7.0.0' - - ruby: jruby-9.3 + - ruby: jruby-9.4 rails_version: 'edge' # From 715fd2d35c2c8bf8c594cffe346815cb6443cef4 Mon Sep 17 00:00:00 2001 From: Rajan Agaskar Date: Tue, 24 Jan 2023 15:24:15 -0800 Subject: [PATCH 42/63] Ensure `Array` has been decorated with `#extract_options` --- lib/delayed/backend/job_preparer.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/delayed/backend/job_preparer.rb b/lib/delayed/backend/job_preparer.rb index f545eda0e..24c869752 100644 --- a/lib/delayed/backend/job_preparer.rb +++ b/lib/delayed/backend/job_preparer.rb @@ -1,3 +1,5 @@ +require 'active_support/core_ext/array/extract_options' + module Delayed module Backend class JobPreparer From 7e972d7b0216e10c2029dece1c4a3f0b3b309ef2 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Mon, 2 Oct 2023 11:29:06 -0400 Subject: [PATCH 43/63] Use a block for expect to raise_exception This was probably the only way to do it 10 years ago when it was added. --- spec/worker_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/worker_spec.rb b/spec/worker_spec.rb index 1ce08ce99..eb525ede0 100644 --- a/spec/worker_spec.rb +++ b/spec/worker_spec.rb @@ -106,7 +106,7 @@ expect(Delayed::Job).to receive(:reserve).exactly(10).times.and_raise(Exception) worker = Delayed::Worker.new 9.times { worker.work_off } - expect(lambda { worker.work_off }).to raise_exception Delayed::FatalBackendError + expect { worker.work_off }.to raise_exception Delayed::FatalBackendError end it 'allows the backend to attempt recovery from reservation errors' do From 6f834aff6b8331e1e445631dee6bf1acd2c046ee Mon Sep 17 00:00:00 2001 From: Pirate Praveen Arimbrathodiyil Date: Fri, 9 Feb 2024 20:28:13 +0530 Subject: [PATCH 44/63] Change US/Eastern => America/New_York This fixes Invalid Timezone: US/Eastern error https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1052730 --- lib/delayed/backend/shared_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/delayed/backend/shared_spec.rb b/lib/delayed/backend/shared_spec.rb index 39f497670..2774e7dc0 100644 --- a/lib/delayed/backend/shared_spec.rb +++ b/lib/delayed/backend/shared_spec.rb @@ -230,7 +230,7 @@ def create_job(opts = {}) end it 'reserves jobs scheduled for the past when time zones are involved' do - Time.zone = 'US/Eastern' + Time.zone = 'America/New_York' job = create_job :run_at => described_class.db_time_now - 1.minute expect(described_class.reserve(worker)).to eq(job) end From 25469d9622947562a6a70f179a572b4ac8ba438f Mon Sep 17 00:00:00 2001 From: Joshua Young Date: Tue, 30 Apr 2024 13:24:01 +1000 Subject: [PATCH 45/63] Address `ActiveSupport::ProxyObject` deprecation on Rails 7.2.0.alpha --- lib/delayed/compatibility.rb | 12 ------------ lib/delayed/message_sending.rb | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/delayed/compatibility.rb b/lib/delayed/compatibility.rb index 72778f9cc..0ef949b7a 100644 --- a/lib/delayed/compatibility.rb +++ b/lib/delayed/compatibility.rb @@ -3,25 +3,13 @@ module Delayed module Compatibility if ActiveSupport::VERSION::MAJOR >= 4 - require 'active_support/proxy_object' - def self.executable_prefix 'bin' end - - def self.proxy_object_class - ActiveSupport::ProxyObject - end else - require 'active_support/basic_object' - def self.executable_prefix 'script' end - - def self.proxy_object_class - ActiveSupport::BasicObject - end end end end diff --git a/lib/delayed/message_sending.rb b/lib/delayed/message_sending.rb index a2808fd39..960b73d0d 100644 --- a/lib/delayed/message_sending.rb +++ b/lib/delayed/message_sending.rb @@ -1,5 +1,5 @@ module Delayed - class DelayProxy < Delayed::Compatibility.proxy_object_class + class DelayProxy < BasicObject def initialize(payload_class, target, options) @payload_class = payload_class @target = target From 21b3dad718549ca2600571004ac00960c498c46e Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 13 Aug 2024 11:05:35 -0400 Subject: [PATCH 46/63] Bring in missing functionality from ProxyObject --- lib/delayed/message_sending.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/delayed/message_sending.rb b/lib/delayed/message_sending.rb index 960b73d0d..6e1e834a1 100644 --- a/lib/delayed/message_sending.rb +++ b/lib/delayed/message_sending.rb @@ -1,5 +1,11 @@ module Delayed class DelayProxy < BasicObject + undef_method :== + undef_method :equal? + + # Let DelayProxy raise exceptions. + define_method(:raise, ::Object.instance_method(:raise)) + def initialize(payload_class, target, options) @payload_class = payload_class @target = target From 45680bb178c51ca190746acc239f03bf8cf4eecd Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 13 Aug 2024 11:45:11 -0400 Subject: [PATCH 47/63] 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 48/63] 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 49/63] 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 50/63] 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 51/63] 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 52/63] 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 53/63] 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 54/63] 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 55/63] 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 56/63] 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') }} From 98028530b62f044fc6f84377a735cd1e98c5485c Mon Sep 17 00:00:00 2001 From: Orien Madgwick <497874+orien@users.noreply.github.com> Date: Mon, 19 Feb 2024 20:38:03 +1100 Subject: [PATCH 57/63] CI: be precise regarding the Ubuntu version Older versions of Ruby segfault on newer versions of Ubuntu. --- .github/workflows/ci.yml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73334f9f1..93536aa33 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,8 @@ on: jobs: test: - runs-on: ubuntu-latest + name: Test (Ruby ${{ matrix.ruby }}, Rails ${{ matrix.rails_version }}) + runs-on: ubuntu-${{ matrix.ubuntu }} strategy: fail-fast: false matrix: @@ -18,18 +19,23 @@ jobs: - '7.1.0' - '7.2.0' - 'edge' + ubuntu: [latest] include: # Ruby 2.6 - ruby: 2.6 rails_version: '6.0.0' + ubuntu: '20.04' - ruby: 2.6 rails_version: '6.1.0' + ubuntu: '20.04' # jruby-9.2 - ruby: jruby-9.2 rails_version: '6.0.0' + ubuntu: '20.04' - ruby: jruby-9.2 rails_version: '6.1.0' + ubuntu: '20.04' # # The past @@ -37,48 +43,69 @@ jobs: # EOL Active Record - ruby: 2.2 rails_version: '3.2.0' + ubuntu: '20.04' - ruby: 2.1 rails_version: '4.1.0' + ubuntu: '20.04' - ruby: 2.4 rails_version: '4.2.0' + ubuntu: '20.04' - ruby: 2.4 rails_version: '5.0.0' + ubuntu: '20.04' - ruby: 2.5 rails_version: '5.1.0' + ubuntu: '20.04' - ruby: 2.6 rails_version: '5.2.0' + ubuntu: '20.04' - ruby: 2.7 rails_version: '5.2.0' + ubuntu: '22.04' - ruby: jruby-9.2 rails_version: '5.2.0' + ubuntu: '22.04' - ruby: 2.7 rails_version: '6.0.0' + ubuntu: '22.04' - ruby: 3.0 rails_version: '6.0.0' + ubuntu: '22.04' - ruby: 3.2 rails_version: '6.0.0' + ubuntu: '22.04' - ruby: jruby-9.4 rails_version: '6.0.0' + ubuntu: '22.04' - ruby: 2.7 rails_version: '6.1.0' + ubuntu: '22.04' - ruby: 3.0 rails_version: '6.1.0' + ubuntu: '22.04' - ruby: 3.2 rails_version: '6.1.0' + ubuntu: '22.04' - ruby: jruby-9.4 rails_version: '6.0.0' + ubuntu: '22.04' - ruby: 2.7 rails_version: '7.0.0' + ubuntu: '22.04' - ruby: 3.0 rails_version: '7.0.0' + ubuntu: '22.04' - ruby: jruby-9.4 rails_version: '6.0.0' + ubuntu: '22.04' # EOL Ruby - ruby: 2.7 rails_version: '7.1.0' + ubuntu: '22.04' - ruby: 3.0 rails_version: '7.1.0' + ubuntu: '22.04' continue-on-error: ${{ matrix.rails_version == 'edge' || endsWith(matrix.ruby, 'head') }} From 95840470ef9e8d260b8381c62a26e9eeb13d68ff Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 13 Aug 2024 15:28:44 -0400 Subject: [PATCH 58/63] Add trusted publishing workflow --- .github/workflows/publish_gem.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/publish_gem.yml diff --git a/.github/workflows/publish_gem.yml b/.github/workflows/publish_gem.yml new file mode 100644 index 000000000..613132fdd --- /dev/null +++ b/.github/workflows/publish_gem.yml @@ -0,0 +1,28 @@ +name: Publish Gem + +on: + push: + tags: + - v* + +jobs: + push: + if: github.repository == 'collectiveidea/delayed_job' + runs-on: ubuntu-latest + environment: publishing + + permissions: + contents: write + id-token: write + + steps: + # Set up + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: ruby + + # Release + - uses: rubygems/release-gem@v1 From 062acf0eb4acff5a8d9dcc01bde108f035845abd Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 13 Aug 2024 15:55:31 -0400 Subject: [PATCH 59/63] Prepare 4.1.12.rc1 release --- CHANGELOG.md | 7 +++++++ README.md | 2 +- delayed_job.gemspec | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86d801219..6a12fe2e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +4.1.12.rc1 - 2024-08-13 +======================= +* Validating trusted publishing release +* Add missing require for extract_options +* Fix rails 7.2 ActiveSupport::ProxyObject deprecation +* Multiple contributors on current and legacy test suite improvements + 4.1.11 - 2022-09-28 =================== * Fix missing require for Rails 7.0.3+ diff --git a/README.md b/README.md index ff7f2660b..0221f1970 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ **If you're viewing this at https://github.com/collectiveidea/delayed_job, you're reading the documentation for the master branch. [View documentation for the latest release -(4.1.11).](https://github.com/collectiveidea/delayed_job/tree/v4.1.11)** +(4.1.12.rc1).](https://github.com/collectiveidea/delayed_job/tree/v4.1.12.rc1)** Delayed::Job ============ diff --git a/delayed_job.gemspec b/delayed_job.gemspec index 0ed7afc33..4a1a61b8c 100644 --- a/delayed_job.gemspec +++ b/delayed_job.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.summary = 'Database-backed asynchronous priority queue system -- Extracted from Shopify' spec.test_files = Dir.glob('spec/**/*') - spec.version = '4.1.11' + spec.version = '4.1.12.rc1' spec.metadata = { 'changelog_uri' => 'https://github.com/collectiveidea/delayed_job/blob/master/CHANGELOG.md', 'bug_tracker_uri' => 'https://github.com/collectiveidea/delayed_job/issues', From 8cf3163b8dc37ed619f6a1d3ba924c4ccb4d5518 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Tue, 13 Aug 2024 17:03:16 -0400 Subject: [PATCH 60/63] Prepare release 4.1.12 --- CHANGELOG.md | 6 ++++++ README.md | 2 +- delayed_job.gemspec | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a12fe2e4..e4ec1e796 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +4.1.12 - 2024-08-14 +======================= +* Add missing require for extract_options +* Fix rails 7.2 ActiveSupport::ProxyObject deprecation +* Multiple contributors on current and legacy test suite improvements + 4.1.12.rc1 - 2024-08-13 ======================= * Validating trusted publishing release diff --git a/README.md b/README.md index 0221f1970..be68f2c76 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ **If you're viewing this at https://github.com/collectiveidea/delayed_job, you're reading the documentation for the master branch. [View documentation for the latest release -(4.1.12.rc1).](https://github.com/collectiveidea/delayed_job/tree/v4.1.12.rc1)** +(4.1.12).](https://github.com/collectiveidea/delayed_job/tree/v4.1.12)** Delayed::Job ============ diff --git a/delayed_job.gemspec b/delayed_job.gemspec index 4a1a61b8c..765079cb7 100644 --- a/delayed_job.gemspec +++ b/delayed_job.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.summary = 'Database-backed asynchronous priority queue system -- Extracted from Shopify' spec.test_files = Dir.glob('spec/**/*') - spec.version = '4.1.12.rc1' + spec.version = '4.1.12' spec.metadata = { 'changelog_uri' => 'https://github.com/collectiveidea/delayed_job/blob/master/CHANGELOG.md', 'bug_tracker_uri' => 'https://github.com/collectiveidea/delayed_job/issues', From b60e70a20c45a767d9b8ae2ed12630b2f082f887 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Fri, 8 Nov 2024 15:15:31 -0500 Subject: [PATCH 61/63] Enable rails 8 --- Gemfile | 6 +++--- delayed_job.gemspec | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index ec2699867..72280c43a 100644 --- a/Gemfile +++ b/Gemfile @@ -38,7 +38,7 @@ platforms :jruby do elsif ENV['RAILS_VERSION'] gem 'railties', "~> #{ENV['RAILS_VERSION']}" else - gem 'railties', ['>= 3.0', '< 8.0'] + gem 'railties', ['>= 3.0', '< 9.0'] end end @@ -59,8 +59,8 @@ group :test do gem 'rails-html-sanitizer', '< 1.4.0' end else - gem 'actionmailer', ['>= 3.0', '< 8.0'] - gem 'activerecord', ['>= 3.0', '< 8.0'] + gem 'actionmailer', ['>= 3.0', '< 9.0'] + gem 'activerecord', ['>= 3.0', '< 9.0'] end gem 'net-smtp' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0') gem 'rspec', '>= 3' diff --git a/delayed_job.gemspec b/delayed_job.gemspec index 765079cb7..b52026ef1 100644 --- a/delayed_job.gemspec +++ b/delayed_job.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |spec| - spec.add_dependency 'activesupport', ['>= 3.0', '< 8.0'] + spec.add_dependency 'activesupport', ['>= 3.0', '< 9.0'] spec.authors = ['Brandon Keepers', 'Brian Ryckbost', 'Chris Gaffney', 'David Genord II', 'Erik Michaels-Ober', 'Matt Griffin', 'Steve Richert', 'Tobias Lütke'] spec.description = 'Delayed_job (or DJ) encapsulates the common pattern of asynchronously executing longer tasks in the background. It is a direct extraction from Shopify where the job table is responsible for a multitude of core tasks.' spec.email = ['brian@collectiveidea.com'] From 79b86255cfcbade2473f1528c173cfd237b88d8c Mon Sep 17 00:00:00 2001 From: David Genord II Date: Fri, 8 Nov 2024 15:21:33 -0500 Subject: [PATCH 62/63] Update matrix for Rails 8 --- .github/workflows/ci.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93536aa33..43bf89128 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,11 +13,12 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['3.1', '3.2', '3.3', jruby-9.4, jruby-head, ruby-head] + ruby: ['3.2', '3.3', jruby-9.4, jruby-head, ruby-head] rails_version: - '7.0.0' - '7.1.0' - '7.2.0' + - '8.0.0' - 'edge' ubuntu: [latest] include: @@ -29,6 +30,17 @@ jobs: rails_version: '6.1.0' ubuntu: '20.04' + # ruby 3.1 (Dropped by Rails 8) + - ruby: 3.1 + rails_version: '7.0.0' + ubuntu: 'latest' + - ruby: 3.1 + rails_version: '7.1.0' + ubuntu: 'latest' + - ruby: 3.1 + rails_version: '7.2.0' + ubuntu: 'latest' + # jruby-9.2 - ruby: jruby-9.2 rails_version: '6.0.0' From c08d953e2074c96aedfb04cd7df933fcf6084647 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Fri, 8 Nov 2024 15:51:37 -0500 Subject: [PATCH 63/63] Prepare release 4.1.13 --- CHANGELOG.md | 4 ++++ README.md | 2 +- delayed_job.gemspec | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4ec1e796..ef33c0b48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +4.1.13 - 2024-11-08 +======================= +* Enable Rails 8 + 4.1.12 - 2024-08-14 ======================= * Add missing require for extract_options diff --git a/README.md b/README.md index be68f2c76..4badb2815 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ **If you're viewing this at https://github.com/collectiveidea/delayed_job, you're reading the documentation for the master branch. [View documentation for the latest release -(4.1.12).](https://github.com/collectiveidea/delayed_job/tree/v4.1.12)** +(4.1.13).](https://github.com/collectiveidea/delayed_job/tree/v4.1.13)** Delayed::Job ============ diff --git a/delayed_job.gemspec b/delayed_job.gemspec index b52026ef1..e6bc24b41 100644 --- a/delayed_job.gemspec +++ b/delayed_job.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.summary = 'Database-backed asynchronous priority queue system -- Extracted from Shopify' spec.test_files = Dir.glob('spec/**/*') - spec.version = '4.1.12' + spec.version = '4.1.13' spec.metadata = { 'changelog_uri' => 'https://github.com/collectiveidea/delayed_job/blob/master/CHANGELOG.md', 'bug_tracker_uri' => 'https://github.com/collectiveidea/delayed_job/issues',