-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Upgrade/rails 7.1 v2 #4736
Upgrade/rails 7.1 v2 #4736
Conversation
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.
Successfuly deployed a review app on Heroku after some tweaking
This is probably a safe staging point before finishing all the config toggles - I've listed them all out in the issue.
Most will be trivial, but a few will need to be handled with care
# Please, add to the `ignore` list any other `lib` subdirectories that do | ||
# not contain `.rb` files, or that should not be reloaded or eager loaded. | ||
# Common ones are `templates`, `generators`, or `middleware`, for example. | ||
config.autoload_lib(ignore: %w[assets tasks generators]) # TODO |
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.
Related task in the upgrade file. Let me know if there's anything obvious that should go in here, but we'll need to come back to it to finish the upgrade.
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.
Most of these are low risk, some are not.
Can be worked through incrementally without doing all in one go, I reckon
end | ||
|
||
super |
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 doesn't look right, caused by Rubocop fixes. Will investigate
Actually works as expected as far as I can tell 👌
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.
Looks good to me!
@@ -1,7 +1,7 @@ | |||
namespace :heroku do | |||
desc 'Heroku release task - runs on every code push, runs before postdeploy task' | |||
task release: :environment do | |||
if ActiveRecord::SchemaMigration.table_exists? | |||
if ActiveRecord::Base.connection.schema_migration.table_exists? |
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 mildly annoying to debug. Caused heroku release phase to fail.
Caused by "Remove deprecated ActiveRecord::Base config accessors"
@@ -27,7 +27,9 @@ | |||
|
|||
fill_in 'Email', with: other_admin.email | |||
fill_in 'Password', with: other_admin.password | |||
click_button 'Sign in' | |||
within 'form' do |
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.
Appeasing Rubocop caused these to be ambiguous. This was the easiest fix; using test-ids is probably better but I wanted to avoid touching templates for this pass
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.
Strange they've added this rule when it can lead to issues like this. I think click_button
and click_link
communicates the intent way better and avoids these unambiguous matches. Standardrb may be in our future lol
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.
On closer inspection this is a bit of a stitch up 😆 they've deprecrated this rule because of this exact reason.
Unfortunately the change hasn't been released yet and the rule still screams.
I'll disable the rule, revert the changes and add a todo to remove it once the library gets updated
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.
Nice find! stitch up indeed 😆
If its easier to keep those changes in, we can always change them back when the new release eventually appears.
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.
All appears to be good on the review app for me. Nice work @ChargrilledChook!
end | ||
|
||
super |
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.
Looks good to me!
@@ -27,7 +27,9 @@ | |||
|
|||
fill_in 'Email', with: other_admin.email | |||
fill_in 'Password', with: other_admin.password | |||
click_button 'Sign in' | |||
within 'form' do |
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.
Strange they've added this rule when it can lead to issues like this. I think click_button
and click_link
communicates the intent way better and avoids these unambiguous matches. Standardrb may be in our future lol
This commit: * Run bundle update * Run `app:update` task and resolve conflicts in config & env files * Run safe autocorrect fixes for new Rubocop offences * Add rubocop-rspec_rails to Rubcop config * Manually fix new unsafe Rubcop offences * Requires fixing some specs as some elements became ambiguous due to preferring more generic `click_on` Capybara helper instead of `click_link` * Add generators to new `autoload_lib` configuration * Because: CI breaks otherwise * Access schema migration object via base connection in Heroku task * Because: This behaviour was removed in rails 7.1. See https://github.com/rails/rails/blob/7-1-stable/activerecord/CHANGELOG.md * Toggle low risk framework defaults for Rails 7.1
8d76800
to
8384a65
Compare
Partially closes #4735
Supersedes #4477 - easier to start fresh than fix merge conflicts
Will rebase / squash after review