Skip to content
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 to Rails 7.1 #733

Merged
merged 5 commits into from
Nov 2, 2023
Merged

Upgrade to Rails 7.1 #733

merged 5 commits into from
Nov 2, 2023

Conversation

brucebolt
Copy link
Member

Rails 7.1.1 was updated in #725 without also running the Rails update task.

This runs the task, updating the config where necessary.

Trello card

@brucebolt brucebolt force-pushed the update-rails-7.1 branch 2 times, most recently from 94874d2 to 0de67bb Compare November 1, 2023 08:33
@brucebolt brucebolt marked this pull request as ready for review November 1, 2023 08:33
Copy link
Contributor

@jkempster34 jkempster34 left a comment

Choose a reason for hiding this comment

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

LGTM. One question about logging

# require "syslog/logger"
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')

if ENV["RAILS_LOG_TO_STDOUT"].present?
Copy link
Contributor

@jkempster34 jkempster34 Nov 1, 2023

Choose a reason for hiding this comment

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

Does it matter that logging to stdout is now the default instead of being controlled by this env variable?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good spot. I think I'll retain that environment variable to maintain the existing behaviour.

@@ -28,7 +29,7 @@
config.cache_store = :null_store

# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
config.action_dispatch.show_exceptions = :rescuable
Copy link
Contributor

Choose a reason for hiding this comment

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

Just read up on this, seems :rescuable is more appropriate than :none 👍

Rails 7.1.1 was updated through Dependabot without also running the
Rails update task.

This runs the task, updating the config where necessary.
This removes the defaults file, as we now switch to using Rails 7.1
defaults.
From Rails 7.2, the keyword `type` must be specified.
Prior to Rails 7.1, the default coder for `serialize` was YAML. Now it
is `nil` and requires the user to make a choice.

Therefore retaining YAML, to maintain backward compatibility.
This test started failing in Rails 7.1, as the default value of
`config.action_dispatch.show_exceptions` was changed from `false` to
`:rescuable`. This means we now render a nice 404 response rather than
raising an exception, but need to update the test to match this.

See https://mattbrictson.com/blog/rails-71-features#1-finally-we-can-write-proper-integration-tests-for-errors
for some more information.
@brucebolt brucebolt merged commit 032a41e into main Nov 2, 2023
4 checks passed
@brucebolt brucebolt deleted the update-rails-7.1 branch November 2, 2023 10:22
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.

2 participants