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
Fix cleanup! and prepare! Deprecations with Rails 5 #948
Fix cleanup! and prepare! Deprecations with Rails 5 #948
Conversation
Hi , any reason for this PR not to be merged ? |
@thomasdarde because the build failed. |
@atomaka Hi andrew, do you think you can update your PR for the build to pass ? Or tell me and I'll create another one |
I'll take a look this evening. The build is failing because of a dependency issue on JRuby builds and, unfortunately, I haven't used JRuby. I briefly look at this five months ago when I submitted the PR, but didn't see an immediate fix. If this will be considered for merge, though, I'll spend a bit more time to get it to pass the builds. For those that are still struggling with this, you can monkey patch on load to save yourselves from the log headaches: #944 (comment) |
Thanks @atomaka , maybe just rebasing the PR will solve the issue, I hope it's not to much work. |
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.
Couple of nit picks, but then we can probably get this merged in.
.gitignore
Outdated
@@ -5,3 +5,4 @@ | |||
.rvmrc | |||
/coverage | |||
Gemfile.lock | |||
.ruby-version |
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.
Nit pick, can we not include this please
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.
This was just for my personal testing. This isn't prepared. Seeing what it takes to pass build.
Gemfile
Outdated
if rails_version == 'edge' || rails_version.match(/5\.\d+\.\d+/) | ||
gem 'activerecord-jdbcsqlite3-adapter', | ||
git: 'https://github.com/jruby/activerecord-jdbc-adapter.git', | ||
branch: 'rails-5' |
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.
Maybe add a comment here about when this can be taken out.
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.
Yup. See first comment. Still in process of testing. See comment I am about to type
Sorry for the inactivity, things have been kind of crazy for me |
The issue here is that the activerecord-jdbc-adapter no longer works with Rails 5. There's a long lived issue about it dating back to December 2015. It was closed for some reason, but the issue persists (as can bee seen in the comment history). There is a branch that has Rails 5 support (that I am testing builds against now), but I don't know the support level on that branch. It might be wiser to drop Rails 5 support with Jruby until they resolve the issue upstream. |
73a92a4
to
05af003
Compare
Using Delayed::Job with Rails 5 will currently spam logs with a deprecation message for cleanup! and prepare! in favor of ActiveSupport::Reloader. When ActiveSupport::Reloader is present, it will be used. Otherwise, it will fall back to cleanup! and prepare!.
05af003
to
ae6f976
Compare
See jruby/activerecord-jdbc-adapter#700 which is unresolved since December 2015, but closed. A branch exists and we can try using that to maintain support.
ae6f976
to
d5af5c5
Compare
d5af5c5
to
f2a2850
Compare
2 similar comments
Some important notes for this: BlockLength cop was disabled completely because of a large amount of violations in the specs. DuplicatedGem cop was disabled completely because we are using conditionals to determine Gem versions and it was being triggered. I don't see any other options for this cop so it looks like the only option is to ignore. YAMLLoad wants to use safe_load over load. Not sure that's supported on older versions A few cops were disabled in specific code locations because I did not know enough about the code to update and be sure that there was no risk.
f2a2850
to
740bbca
Compare
3 similar comments
3 similar comments
8877f67
to
d2383c4
Compare
Only one more build failure. Rails 4.2.0 on Ruby 2.0 because of a Nokogiri issue. I'm not sure how to resolve, especially since when I reproduce locally, the correct version of Nokogiri is installed.
Full version in gist: https://gist.github.com/atomaka/ba5f4909cb82e07347b6181ad2f5948f |
3 similar comments
Based on some code from DelayedJob that seems to work. collectiveidea/delayed_job#948
Based on some code from DelayedJob that seems to work. collectiveidea/delayed_job#948
Still not in master to work with Rails 5.1? 🤔 |
@albus522 What's required to get this released in a new version of the gem? |
Rails 5 deprecates
cleanup!
andprepare!
causing a large amount of log spam from Delayed::Job:The first commit fixes existing issues with rubocop. Any easy corrections were made. Those that required refactorings were disabled.