Use Rails 7.2 defaults#799
Conversation
You can see new settings at [1], they all seem safe for us to switch to. I'll monitor RAM usage in Heroku after deploying because of the YJIT change. [1] https://redirect.github.com/rails/rails/blob/v7.2.3.1/railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_2.rb.tt
This was suggested by the rails upgrade tool
Test coverage89.73% line coverage reported by SimpleCov. |
There was a problem hiding this comment.
Pull request overview
Updates the app to opt into Rails 7.2 framework defaults (as prep work for the Rails 8 upgrade) and adds a RuboCop binstub to run RuboCop with an explicit config file.
Changes:
- Switch
config.load_defaultsfrom 7.1 to 7.2. - Add
bin/rubocopwrapper to run RuboCop using the repo’s.rubocop.yml.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| config/application.rb | Opts the app into Rails 7.2 default configuration behavior. |
| bin/rubocop | Adds a RuboCop binstub that forces use of the repository config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was confusing as the logger was configured twice in this file. Previous versions of rails didn't log to STDOUT in prod by default, they do now so we can remove this and the log_formatter setting. The formatter is also not used if the logger is set [1] [1] https://guides.rubyonrails.org/configuring.html#config-log-formatter
abcampo-iry
left a comment
There was a problem hiding this comment.
I just checked, we have in Gemfile:
gem 'rails', '~> 7.1'
and in Lockfile
7.2.3.1
maybe we want to make it explicit, in the upgrade by adding in Gemfile:
gem 'rails', '~> 7.2'
(although we are effecitvely in that version)
otherwise good, thanks
Split out of #784
You can see new settings at [1], they all seem safe for us to switch to.
This is in preparation for upgrading to Rails 8 and later using those defaults.
I'll monitor RAM usage in Heroku after deploying because of the YJIT change.
[1] https://redirect.github.com/rails/rails/blob/v7.2.3.1/railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_2.rb.tt