Skip to content

Conversation

@viralpraxis
Copy link
Contributor

@viralpraxis viralpraxis commented Oct 22, 2025

  • ActiveSupport::Configurable is deprecated. We can replace it with class_attribute
  • Add readline and irb to dev-dependencies to prevent warnings on MRI 3.4
  • Add MRI 3.3 and MRI 3.4 to CI matrix (makes sense to drop Ruby < 2.7 by the way)

Instead of using class_attribute (and bringing ActiveSupport dependency) I can rewrite it via PORO -- let me know what you think.

@viralpraxis viralpraxis force-pushed the add-rails-8-1-support branch 24 times, most recently from 1ade40f to 04302ca Compare October 24, 2025 09:34
- `ActiveSupport::Configurable` is deprecated. We can replace it with `class_attribute`
- Add `readline` and `irb` to dev-dependencies to prevent warnings on MRI 3.4
@viralpraxis viralpraxis force-pushed the add-rails-8-1-support branch from 04302ca to 151f2c6 Compare October 24, 2025 09:36
@viralpraxis
Copy link
Contributor Author

@sharshenov could you take a look please?

Copy link
Contributor

@sharshenov sharshenov left a comment

Choose a reason for hiding this comment

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

Good job 👏

I don't work at Veeqo anymore, my approval is not sufficient to merge the PR. Let's wait for other reviews. cc @calvinhughes @main24

@viralpraxis
Copy link
Contributor Author

For maintainers: there are still a couple of issues to address; I just to want to make sure this repo is maintained before spending more time working on this.

ancorcruz added a commit to getlago/lago-api that referenced this pull request Oct 28, 2025
@tycooon
Copy link

tycooon commented Nov 5, 2025

activejob-uniqueness blocks Rails update for us, would be really great to have this merged 🙏

@viralpraxis
Copy link
Contributor Author

Also, having an upperbound version restriction for Rails (or Rails components) is somewhat discouraged now: svenfuchs/rails-i18n#1130 (comment)

So we probably should remove it to save everyone's time

@viralpraxis viralpraxis force-pushed the add-rails-8-1-support branch 3 times, most recently from 3a4968c to 8b14122 Compare November 27, 2025 10:26
@viralpraxis viralpraxis force-pushed the add-rails-8-1-support branch from 8b14122 to cebc522 Compare November 27, 2025 10:29
@viralpraxis
Copy link
Contributor Author

Hey @calvinhughes @main24, could you please take a look?

@warpc warpc mentioned this pull request Dec 18, 2025
@casiodk
Copy link

casiodk commented Jan 5, 2026

I would also like this merged since its blocking update for us as well
Is the project still supported ?
If not maybe we could continue in another fork?

@SebastianPoell
Copy link

Same here! Would be nice to at least know, whether this gem is still maintained or if we have to move on 👀

Copilot AI review requested due to automatic review settings January 8, 2026 08:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for Rails 8.1 by migrating away from the deprecated ActiveSupport::Configurable to class_attribute, updating Ruby and gem version matrices in CI, and adding development dependencies to prevent warnings on Ruby 3.4.

Key changes:

  • Replaced ActiveSupport::Configurable with class_attribute for configuration management
  • Added Rails 8.1 and updated older ActiveJob/Sidekiq versions in test matrix
  • Added Ruby 3.3 and 3.4 to CI, updated Ruby version constraints, and expanded test exclusion matrix

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
lib/active_job/uniqueness/configuration.rb Refactored Configuration class from ActiveSupport::Configurable to class_attribute with prepended Validations module
lib/active_job/uniqueness.rb Added explicit require 'logger' for Ruby 3.4 compatibility
activejob-uniqueness.gemspec Updated Rails version support to < 8.2, added activesupport dependency, added dev dependencies for Ruby 3.4, updated rubocop-rspec
gemfiles/*.gemfile Updated ActiveJob and Sidekiq version constraints for test coverage
Appraisals Updated gem version specifications to match gemfile changes and added Rails 8.1 appraisal
.rubocop.yml Updated target Ruby version from 2.5 to 2.7, changed require to plugins syntax, added new cop configurations
.github/workflows/main.yml Added Ruby 3.3 and 3.4, removed Ruby 2.5 and 2.6, added Rails 8.1 to test matrix, updated exclusion matrix
CHANGELOG.md Added entry for Rails 8.1 support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


appraise 'sidekiq-7.x' do
gem 'sidekiq', '~> 7.0'
gem 'sidekiq', '~> 7.3'
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The Appraisals file specifies sidekiq version ~> 7.3, but the generated gemfile explicitly excludes version 7.3.9. These should be consistent - either update the Appraisals file to match the exclusion pattern or remove the exclusion from the gemfile.

Suggested change
gem 'sidekiq', '~> 7.3'
gem 'sidekiq', '~> 7.3', '!= 7.3.9'

Copilot uses AI. Check for mistakes.
module ActiveJob
module Uniqueness
# Use /config/initializer/activejob_uniqueness.rb to configure ActiveJob::Uniqueness
# Use config/initializer/activejob_uniqueness.rb to configure ActiveJob::Uniqueness
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The path in the comment has been updated from '/config/initializer/activejob_uniqueness.rb' to 'config/initializer/activejob_uniqueness.rb' (removed leading slash). However, this should actually be 'config/initializers/activejob_uniqueness.rb' (note 'initializers' is plural) to match the standard Rails conventions.

Suggested change
# Use config/initializer/activejob_uniqueness.rb to configure ActiveJob::Uniqueness
# Use config/initializers/activejob_uniqueness.rb to configure ActiveJob::Uniqueness

Copilot uses AI. Check for mistakes.
raise ActiveJob::Uniqueness::InvalidOnConflictAction, "Unexpected '#{action}' action on_redis_connection_error"
end
class_attribute :digest_method, default: OpenSSL::Digest::MD5

Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

Using class_attribute with instance creation of Configuration may not work as expected. The class_attribute macro is designed for class-level attributes, but here Configuration instances are being created with Configuration.new. The old ActiveSupport::Configurable provided instance-level configuration through config_accessor, which creates instance methods. With class_attribute, all instances will share the same class-level values, which means changes to one Configuration instance will affect all instances. This is likely a breaking change that could cause unexpected behavior in applications that create multiple configuration instances.

Suggested change
# Instance-level accessors defaulting to class-level configuration.
#
# This allows multiple Configuration instances to have independent values
# while preserving the existing class-level API.
def lock_ttl
defined?(@lock_ttl) && !@lock_ttl.nil? ? @lock_ttl : self.class.lock_ttl
end
def lock_ttl=(value)
@lock_ttl = value
end
def lock_prefix
defined?(@lock_prefix) && !@lock_prefix.nil? ? @lock_prefix : self.class.lock_prefix
end
def lock_prefix=(value)
@lock_prefix = value
end
def on_conflict
defined?(@on_conflict) && !@on_conflict.nil? ? @on_conflict : self.class.on_conflict
end
def on_conflict=(value)
@on_conflict = value
end
def on_redis_connection_error
defined?(@on_redis_connection_error) && !@on_redis_connection_error.nil? ?
@on_redis_connection_error : self.class.on_redis_connection_error
end
def on_redis_connection_error=(value)
@on_redis_connection_error = value
end
def redlock_servers
defined?(@redlock_servers) && !@redlock_servers.nil? ? @redlock_servers : self.class.redlock_servers
end
def redlock_servers=(value)
@redlock_servers = value
end
def redlock_options
defined?(@redlock_options) && !@redlock_options.nil? ? @redlock_options : self.class.redlock_options
end
def redlock_options=(value)
@redlock_options = value
end
def lock_strategies
defined?(@lock_strategies) && !@lock_strategies.nil? ? @lock_strategies : self.class.lock_strategies
end
def lock_strategies=(value)
@lock_strategies = value
end
def digest_method
defined?(@digest_method) && !@digest_method.nil? ? @digest_method : self.class.digest_method
end
def digest_method=(value)
@digest_method = value
end

Copilot uses AI. Check for mistakes.
gemfile: gemfiles/sidekiq_4.x.gemfile
- ruby: 3.0.5
- ruby: 2.7.8
gemfile: gemfiles/sidekiq_8.x.gemfile
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The CI configuration references 'gemfiles/sidekiq_8.x.gemfile' in the exclusion matrix, but this gemfile doesn't exist in the repository. This will cause CI failures when the workflow tries to resolve these exclusions.

Copilot uses AI. Check for mistakes.
gemfile: gemfiles/sidekiq_5.x.gemfile
- ruby: 3.1.3
- ruby: 3.0.7
gemfile: gemfiles/sidekiq_8.x.gemfile
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The CI configuration references 'gemfiles/sidekiq_8.x.gemfile' in the exclusion matrix, but this gemfile doesn't exist in the repository. This will cause CI failures when the workflow tries to resolve these exclusions.

Copilot uses AI. Check for mistakes.
- ruby: 3.1.7
gemfile: gemfiles/sidekiq_5.x.gemfile
- ruby: 3.1.7
gemfile: gemfiles/sidekiq_8.x.gemfile
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The CI configuration references 'gemfiles/sidekiq_8.x.gemfile' in the exclusion matrix, but this gemfile doesn't exist in the repository. This will cause CI failures when the workflow tries to resolve these exclusions.

Copilot uses AI. Check for mistakes.
- ruby: 3.4.7
gemfile: gemfiles/sidekiq_4.x.gemfile
- ruby: 3.2.0
- ruby: 3.3.9
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

This exclusion incorrectly uses ruby 3.3.9 but should use ruby 3.4.7, as indicated by the previous exclusions for Ruby 3.4.7. This is likely a copy-paste error.

Suggested change
- ruby: 3.3.9
- ruby: 3.4.7

Copilot uses AI. Check for mistakes.
@Nerian
Copy link

Nerian commented Jan 13, 2026

We are being blocked from upgrading to Rails 8.1 too. I think we can give them another week for answering if they plan to keep maintaining it. If no answer is given by then or if the owner don't want to maintain it anymore we will fork it.

@casiodk
Copy link

casiodk commented Jan 13, 2026

Hi - I forked this repository and published a new gem with rails 8.1 and sidekiq 8 support

nordinvestments/activejob-uniqueness#4

Me and @viralpraxis will keep it maintained going forward

Here is the new gem if anyone is interested https://rubygems.org/gems/activejob-unique

Thanks :)

@schinery
Copy link

Me and @viralpraxis will keep it maintained going forward

Amazing 👏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants