Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
9db85f9
Add metadata link
viraptor Aug 18, 2019
a346ab8
Fix quoting for rubocop
viraptor Aug 19, 2019
7660286
Make .delay method work with ActionMailer::Parameterized::Mailer
johnnyshields Sep 22, 2020
fc0e9e2
Add specs
johnnyshields Sep 22, 2020
4878fcd
Add to and improve README for Mailers
johnnyshields Sep 22, 2020
75bec31
Fix rubocop
johnnyshields Sep 22, 2020
065fc51
Add Github Action CI
albus522 Dec 8, 2020
80aa67a
Add rubocop Github Action
albus522 Dec 8, 2020
8ad44ac
Remove Travis CI
albus522 Dec 8, 2020
0ca7b4a
Fix simplecov issue
albus522 Dec 8, 2020
1a8f49c
Tweak version handling for cleaner display
albus522 Dec 8, 2020
44412a5
Update build status badge
albus522 Dec 9, 2020
c7809c3
Merge pull request #1128 from collectiveidea/dg-move-to-github-actions
albus522 Dec 9, 2020
1f16417
Allow rails 6.1
albus522 Dec 9, 2020
2b064f7
Pull dev jdbcsqlite3 for edge and rails 6.1
albus522 Dec 9, 2020
59d8178
Merge pull request #1129 from collectiveidea/dg-add-rails-6-1
albus522 Dec 9, 2020
c35dd0f
Merge pull request #1101 from viraptor/patch-1
albus522 Dec 9, 2020
50a0712
Merge pull request #1121 from johnnyshields/patch-3
albus522 Dec 9, 2020
baed6e8
Prepare 4.1.9 release
albus522 Dec 9, 2020
d6bc5cc
Add Rails7 support
willnet Oct 11, 2021
9bd7070
net/smtp isn't bundled by default from Ruby 3.1
willnet Oct 11, 2021
56ae068
Split jruby version with 9.2.x and 9.3.x
willnet Oct 11, 2021
069b642
Add railties to use zeitwerk
willnet Oct 18, 2021
7246e56
net/smtp isn't bundled with Ruby from 3.1.0-dev
willnet Oct 18, 2021
587f501
Fix a warning from rails
willnet Oct 25, 2021
8086462
Fix a broken spec due to Psych >= 4
willnet Oct 25, 2021
da97d70
Fix a dependency error on ruby-head
willnet Oct 25, 2021
7a63bc1
Bump rails from 7.0.0.alpha2 to 7.0.0.rc1
willnet Dec 13, 2021
5accab4
Bump rails from 7.0.0.rc1 to 7.0.0
willnet Dec 20, 2021
aedbbd1
Ruby 3.1 released
willnet Dec 27, 2021
6861d2b
Remove useless gem dependency
willnet Dec 27, 2021
562a460
syck has nothing to do with the pych 4.0
willnet Dec 27, 2021
8a4ad45
Use Rails 7.0.1 instead of 7.0.0 on CI
willnet Jan 17, 2022
462288b
Enclose every ruby version in quotations
willnet Jan 17, 2022
c58252a
Remove duplicated gem dependencies
willnet Jan 17, 2022
8ac60f0
Bring back full matrix
albus522 Jan 17, 2022
bc2c588
Revert "Add railties to use zeitwerk"
albus522 Jan 17, 2022
87ab1a6
Fix remnant comment change
albus522 Jan 17, 2022
8b6fd4b
Expand allowed version to less than 8.0
albus522 Jan 17, 2022
c62b69e
Setup zeitwerk
albus522 Jan 17, 2022
4f4c2e1
Merge pull request #1161 from collectiveidea/dg-fixup-rails-7
albus522 Jan 17, 2022
11e0212
Prepare 4.1.9 release
albus522 Jan 18, 2022
f5624ce
fix: ActiveSupport 7.0.3 Compatibility
arielvalentin May 10, 2022
0ebfebd
Merge pull request #1169 from arielvalentin/as-7.0.3
albus522 Sep 28, 2022
7042b1d
Prepare 4.1.11 release
albus522 Sep 28, 2022
a83d1a4
CI: add Ruby 3.2 to the test matrix
orien Jan 15, 2023
c2f29f3
CI: use JRuby 9.4 to test Rails 7.0 and edge
orien Jan 15, 2023
92fb435
Merge pull request #1183 from envato/ruby3.2
albus522 Jan 16, 2023
715fd2d
Ensure `Array` has been decorated with `#extract_options`
ragaskar Jan 24, 2023
6a1c712
Merge pull request #1185 from ragaskar/patch-1
albus522 Oct 2, 2023
7e972d7
Use a block for expect to raise_exception
albus522 Oct 2, 2023
b66bb64
Merge pull request #1194 from collectiveidea/fix-rspec-deprecation
albus522 Oct 2, 2023
6f834af
Change US/Eastern => America/New_York
pravi Feb 9, 2024
25469d9
Address `ActiveSupport::ProxyObject` deprecation on Rails 7.2.0.alpha
joshuay03 Apr 30, 2024
21b3dad
Bring in missing functionality from ProxyObject
albus522 Aug 13, 2024
61cfd03
Merge pull request #1212 from collectiveidea/fix-proxy-object-depreca…
albus522 Aug 13, 2024
45680bb
Update build matrix
albus522 Aug 13, 2024
7dfae62
Add sqlite restriction
albus522 Aug 13, 2024
8327175
Fix BasicObject cleanup
albus522 Aug 13, 2024
2ded9a3
Fix rails 4.2 and 5.0 test dependencies
albus522 Aug 13, 2024
e815df8
Ruby libraries moved out of standard lib in 3.4
albus522 Aug 13, 2024
b27cdc9
Handle ruby 3.4 message expectation
albus522 Aug 13, 2024
c9947ab
Update actions/checkout
albus522 Aug 13, 2024
3cbf1a3
Run jruby-9.4
albus522 Aug 13, 2024
b5c1d6a
Switch to coveralls main
albus522 Aug 13, 2024
604fb96
Update actions/cache
albus522 Aug 13, 2024
aea60a4
Merge pull request #1213 from collectiveidea/update-build-matrix
albus522 Aug 13, 2024
9802853
CI: be precise regarding the Ubuntu version
orien Feb 19, 2024
1420ad0
Merge pull request #1214 from collectiveidea/pull-envato-pr
albus522 Aug 13, 2024
7e28396
Merge pull request #1203 from pravi/patch-1
albus522 Aug 13, 2024
9584047
Add trusted publishing workflow
albus522 Aug 13, 2024
d0994cf
Merge pull request #1215 from collectiveidea/trusted-publishing
albus522 Aug 13, 2024
062acf0
Prepare 4.1.12.rc1 release
albus522 Aug 13, 2024
43375e4
Merge pull request #1216 from collectiveidea/release-4.1.12.rc1
albus522 Aug 13, 2024
8cf3163
Prepare release 4.1.12
albus522 Aug 13, 2024
fc3dfda
Merge pull request #1217 from collectiveidea/release-4.1.12
albus522 Aug 14, 2024
b60e70a
Enable rails 8
albus522 Nov 8, 2024
79b8625
Update matrix for Rails 8
albus522 Nov 8, 2024
c7dbb01
Merge pull request #1223 from collectiveidea/dg/rails-8
albus522 Nov 8, 2024
c08d953
Prepare release 4.1.13
albus522 Nov 8, 2024
ea4879d
Merge pull request #1224 from collectiveidea/release-4.1.13
albus522 Nov 8, 2024
b6d432f
Merge v4.1.13
navels Dec 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 80 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,62 +8,121 @@ 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:
ruby: ['2.7', '3.0', '3.1', jruby-head, ruby-head]
ruby: ['3.2', '3.3', jruby-9.4, jruby-head, ruby-head]
rails_version:
- '6.0.0'
- '6.1.0'
- '7.0.0'
- '7.1.0'
- '7.2.0'
- '8.0.0'
- 'edge'
ubuntu: [latest]
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'
ubuntu: '20.04'
- ruby: 2.6
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'
ubuntu: '20.04'
- ruby: jruby-9.2
rails_version: '6.1.0'

# jruby-9.3
- ruby: jruby-9.3
rails_version: '7.0.0'
- ruby: jruby-9.3
rails_version: 'edge'
ubuntu: '20.04'

#
# The past
#
# 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') }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
env:
RAILS_VERSION: ${{ matrix.rails_version }}
Expand All @@ -75,7 +134,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 }}
Expand All @@ -86,7 +145,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
28 changes: 28 additions & 0 deletions .github/workflows/publish_gem.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ 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:
ruby-version: 2.7
- 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') }}
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
4.1.13 - 2024-11-08
=======================
* Enable Rails 8

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
* 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+
Expand Down
20 changes: 17 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -36,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

Expand All @@ -51,9 +53,14 @@ 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']
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'
Expand All @@ -64,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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.13).](https://github.com/collectiveidea/delayed_job/tree/v4.1.13)**

Delayed::Job
============
Expand Down
4 changes: 2 additions & 2 deletions delayed_job.gemspec
Original file line number Diff line number Diff line change
@@ -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']
Expand All @@ -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.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',
Expand Down
2 changes: 2 additions & 0 deletions lib/delayed/backend/job_preparer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'active_support/core_ext/array/extract_options'

module Delayed
module Backend
class JobPreparer
Expand Down
9 changes: 7 additions & 2 deletions lib/delayed/backend/shared_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions lib/delayed/compatibility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 11 additions & 1 deletion lib/delayed/message_sending.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
module Delayed
class DelayProxy < Delayed::Compatibility.proxy_object_class
class DelayProxy < BasicObject
# 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.
def raise(*args)
::Object.send(:raise, *args)
end

def initialize(payload_class, target, options)
@payload_class = payload_class
@target = target
Expand Down
2 changes: 1 addition & 1 deletion spec/worker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down