Skip to content

Chore: Upgrade to Rails 8.1#5253

Open
ChargrilledChook wants to merge 1 commit intomainfrom
chore/upgrade-rails-8.1
Open

Chore: Upgrade to Rails 8.1#5253
ChargrilledChook wants to merge 1 commit intomainfrom
chore/upgrade-rails-8.1

Conversation

@ChargrilledChook
Copy link
Copy Markdown
Member

@ChargrilledChook ChargrilledChook commented Mar 8, 2026

Chore: Upgrade to Rails 8.1

This commit:

  • Bump Rails version and run upgrade task
  • Bump brakeman and ignore existing warnings
  • Fix Rack :unprocessable_entity deprecation warning
  • Bump Devise to resolve routing deprecation warnings
  • Bump ViewComponent to fix ActiveSupport::Configurable Deprecation
  • Toggle on new framework defaults + update snapshots
  • Add new local CI DSL and align to our current scripts
  • Add bundler and npm security audits to CI script

@github-project-automation github-project-automation bot moved this to 📋 Backlog / Ideas in Main Site Mar 8, 2026
@KevinMulhern KevinMulhern temporarily deployed to odin-review-app-pr-5253 March 8, 2026 00:36 Inactive
redirect_to edit_admin_profile_path, notice: 'Password updated'
else
render 'admin/profile/edit', status: :unprocessable_entity
render 'admin/profile/edit', status: :unprocessable_content
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixes a Rack deprecation warning

'Standard' => false,
'Stylelint' => false
}
puts 'DEPRECATION WARNING: bin/test is deprecated. Use bin/ci instead.'
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I wrote this script originally, serves the same purpose as the new inbuilt DSL

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Auto generated todo file. Can now pass and warn on newly introduced issues instead

# Run using bin/ci

CI.run do
# TODO: Consider adding bin/setup
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Bundler / npm audit are new, the rest are based on the previous bin/test command

gem 'class_variants', '~> 1.1'
gem 'cssbundling-rails', '~> 1.4'
gem 'devise', '~> 4.9'
gem 'devise', '~> 5.0'
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Bumped to fix a deprecation warning for passing hashes to routes

gem 'stimulus-rails', '~> 1.3'
gem 'turbo-rails', '~> 2.0'
gem 'view_component', '~> 4.0'
gem 'view_component', '~> 4.5'
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Bumped to fix a deprecation warning about the removal of ActiveSupport::Configurable

@ChargrilledChook ChargrilledChook changed the title Bump Rails version and run upgrade task Chore: Upgrade to Rails 8.1 Mar 8, 2026
This commit:
  * Bump Rails version and run upgrade task
  * Bump brakeman and ignore existing warnings
  * Fix Rack :unprocessable_entity deprecation warning
  * Bump Devise to resolve routing deprecation warnings
  * Bump ViewComponent to fix ActiveSupport::Configurable Deprecation
  * Toggle on new framework defaults + update snapshots
  * Add new local CI DSL and align to our current scripts
  * Add bundler and npm security audits to CI script
@ChargrilledChook ChargrilledChook force-pushed the chore/upgrade-rails-8.1 branch from 65f2127 to adb6d87 Compare March 8, 2026 01:25
@ChargrilledChook ChargrilledChook temporarily deployed to odin-review-app-pr-5253 March 8, 2026 01:26 Inactive
@ChargrilledChook ChargrilledChook marked this pull request as ready for review March 8, 2026 01:42
@ChargrilledChook ChargrilledChook requested review from JoshDevHub and KevinMulhern and removed request for JoshDevHub March 8, 2026 01:42
Copy link
Copy Markdown
Contributor

@JoshDevHub JoshDevHub left a comment

Choose a reason for hiding this comment

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

Seems awesome to me 👍

Two minor changes to suggest in .rubocop.yml:

  • The Target Rails Version should be bumped.
  • We'd temporarily disabled the HttpStatusNameConsistency cop (it looks for unprocessable_content instead of unprocessable_entity). Since you've converted the codebase over to unprocessable_content, that cop should be re-enabled.

@github-project-automation github-project-automation bot moved this from 📋 Backlog / Ideas to 🏗 In progress in Main Site Mar 9, 2026
@JoshDevHub
Copy link
Copy Markdown
Contributor

I think an update to the testing section of the CONTRIBUTING guide could be nice too. It was already out of sync with the commands necessary to pass CI, but with this, you should be able to simplify down to telling contributors to run bin/ci.

@ChargrilledChook
Copy link
Copy Markdown
Member Author

I think an update to the testing section of the CONTRIBUTING guide could be nice too. It was already out of sync with the commands necessary to pass CI, but with this, you should be able to simplify down to telling contributors to run bin/ci.

Good call, I'll add. I was unsure where the canonical instructions lived anymore, since there's been a bit of drift between the wiki / various contributing files

@ChargrilledChook
Copy link
Copy Markdown
Member Author

Seems awesome to me 👍

Two minor changes to suggest in .rubocop.yml:

  • The Target Rails Version should be bumped.

Good catch 👌

  • We'd temporarily disabled the HttpStatusNameConsistency cop (it looks for unprocessable_content instead of unprocessable_entity). Since you've converted the codebase over to unprocessable_content, that cop should be re-enabled.

For context, Rack is just aligning with RFC 9110

It looks like Rails already handles status code transforms, but there are parts of Devise where this doesn't happen.

We could keep using the old status code by changing a setting in the Devise initialiser instead, but it seems more future proof to just align with Rack. It was fairly painless to make the switch

@JoshDevHub
Copy link
Copy Markdown
Contributor

JoshDevHub commented Mar 10, 2026

For context, Rack is just aligning with RFC 9110

It looks like Rails already handles status code transforms, but there are parts of Devise where this doesn't happen.

We could keep using the old status code by changing a setting in the Devise initialiser instead, but it seems more future proof to just align with Rack. It was fairly painless to make the switch

Yeah I think it's fine to use the new code.

The only rub for me is that Rails itself (like you said) makes sure Rack receives the code it wants even if you write unprocessable_entity in your app code. As a consequence of this, they've done nothing to update documentation or scaffold generators over to using the new name, and I'm not sure when (or if) they will.

But yeah, I think it's sensible to change still because other tools (Devise, RSpec, etc.) don't seem to be doing the same transform in their interactions with Rack. Plus it's an autocorrectable offense so even if someone scaffolds or copies some stuff from the docs, it can be cleaned up with a simple rubocop -a with little friction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

3 participants