Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop EOL Ruby and Rails versions support #33

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 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,26 +8,11 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['2.6', '2.7', '3.0', '3.1', '3.2']
ruby: ['3.0', '3.1', '3.2']
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
exclude:
- ruby: '3.2'
gemfile: gemfiles/rails_5_2.gemfile
- ruby: '3.1'
gemfile: gemfiles/rails_5_2.gemfile
- ruby: '3.0'
gemfile: gemfiles/rails_5_2.gemfile
- ruby: '2.7'
gemfile: gemfiles/rails_7_1.gemfile
- ruby: '2.6'
gemfile: gemfiles/rails_7_1.gemfile
- ruby: '2.6'
gemfile: gemfiles/rails_7_0.gemfile
services:
postgres:
image: postgres
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Ruby 2.7
- name: Set up Ruby 3.0
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.0
bundler-cache: true
- name: Run Linter
run: bundle exec rubocop --parallel
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ inherit_mode:
- Exclude

AllCops:
TargetRubyVersion: 2.6
TargetRubyVersion: 3.0
Exclude:
- 'lib/generators/delayed/templates/*.rb'
NewCops: enable

Rails/EnvironmentVariableAccess:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false
16 changes: 4 additions & 12 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 99999`
# on 2023-01-20 19:16:15 UTC using RuboCop version 1.43.0.
# on 2023-12-28 21:29:05 UTC using RuboCop version 1.59.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -33,6 +33,7 @@ Lint/ConstantDefinitionInBlock:
- 'spec/message_sending_spec.rb'

# Offense count: 2
# Configuration parameters: AllowedParentClasses.
Lint/MissingSuper:
Exclude:
- 'lib/delayed/message_sending.rb'
Expand All @@ -50,7 +51,7 @@ Lint/SuppressedException:
- 'lib/delayed/backend/base.rb'

# Offense count: 4
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes, Max.
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
Metrics/AbcSize:
Exclude:
- 'lib/delayed/message_sending.rb'
Expand All @@ -62,14 +63,6 @@ RSpec/AnyInstance:
Exclude:
- 'spec/delayed/job_spec.rb'

# Offense count: 18
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/BeEq:
Exclude:
- 'spec/delayed/job_spec.rb'
- 'spec/delayed/priority_spec.rb'
- 'spec/message_sending_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
Expand Down Expand Up @@ -165,11 +158,10 @@ Rake/DuplicateTask:
Exclude:
- 'Rakefile'

# Offense count: 4
# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
Security/YAMLLoad:
Exclude:
- 'spec/delayed/serialization/active_record_spec.rb'
- 'spec/helper.rb'
- 'spec/yaml_ext_spec.rb'

Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.5
3.2.2
12 changes: 0 additions & 12 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
appraise 'rails-5-2' do
gem 'actionmailer', '~> 5.2.0'
gem 'activejob', '~> 5.2.0'
gem 'activerecord', '~> 5.2.0'
end

appraise 'rails-6-0' do
gem 'actionmailer', '~> 6.0.0'
gem 'activejob', '~> 6.0.0'
gem 'activerecord', '~> 6.0.0'
end

appraise 'rails-6-1' do
gem 'actionmailer', '~> 6.1.0'
gem 'activejob', '~> 6.1.0'
Expand Down
6 changes: 3 additions & 3 deletions delayed.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']
spec.summary = 'a multi-threaded, SQL-driven ActiveJob backend used at Betterment to process millions of background jobs per day'

spec.version = '0.5.2'
spec.version = '0.6.0'
spec.metadata = {
'changelog_uri' => 'https://github.com/betterment/delayed/blob/main/CHANGELOG.md',
'bug_tracker_uri' => 'https://github.com/betterment/delayed/issues',
'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.1'
spec.add_dependency 'concurrent-ruby'
end
2 changes: 1 addition & 1 deletion lib/delayed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
module Delayed
autoload :PerformableMailer, 'delayed/performable_mailer'

mattr_accessor(:default_log_level) { 'info'.freeze }
mattr_accessor(:default_log_level) { 'info' }
mattr_accessor(:plugins) do
[
Delayed::Plugins::Instrumentation,
Expand Down
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/monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def run!
attr_reader :jobs

def emit_metric!(metric)
send("#{metric}_grouped").reverse_merge(default_results).each do |(priority, queue), value|
send(:"#{metric}_grouped").reverse_merge(default_results).each do |(priority, queue), value|
ActiveSupport::Notifications.instrument(
"delayed.job.#{metric}",
default_tags.merge(priority: Priority.new(priority).to_s, queue: queue, value: value),
Expand Down
8 changes: 1 addition & 7 deletions lib/delayed/performable_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@ def display_name
end

def perform
return unless object

if kwargs.nil? || (RUBY_VERSION < '2.7' && kwargs.empty?)
Irving-Betterment marked this conversation as resolved.
Show resolved Hide resolved
object.send(method_name, *args)
else
object.send(method_name, *args, **kwargs)
end
object.send(method_name, *args, **kwargs) if object
end

def method(sym)
Expand Down
Loading