Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
17 changes: 1 addition & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,21 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
ruby: ['3.0', '3.1', '3.2', '3.3']
gemfile:
- gemfiles/rails_5_2.gemfile
- gemfiles/rails_6_0.gemfile
- gemfiles/rails_6_1.gemfile
- gemfiles/rails_7_0.gemfile
- gemfiles/rails_7_1.gemfile
- gemfiles/rails_7_2.gemfile
- gemfiles/rails_8_0.gemfile
exclude:
- ruby: '3.3'
gemfile: gemfiles/rails_5_2.gemfile
- ruby: '3.2'
gemfile: gemfiles/rails_5_2.gemfile
- ruby: '3.1'
gemfile: gemfiles/rails_8_0.gemfile
- ruby: '3.1'
gemfile: gemfiles/rails_5_2.gemfile
- ruby: '3.0'
gemfile: gemfiles/rails_7_2.gemfile
- ruby: '3.0'
gemfile: gemfiles/rails_8_0.gemfile
- ruby: '3.0'
gemfile: gemfiles/rails_5_2.gemfile
- ruby: '2.7'
gemfile: gemfiles/rails_8_0.gemfile
- ruby: '2.7'
gemfile: gemfiles/rails_7_2.gemfile
- ruby: '2.7'
gemfile: gemfiles/rails_7_1.gemfile
services:
postgres:
image: postgres
Expand Down
3 changes: 2 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ inherit_mode:
- Exclude

AllCops:
TargetRubyVersion: 2.6
TargetRubyVersion: 3.0
TargetRailsVersion: 6.0
Exclude:
- 'gemfiles/*.gemfile'
- 'lib/generators/delayed/templates/*.rb'
Expand Down
7 changes: 0 additions & 7 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
appraise 'rails-5-2' do
gem 'actionmailer', '~> 5.2.0'
gem 'activejob', '~> 5.2.0'
gem 'activerecord', '~> 5.2.0'
gem 'sqlite3', '~> 1.3', '>= 1.3.6'
end

appraise 'rails-6-0' do
gem 'actionmailer', '~> 6.0.0'
gem 'activejob', '~> 6.0.0'
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PATH
remote: .
specs:
delayed (1.0.0)
activerecord (>= 5.2)
delayed (2.0.0)
activerecord (>= 6.0)
concurrent-ruby

GEM
Expand Down
4 changes: 2 additions & 2 deletions delayed.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Gem::Specification.new do |spec|
'source_code_uri' => 'https://github.com/betterment/delayed',
'rubygems_mfa_required' => 'true',
}
spec.required_ruby_version = '>= 2.6'
spec.required_ruby_version = '>= 3.0'

spec.add_dependency 'activerecord', '>= 5.2'
spec.add_dependency 'activerecord', '>= 6.0'
spec.add_dependency 'concurrent-ruby'
end
18 changes: 0 additions & 18 deletions gemfiles/rails_5_2.gemfile

This file was deleted.

2 changes: 1 addition & 1 deletion lib/delayed/backend/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def failed?
end
alias failed failed?

ParseObjectFromYaml = %r{!ruby/\w+:([^\s]+)}.freeze # rubocop:disable Naming/ConstantName
ParseObjectFromYaml = %r{!ruby/\w+:([^\s]+)} # rubocop:disable Naming/ConstantName

def name # rubocop:disable Metrics/AbcSize
@name ||= payload_object.job_data['job_class'] if payload_object.respond_to?(:job_data)
Expand Down
2 changes: 1 addition & 1 deletion lib/delayed/performable_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def display_name
def perform
return unless object

if kwargs.nil? || (RUBY_VERSION < '2.7' && kwargs.empty?)
if kwargs.nil?
object.send(method_name, *args)
else
object.send(method_name, *args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion lib/delayed/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Delayed
VERSION = '1.0.0'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still stick to a minor bump when dropping a ruby version. See this webvalve commit, for example. Its parent is a commit dropping older ruby and rails versions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I second on being the preferred approach (so far). However, this internal conversation brought the necessity for a major version cut. cc @smudge

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see, I wasn't aware of that convo.

@Irving-Betterment Irving-Betterment Sep 12, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up: The updated consensus is to keep cutting minors for dependency drops.

VERSION = '2.0.0'
end
24 changes: 6 additions & 18 deletions spec/delayed/active_job_adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ def deserialize(*)
/ priority: ?\n/,
" arguments: []\n",
" executions: 0\n",
(" exception_executions: {}\n" if ActiveJob.gem_version >= Gem::Version.new('6.0')),
" exception_executions: {}\n",
" locale: en\n",
(/ timezone: ?\n/ if ActiveJob.gem_version >= Gem::Version.new('6.0')),
(/ enqueued_at: '2023-01-20T18:52:29(\.\d+)?Z'\n/ if ActiveJob.gem_version >= Gem::Version.new('6.0')),
/ timezone: ?\n/,
/ enqueued_at: '2023-01-20T18:52:29(\.\d+)?Z'\n/,
(/ scheduled_at: ?\n/ if ActiveJob.gem_version >= Gem::Version.new('7.1')),
].compact
end
Expand Down Expand Up @@ -358,11 +358,7 @@ def perform(arg, kwarg:)
it 'applies the default ActiveJob queue and priority' do
JobClass.perform_later

if ActiveJob.gem_version < Gem::Version.new('6')
expect(JobClass.queue_adapter.enqueued_jobs.first).to include(job: JobClass, queue: 'default')
else
expect(JobClass.queue_adapter.enqueued_jobs.first).to include(job: JobClass, 'priority' => nil, queue: 'default')
end
expect(JobClass.queue_adapter.enqueued_jobs.first).to include(job: JobClass, 'priority' => nil, queue: 'default')
end

context 'when ActiveJob specifies a different default queue and priority' do
Expand All @@ -374,22 +370,14 @@ def perform(arg, kwarg:)
it 'applies the default ActiveJob queue and priority' do
JobClass.perform_later

if ActiveJob.gem_version < Gem::Version.new('6')
expect(JobClass.queue_adapter.enqueued_jobs.first).to include(job: JobClass, queue: 'aj_default')
else
expect(JobClass.queue_adapter.enqueued_jobs.first).to include(job: JobClass, 'priority' => 11, queue: 'aj_default')
end
expect(JobClass.queue_adapter.enqueued_jobs.first).to include(job: JobClass, 'priority' => 11, queue: 'aj_default')
end
end

it 'supports overriding queue, priority, and wait_until' do
JobClass.set(queue: 'a', priority: 3, wait_until: arbitrary_time).perform_later

if ActiveJob.gem_version < Gem::Version.new('6')
expect(JobClass.queue_adapter.enqueued_jobs.first).to include(job: JobClass, queue: 'a', at: arbitrary_time.to_f)
else
expect(JobClass.queue_adapter.enqueued_jobs.first).to include(job: JobClass, 'priority' => 3, queue: 'a', at: arbitrary_time.to_f)
end
expect(JobClass.queue_adapter.enqueued_jobs.first).to include(job: JobClass, 'priority' => 3, queue: 'a', at: arbitrary_time.to_f)
end
end
end
Expand Down