From 4768fa6275fef5720c7a2287bb08e749a3f89b74 Mon Sep 17 00:00:00 2001 From: Laura Feier Date: Mon, 12 Aug 2024 12:25:26 +0300 Subject: [PATCH] Activejob 7.2 support --- .github/workflows/main.yml | 6 ++++++ .rubocop.yml | 3 +++ Appraisals | 4 ++++ activejob-uniqueness.gemspec | 2 +- gemfiles/activejob_7.2.x.gemfile | 7 +++++++ lib/active_job/uniqueness/sidekiq_patch.rb | 4 ++-- 6 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 gemfiles/activejob_7.2.x.gemfile diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e49829c..ef3508a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,6 +26,7 @@ jobs: - 3.0.5 - 3.1.3 - 3.2.0 + - 3.3.4 gemfile: - gemfiles/activejob_4.2.x.gemfile - gemfiles/activejob_5.2.x.gemfile @@ -33,6 +34,7 @@ jobs: - gemfiles/activejob_6.1.x.gemfile - gemfiles/activejob_7.0.x.gemfile - gemfiles/activejob_7.1.x.gemfile + - gemfiles/activejob_7.2.x.gemfile - gemfiles/sidekiq_4.x.gemfile - gemfiles/sidekiq_5.x.gemfile - gemfiles/sidekiq_6.x.gemfile @@ -84,6 +86,10 @@ jobs: gemfile: gemfiles/activejob_6.0.x.gemfile - ruby: 3.2.0 gemfile: gemfiles/activejob_7.1.x.gemfile + - ruby: 3.2.0 + gemfile: gemfiles/activejob_7.2.x.gemfile + - ruby: 3.3.4 + gemfile: gemfiles/activejob_7.2.x.gemfile - ruby: 3.2.0 gemfile: gemfiles/sidekiq_4.x.gemfile - ruby: 3.2.0 diff --git a/.rubocop.yml b/.rubocop.yml index 12ed9b1..93d1e2a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -66,3 +66,6 @@ RSpec/AnyInstance: RSpec/LetSetup: Exclude: - spec/active_job/uniqueness/sidekiq_patch_spec.rb + +Lint/RedundantCopDisableDirective: + Enabled: false diff --git a/Appraisals b/Appraisals index 3469848..e75f051 100644 --- a/Appraisals +++ b/Appraisals @@ -24,6 +24,10 @@ appraise 'activejob-7.1.x' do gem 'activejob', '~> 7.1' end +appraise 'activejob-7.2.x' do + gem 'activejob', '~> 7.2' +end + appraise 'sidekiq-4.x' do gem 'sidekiq', '~> 4.2' gem 'activejob', '~> 5.2' diff --git a/activejob-uniqueness.gemspec b/activejob-uniqueness.gemspec index c0958e9..82c251c 100644 --- a/activejob-uniqueness.gemspec +++ b/activejob-uniqueness.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 2.5' - spec.add_dependency 'activejob', '>= 4.2', '< 7.2' + spec.add_dependency 'activejob', '>= 4.2', '< 7.3' spec.add_dependency 'redlock', '>= 2.0', '< 3' spec.add_development_dependency 'appraisal', '~> 2.3.0' diff --git a/gemfiles/activejob_7.2.x.gemfile b/gemfiles/activejob_7.2.x.gemfile new file mode 100644 index 0000000..935dcf4 --- /dev/null +++ b/gemfiles/activejob_7.2.x.gemfile @@ -0,0 +1,7 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activejob", "~> 7.2" + +gemspec path: "../" diff --git a/lib/active_job/uniqueness/sidekiq_patch.rb b/lib/active_job/uniqueness/sidekiq_patch.rb index b5aa0dc..2b75e60 100644 --- a/lib/active_job/uniqueness/sidekiq_patch.rb +++ b/lib/active_job/uniqueness/sidekiq_patch.rb @@ -41,7 +41,7 @@ def remove_job module ScheduledSet def delete(score, job_id) entry = find_job(job_id) - ActiveJob::Uniqueness.unlock_sidekiq_job!(entry.item) if super(score, job_id) + ActiveJob::Uniqueness.unlock_sidekiq_job!(entry.item) if super(score, job_id) # rubocop:disable Style/SuperArguments entry end end @@ -67,7 +67,7 @@ def clear end def delete_by_value(name, value) - ActiveJob::Uniqueness.unlock_sidekiq_job!(Sidekiq.load_json(value)) if super(name, value) + ActiveJob::Uniqueness.unlock_sidekiq_job!(Sidekiq.load_json(value)) if super(name, value) # rubocop:disable Style/SuperArguments end end end