Skip to content

Commit 8dd6cf8

Browse files
authored
Merge branch 'master' into ruby3-and-kwargs-support
2 parents bac4243 + d0288d8 commit 8dd6cf8

10 files changed

Lines changed: 193 additions & 32 deletions

File tree

.github/workflows/ci.yml

Lines changed: 103 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,121 @@ on:
88

99
jobs:
1010
test:
11-
runs-on: ubuntu-latest
11+
name: Test (Ruby ${{ matrix.ruby }}, Rails ${{ matrix.rails_version }})
12+
runs-on: ubuntu-${{ matrix.ubuntu }}
1213
strategy:
1314
fail-fast: false
1415
matrix:
15-
ruby: ['3.0', '3.1', '3.2', jruby-head, ruby-head]
16+
ruby: ['3.2', '3.3', '3.4', jruby-9.4, jruby-head, ruby-head]
1617
rails_version:
17-
- '6.0.0'
18-
- '6.1.0'
1918
- '7.0.0'
19+
- '7.1.0'
20+
- '7.2.0'
21+
- '8.0.0'
2022
- 'edge'
23+
ubuntu: [latest]
2124
include:
22-
# jruby-9.4
25+
# Ruby 2.6
26+
- ruby: 2.6
27+
rails_version: '6.0.0'
28+
ubuntu: '20.04'
29+
- ruby: 2.6
30+
rails_version: '6.1.0'
31+
ubuntu: '20.04'
32+
33+
# ruby 3.1 (Dropped by Rails 8)
34+
- ruby: 3.1
35+
rails_version: '7.0.0'
36+
ubuntu: 'latest'
37+
- ruby: 3.1
38+
rails_version: '7.1.0'
39+
ubuntu: 'latest'
40+
- ruby: 3.1
41+
rails_version: '7.2.0'
42+
ubuntu: 'latest'
43+
44+
# jruby-9.2
45+
- ruby: jruby-9.2
46+
rails_version: '6.0.0'
47+
ubuntu: '20.04'
48+
- ruby: jruby-9.2
49+
rails_version: '6.1.0'
50+
ubuntu: '20.04'
51+
52+
#
53+
# The past
54+
#
55+
# EOL Active Record
56+
- ruby: 2.2
57+
rails_version: '3.2.0'
58+
ubuntu: '20.04'
59+
- ruby: 2.1
60+
rails_version: '4.1.0'
61+
ubuntu: '20.04'
62+
- ruby: 2.4
63+
rails_version: '4.2.0'
64+
ubuntu: '20.04'
65+
- ruby: 2.4
66+
rails_version: '5.0.0'
67+
ubuntu: '20.04'
68+
- ruby: 2.5
69+
rails_version: '5.1.0'
70+
ubuntu: '20.04'
71+
- ruby: 2.6
72+
rails_version: '5.2.0'
73+
ubuntu: '20.04'
74+
- ruby: 2.7
75+
rails_version: '5.2.0'
76+
ubuntu: '22.04'
77+
- ruby: jruby-9.2
78+
rails_version: '5.2.0'
79+
ubuntu: '22.04'
80+
- ruby: 2.7
81+
rails_version: '6.0.0'
82+
ubuntu: '22.04'
83+
- ruby: 3.0
84+
rails_version: '6.0.0'
85+
ubuntu: '22.04'
86+
- ruby: 3.2
87+
rails_version: '6.0.0'
88+
ubuntu: '22.04'
89+
- ruby: jruby-9.4
90+
rails_version: '6.0.0'
91+
ubuntu: '22.04'
92+
- ruby: 2.7
93+
rails_version: '6.1.0'
94+
ubuntu: '22.04'
95+
- ruby: 3.0
96+
rails_version: '6.1.0'
97+
ubuntu: '22.04'
98+
- ruby: 3.2
99+
rails_version: '6.1.0'
100+
ubuntu: '22.04'
23101
- ruby: jruby-9.4
102+
rails_version: '6.0.0'
103+
ubuntu: '22.04'
104+
- ruby: 2.7
105+
rails_version: '7.0.0'
106+
ubuntu: '22.04'
107+
- ruby: 3.0
24108
rails_version: '7.0.0'
109+
ubuntu: '22.04'
25110
- ruby: jruby-9.4
26-
rails_version: 'edge'
111+
rails_version: '6.0.0'
112+
ubuntu: '22.04'
113+
114+
# EOL Ruby
115+
- ruby: 2.7
116+
rails_version: '7.1.0'
117+
ubuntu: '22.04'
118+
- ruby: 3.0
119+
rails_version: '7.1.0'
120+
ubuntu: '22.04'
27121

28122
continue-on-error: ${{ matrix.rails_version == 'edge' || endsWith(matrix.ruby, 'head') }}
29123

30124
steps:
31-
- uses: actions/checkout@v2
125+
- uses: actions/checkout@v4
32126
- uses: ruby/setup-ruby@v1
33127
env:
34128
RAILS_VERSION: ${{ matrix.rails_version }}
@@ -40,7 +134,7 @@ jobs:
40134
RAILS_VERSION: ${{ matrix.rails_version }}
41135
run: bundle exec rspec
42136
- name: Coveralls Parallel
43-
uses: coverallsapp/github-action@master
137+
uses: coverallsapp/github-action@main
44138
with:
45139
github-token: ${{ secrets.github_token }}
46140
flag-name: run-${{ matrix.ruby }}-${{ matrix.rails_version }}
@@ -51,7 +145,7 @@ jobs:
51145
runs-on: ubuntu-latest
52146
steps:
53147
- name: Coveralls Finished
54-
uses: coverallsapp/github-action@master
148+
uses: coverallsapp/github-action@main
55149
with:
56150
github-token: ${{ secrets.github_token }}
57151
parallel-finished: true

.github/workflows/publish_gem.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish Gem
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
push:
10+
if: github.repository == 'collectiveidea/delayed_job'
11+
runs-on: ubuntu-latest
12+
environment: publishing
13+
14+
permissions:
15+
contents: write
16+
id-token: write
17+
18+
steps:
19+
# Set up
20+
- uses: actions/checkout@v4
21+
- name: Set up Ruby
22+
uses: ruby/setup-ruby@v1
23+
with:
24+
bundler-cache: true
25+
ruby-version: ruby
26+
27+
# Release
28+
- uses: rubygems/release-gem@v1

.github/workflows/rubocop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v4
1111
- name: Set up Ruby 2.7
1212
uses: ruby/setup-ruby@v1
1313
with:
1414
ruby-version: 2.7
1515
- name: Generate lockfile for cache key
1616
run: bundle lock
1717
- name: Cache gems
18-
uses: actions/cache@v1
18+
uses: actions/cache@v4
1919
with:
2020
path: vendor/bundle
2121
key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }}

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
4.1.13 - 2024-11-08
2+
=======================
3+
* Enable Rails 8
4+
5+
4.1.12 - 2024-08-14
6+
=======================
7+
* Add missing require for extract_options
8+
* Fix rails 7.2 ActiveSupport::ProxyObject deprecation
9+
* Multiple contributors on current and legacy test suite improvements
10+
11+
4.1.12.rc1 - 2024-08-13
12+
=======================
13+
* Validating trusted publishing release
14+
* Add missing require for extract_options
15+
* Fix rails 7.2 ActiveSupport::ProxyObject deprecation
16+
* Multiple contributors on current and legacy test suite improvements
17+
118
4.1.11 - 2022-09-28
219
===================
320
* Fix missing require for Rails 7.0.3+

Gemfile

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ platforms :ruby do
77
# Rails 6 now requires sqlite 1.4
88
if ENV['RAILS_VERSION'] && ENV['RAILS_VERSION'] < '5.1'
99
gem 'sqlite3', '< 1.4'
10+
elsif ENV['RAILS_VERSION'] && ENV['RAILS_VERSION'] < '7.2'
11+
gem 'sqlite3', '~> 1.4'
1012
else
1113
gem 'sqlite3'
1214
end
@@ -36,7 +38,7 @@ platforms :jruby do
3638
elsif ENV['RAILS_VERSION']
3739
gem 'railties', "~> #{ENV['RAILS_VERSION']}"
3840
else
39-
gem 'railties', ['>= 3.0', '< 8.0']
41+
gem 'railties', ['>= 3.0', '< 9.0']
4042
end
4143
end
4244

@@ -51,9 +53,14 @@ group :test do
5153
elsif ENV['RAILS_VERSION']
5254
gem 'actionmailer', "~> #{ENV['RAILS_VERSION']}"
5355
gem 'activerecord', "~> #{ENV['RAILS_VERSION']}"
56+
if ENV['RAILS_VERSION'] < '5.1'
57+
gem 'loofah', '2.3.1'
58+
gem 'nokogiri', '< 1.11.0'
59+
gem 'rails-html-sanitizer', '< 1.4.0'
60+
end
5461
else
55-
gem 'actionmailer', ['>= 3.0', '< 8.0']
56-
gem 'activerecord', ['>= 3.0', '< 8.0']
62+
gem 'actionmailer', ['>= 3.0', '< 9.0']
63+
gem 'activerecord', ['>= 3.0', '< 9.0']
5764
end
5865
gem 'net-smtp' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
5966
gem 'rspec', '>= 3'
@@ -64,6 +71,16 @@ group :test do
6471
else
6572
gem 'simplecov-lcov', :require => false
6673
end
74+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0')
75+
# New dependencies with a deprecation notice in Ruby 3.3 and required in Ruby 3.4
76+
# Probably won't get released in rails 7.0
77+
gem 'base64'
78+
gem 'bigdecimal'
79+
gem 'mutex_m'
80+
gem 'ostruct'
81+
elsif Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('2.2.100')
82+
gem 'logger', '< 1.3'
83+
end
6784
if ENV['RAILS_VERSION'].nil? || ENV['RAILS_VERSION'] >= '6.0.0'
6885
gem 'zeitwerk', :require => false
6986
end

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
**If you're viewing this at https://github.com/collectiveidea/delayed_job,
22
you're reading the documentation for the master branch.
33
[View documentation for the latest release
4-
(4.1.11).](https://github.com/collectiveidea/delayed_job/tree/v4.1.11)**
4+
(4.1.13).](https://github.com/collectiveidea/delayed_job/tree/v4.1.13)**
55

66
Delayed::Job
77
============

delayed_job.gemspec

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# -*- encoding: utf-8 -*-
22

33
Gem::Specification.new do |spec|
4-
spec.add_dependency 'activesupport', ['>= 3.0', '< 8.0']
4+
spec.add_dependency 'activesupport', ['>= 3.0', '< 9.0']
5+
spec.add_dependency 'benchmark'
6+
spec.add_dependency 'logger'
57
spec.authors = ['Brandon Keepers', 'Brian Ryckbost', 'Chris Gaffney', 'David Genord II', 'Erik Michaels-Ober', 'Matt Griffin', 'Steve Richert', 'Tobias Lütke']
68
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.'
79
spec.email = ['brian@collectiveidea.com']
@@ -13,7 +15,7 @@ Gem::Specification.new do |spec|
1315
spec.require_paths = ['lib']
1416
spec.summary = 'Database-backed asynchronous priority queue system -- Extracted from Shopify'
1517
spec.test_files = Dir.glob('spec/**/*')
16-
spec.version = '4.1.11'
18+
spec.version = '4.1.13'
1719
spec.metadata = {
1820
'changelog_uri' => 'https://github.com/collectiveidea/delayed_job/blob/master/CHANGELOG.md',
1921
'bug_tracker_uri' => 'https://github.com/collectiveidea/delayed_job/issues',

lib/delayed/backend/shared_spec.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def create_job(opts = {})
230230
end
231231

232232
it 'reserves jobs scheduled for the past when time zones are involved' do
233-
Time.zone = 'US/Eastern'
233+
Time.zone = 'America/New_York'
234234
job = create_job :run_at => described_class.db_time_now - 1.minute
235235
expect(described_class.reserve(worker)).to eq(job)
236236
end
@@ -595,7 +595,12 @@ def create_job(opts = {})
595595
worker.work_off
596596
@job.reload
597597
expect(@job.last_error).to match(/did not work/)
598-
expect(@job.last_error).to match(/sample_jobs.rb:\d+:in `perform'/)
598+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4.0')
599+
# Ruby 3.4 produces a more verbose message
600+
expect(@job.last_error).to match(/sample_jobs.rb:\d+:in 'ErrorJob#perform'/)
601+
else
602+
expect(@job.last_error).to match(/sample_jobs.rb:\d+:in `perform'/)
603+
end
599604
expect(@job.attempts).to eq(1)
600605
expect(@job.run_at).to be > Delayed::Job.db_time_now - 10.minutes
601606
expect(@job.run_at).to be < Delayed::Job.db_time_now + 10.minutes

lib/delayed/compatibility.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,13 @@
33
module Delayed
44
module Compatibility
55
if ActiveSupport::VERSION::MAJOR >= 4
6-
require 'active_support/proxy_object'
7-
86
def self.executable_prefix
97
'bin'
108
end
11-
12-
def self.proxy_object_class
13-
ActiveSupport::ProxyObject
14-
end
159
else
16-
require 'active_support/basic_object'
17-
1810
def self.executable_prefix
1911
'script'
2012
end
21-
22-
def self.proxy_object_class
23-
ActiveSupport::BasicObject
24-
end
2513
end
2614
end
2715
end

lib/delayed/message_sending.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
module Delayed
2-
class DelayProxy < Delayed::Compatibility.proxy_object_class
2+
class DelayProxy < BasicObject
3+
# What additional methods exist on BasicObject has changed over time
4+
(::BasicObject.instance_methods - [:__id__, :__send__, :instance_eval, :instance_exec]).each do |method|
5+
undef_method method
6+
end
7+
8+
# Let DelayProxy raise exceptions.
9+
def raise(*args)
10+
::Object.send(:raise, *args)
11+
end
12+
313
def initialize(payload_class, target, options)
414
@payload_class = payload_class
515
@target = target

0 commit comments

Comments
 (0)