Skip to content

Commit

Permalink
Rails 7.1 Upgrade (#1186)
Browse files Browse the repository at this point in the history
Fast on the heels of 7.0 here comes the latest and greatest Rails
version!

# What it does

Gets us on Rails 7.1.

# Why it is important

Latest is greatest. And specifically this gets us access to background
preprocessing of variants for finishing #1150

# Implementation notes

* This gets us off the fork of `audited` we were using. The [change we
switched for was
upstreamed](collectiveidea/audited#609) and we
need the [more recent work to make it compatible with Rails
7.1](collectiveidea/audited#686). Just a couple
of code changes were needed and tests seem to be passing okay.
* Updates us to [Devise
4.9.3](https://github.com/heartcombo/devise/blob/main/CHANGELOG.md#493---2023-10-11)
which added Rails 7.1 support.
- Note Devise 4.9.0 [added Hotwire + Turbo
support](https://github.com/heartcombo/devise/blob/main/CHANGELOG.md#490---2023-02-17),
something we might want to take a look at in either #1184 or a follow on
task.
* Includes a bump to Postgres 15 for the Docker and CI setups to match
production.
* The new Rails defaults in 7.1 raise in controllers when you mention an
action that is not defined. This caught a couple of `before_action`
typos.
* Running `rake app:update` yielded diffs on many of the config files. I
took all the changes to `bin` scripts whole hog and merged the rest. A
second set of eyes across those diffs would be helpful though! 👀
* 💥 The upgrade caused an issue with threaded background work in tests
whose fix is at the bottom of `config/environments/test.rb` with a note
explaining.
* 💡 I had neglected to update the Yarn dependencies for Rails in the 7
upgrade, so catching those up here.
* 🚧 Asset compilation now runs on every execution of `bin/rails test`
which made the SCSS deprecation warnings get pretty annoying. Pulling in
a workaround from picturepan2/spectre#694
* Zeitwork (the new code autoloader) did not like
`lib/rails_solargraph.rb`, so following a [comment on the referenced
gist](https://gist.github.com/castwide/28b349566a223dfb439a337aea29713e?permalink_comment_id=4346127#gistcomment-4346127)
I switch us to the solargraph-rails gem.
  • Loading branch information
phinze authored Nov 13, 2023
1 parent 9be5bd4 commit 8b34d23
Show file tree
Hide file tree
Showing 30 changed files with 402 additions and 314 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

services:
postgres:
image: postgres:13.12
image: postgres:15
env:
POSTGRES_HOST: localhost
POSTGRES_USER: postgres
Expand Down
1 change: 1 addition & 0 deletions .solargraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ exclude:
require: []
domains: []
plugins:
- solargraph-rails
- solargraph-standardrb
reporters:
- require_not_found
Expand Down
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "3.1.4"

# Bundle edge Rails instead: gem "rails", github: "rails/rails"
gem "rails", "~> 7.0.0"
gem "rails", "~> 7.1.0"

# Since Rails 7 sprockets is optional; we still use it so we need to depend on
# the gem explicitly
Expand All @@ -31,7 +31,7 @@ gem "jbuilder", "~> 2.11"
gem "acts_as_tenant"
gem "devise"
gem "pundit"
gem "audited", github: "simmerz/audited"
gem "audited"
gem "turbolinks_render"
gem "money-rails"
gem "mjml-rails" # , github: "jim/mjml-rails", branch: "webpacker"
Expand Down Expand Up @@ -78,6 +78,7 @@ group :development do
gem "web-console", ">= 3.3.0"
gem "listen"
gem "solargraph"
gem "solargraph-rails"
gem "solargraph-standardrb"
gem "lefthook"
gem "erb_lint", "~> 0.1.1"
Expand Down
Loading

0 comments on commit 8b34d23

Please sign in to comment.