-
Notifications
You must be signed in to change notification settings - Fork 10
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
Handle proper values for ActiveJob.enqueue_after_transaction_commit for Rails 7.2 support #43
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,12 @@ appraise 'rails-7-1' do | |
gem 'activerecord', '~> 7.1.0' | ||
end | ||
|
||
appraise 'rails-7-2' do | ||
gem 'actionmailer', '~> 7.2.0' | ||
gem 'activejob', '~> 7.2.0' | ||
gem 'activerecord', '~> 7.2.0' | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: Finish Appraisal set up for Rails 7.2 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you intend to do that in this PR? (While you're at it, mind bumping the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep. Was struggling to get the incantation working to build/install mysql. Should be good now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the version bump requires an update to all of the lockfiles. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bumped |
||
|
||
appraise 'rails-main' do | ||
gem 'actionmailer', github: 'rails/rails', glob: 'actionmailer/*.gemspec' | ||
gem 'activejob', github: 'rails/rails', glob: 'activejob/*.gemspec' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
delayed (0.5.4) | ||
delayed (0.5.5) | ||
activerecord (>= 5.2) | ||
concurrent-ruby | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "actionmailer", "~> 7.2.0" | ||
gem "activejob", "~> 7.2.0" | ||
gem "activerecord", "~> 7.2.0" | ||
gem "appraisal" | ||
gem "betterlint" | ||
gem "mysql2" | ||
gem "pg" | ||
gem "rake" | ||
gem "rspec" | ||
gem "sqlite3", "~> 1.7.3" | ||
gem "timecop" | ||
gem "zeitwerk" | ||
|
||
gemspec path: "../" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ def enqueue_at(job, timestamp) | |
private | ||
|
||
def _enqueue(job, opts = {}) | ||
if job.class.respond_to?(:enqueue_after_transaction_commit) && job.class.enqueue_after_transaction_commit | ||
if job.class.respond_to?(:enqueue_after_transaction_commit) && job.class.enqueue_after_transaction_commit == :always | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't the perfect solution to this problem. The implementation in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, that was my read as well. But, gosh, that Rails API seems like it's going to cause such confusion. I.e. you could set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, feels like there is a missing validation on the value you are passing in. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
raise UnsafeEnqueueError, "The ':delayed' ActiveJob adapter is not compatible with enqueue_after_transaction_commit" | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rails 7.2 has a minimum version of Ruby 3.1. Not sure if I should add an exclusion for Ruby 2.6. Got a sense from this PR that we may be removing Ruby 2.6 support? #42
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is fine for now! Fully dropping Ruby 2.6 doesn't need to be part of this PR.