Skip to content

Commit 3811025

Browse files
authored
Upgrade Rails 7.1 → 8.0 (#358)
* Bump Rails 7.1.5.1 → 7.1.6 * Switch show_exceptions to symbol value for Rails 7.2 Rails 7.2 changes config.action_dispatch.show_exceptions from a boolean to a symbol. Boolean values stop working at the 7.2 bump. - true -> :all - false -> :none - new option -> :rescuable (raise non-rescuable, render rescuable) The test environment used `false` (raise everything). The 1:1 replacement is :none. Symbol form already works on 7.1, so this is a direct rewrite with no dual-boot conditional needed. Ref: https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#config-action-dispatch-show-exceptions * Drop Rails.application.secrets in favor of credentials/ENV Rails 7.2 removes Rails.application.secrets entirely. Anything that relied on config/secrets.yml stops working at the bump. Currently the file only carries secret_key_base, which Rails resolves through this chain (in order): 1. Rails.application.credentials.secret_key_base 2. ENV["SECRET_KEY_BASE"] 3. tmp/local_secret.txt (dev/test auto-generated) Production already uses ENV["SECRET_KEY_BASE"] (unchanged). Dev/test fall through to tmp/local_secret.txt automatically, so deleting secrets.yml is safe. Also drops config.read_encrypted_secrets = true from production.rb, which is a no-op in 7.2 and only ever applied to the legacy secrets.yml.enc workflow. Ref: https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#rails-application-secrets-removal * Bump rspec-rails ~> 6.0.3 → ~> 6.1 for fixture_paths support Rails 7.2 deprecates fixture_path (singular) in favor of fixture_paths (plural array). The new API exists in Rails 7.1+, but rspec-rails surfaces it via config.fixture_paths only from 6.1.0 onward — 6.0.x still expects fixture_path. Bumping the floor to 6.1 unblocks the fixture_paths rewrite that follows in the next commit. 6.1.5 resolves cleanly on both sides of the dual-boot pair (7.1.6 and 7.2.3) with no other gem changes pulled in beyond the rspec-rails sub-gems on the .next side. * Rename fixture_path → fixture_paths in rspec config Rails 7.2 deprecates the singular fixture_path setter on ActiveSupport::TestCase. rspec-rails 6.1+ exposes the plural form, which takes an array of paths and is the long-term API on both 7.1 and 7.2. Direct rewrite — no NextRails.next? branch needed, and no behavior change since we still point at a single spec/fixtures directory. Ref: https://github.com/rspec/rspec-rails/blob/main/Changelog.md#610--2023-11-21 * Bump database_cleaner-active_record 2.1.0 → 2.2.2 for Rails 7.2 database_cleaner-active_record 2.1.x calls AR connection adapter#schema_migration, which Rails 7.2 removed in favor of an internal-pool-based API. The 2.1.x suite errors out on boot under 7.2 with: NoMethodError: undefined method `schema_migration' for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter ...> 2.2.0 reworked the cleanup to use the new connection API. 2.2.2 is the latest patch and resolves cleanly on both 7.1.6 and 7.2.3. Doing the bump as its own commit so the Rails version flip in the next commit is isolated to the Gemfile constraint change. Ref: https://github.com/DatabaseCleaner/database_cleaner-active_record/blob/main/CHANGELOG.md * Upgrade Rails 7.1.6 → 7.2.3.1 Flips the Gemfile constraint from ~> 7.1.0 to ~> 7.2.0 and collapses the dual-boot if/else into a single line, since both sides of the dual-boot pair now point at 7.2 anyway. The next? helper (Gemfile lines 3-5) and the Gemfile.next symlink stay in place. They will be retired in a follow-up cleanup pass once 7.2 ships, per the dual-boot teardown checklist — keeping them now keeps build-rails-next in CI as a sanity check on the exact same constraints as build-rails-current. All fix-before-bump items were addressed in earlier commits in this branch: - show_exceptions symbol value - Rails.application.secrets removal - rspec-rails fixture_paths support - database_cleaner-active_record schema_migration compat Test suite is 204/204 green on 7.2.3.1. * Bump jbuilder ~> 2.5 → ~> 2.13 for Rails 8 compat jbuilder 2.11.x calls require "active_support/proxy_object" at load time. proxy_object was deprecated in Rails 5 and removed in Rails 8.0, so the require raises LoadError the moment Bundler runs Bundler.require for the :default group: LoadError: cannot load such file -- active_support/proxy_object config/application.rb:7:in `<top (required)>' jbuilder 2.12 dropped the require (jbuilder commit b8e2d8f), 2.13 added explicit Rails 8 support. Bumping the floor to 2.13 resolves cleanly on both 7.2 (current) and 8.0 (next), so this sits as a prereq before the Rails version flip. Conservative resolution kept all other gems pinned. Ref: rails/jbuilder#580 * Upgrade Rails 7.2.3.1 → 8.0.5 Flips the Gemfile constraint from ~> 7.2.0 to ~> 8.0.0 and collapses the dual-boot if/else into a single line. Both sides of the dual-boot pair (Gemfile and Gemfile.next via symlink) now target 8.0. Detection against the 8.0 pattern set surfaced no fix-before-bump items in our codebase: enum is unused, no removed AR config keys, no routes-array usage, no SCHEMA_CACHE env var, no Benchmark.ms, Ruby 3.2.3 already meets the 3.2.0 floor. Sprockets stays — it still works at 8.0 (just no longer the new- app default). Migration to Propshaft is a separate, optional concern. The only prereq surfaced by booting the test suite under 8.0 was jbuilder still requiring active_support/proxy_object; addressed in the previous commit. Test suite is 204/204 green on 8.0.5. Deferred to the 8.0 → 8.1 hop (per skill rules — future-version runtime warnings are not fix-before-bump for the current hop): - to_time timezone behavior (config.active_support.to_time_preserves_timezone = :zone)
1 parent 25531b7 commit 3811025

7 files changed

Lines changed: 378 additions & 373 deletions

File tree

Gemfile

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,7 @@ git_source(:github) do |repo_name|
1111
"https://github.com/#{repo_name}.git"
1212
end
1313

14-
if next?
15-
# using the 7-0-stable branch for the time being until the fix is merged into main
16-
# to make it work with ruby 3.1
17-
# read more about it here: https://github.com/rails/rails/issues/43998,
18-
# and here: https://gist.github.com/claudiug/bdc2fb70b10d19513208c816588aed92
19-
gem "rails", "~> 7.2.0"
20-
else
21-
gem "rails", "~> 7.1.0"
22-
end
14+
gem "rails", "~> 8.0.0"
2315
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
2416

2517
gem "bootstrap-sass", "3.4.1"
@@ -40,7 +32,7 @@ gem "redcarpet", "~> 3.5.1"
4032
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
4133
gem "turbolinks", "~> 5"
4234
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
43-
gem "jbuilder", "~> 2.5"
35+
gem "jbuilder", "~> 2.13"
4436
# Use Redis adapter to run Action Cable in production
4537
# gem 'redis', '~> 3.0'
4638
# Use ActiveModel has_secure_password
@@ -73,7 +65,7 @@ group :development, :test do
7365
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
7466
gem "byebug", platforms: [:mri, :mingw, :x64_mingw]
7567
# Adds support for Capybara system testing and selenium driver
76-
gem "rspec-rails", "~> 6.0.3"
68+
gem "rspec-rails", "~> 6.1"
7769
gem "faker"
7870
gem "shoulda-matchers", "~> 3.1"
7971
gem "rails-controller-testing"

Gemfile.lock

Lines changed: 89 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -10,83 +10,77 @@ GIT
1010
GEM
1111
remote: https://rubygems.org/
1212
specs:
13-
actioncable (7.1.5.1)
14-
actionpack (= 7.1.5.1)
15-
activesupport (= 7.1.5.1)
13+
actioncable (8.0.5)
14+
actionpack (= 8.0.5)
15+
activesupport (= 8.0.5)
1616
nio4r (~> 2.0)
1717
websocket-driver (>= 0.6.1)
1818
zeitwerk (~> 2.6)
19-
actionmailbox (7.1.5.1)
20-
actionpack (= 7.1.5.1)
21-
activejob (= 7.1.5.1)
22-
activerecord (= 7.1.5.1)
23-
activestorage (= 7.1.5.1)
24-
activesupport (= 7.1.5.1)
25-
mail (>= 2.7.1)
26-
net-imap
27-
net-pop
28-
net-smtp
29-
actionmailer (7.1.5.1)
30-
actionpack (= 7.1.5.1)
31-
actionview (= 7.1.5.1)
32-
activejob (= 7.1.5.1)
33-
activesupport (= 7.1.5.1)
34-
mail (~> 2.5, >= 2.5.4)
35-
net-imap
36-
net-pop
37-
net-smtp
19+
actionmailbox (8.0.5)
20+
actionpack (= 8.0.5)
21+
activejob (= 8.0.5)
22+
activerecord (= 8.0.5)
23+
activestorage (= 8.0.5)
24+
activesupport (= 8.0.5)
25+
mail (>= 2.8.0)
26+
actionmailer (8.0.5)
27+
actionpack (= 8.0.5)
28+
actionview (= 8.0.5)
29+
activejob (= 8.0.5)
30+
activesupport (= 8.0.5)
31+
mail (>= 2.8.0)
3832
rails-dom-testing (~> 2.2)
39-
actionpack (7.1.5.1)
40-
actionview (= 7.1.5.1)
41-
activesupport (= 7.1.5.1)
33+
actionpack (8.0.5)
34+
actionview (= 8.0.5)
35+
activesupport (= 8.0.5)
4236
nokogiri (>= 1.8.5)
43-
racc
4437
rack (>= 2.2.4)
4538
rack-session (>= 1.0.1)
4639
rack-test (>= 0.6.3)
4740
rails-dom-testing (~> 2.2)
4841
rails-html-sanitizer (~> 1.6)
49-
actiontext (7.1.5.1)
50-
actionpack (= 7.1.5.1)
51-
activerecord (= 7.1.5.1)
52-
activestorage (= 7.1.5.1)
53-
activesupport (= 7.1.5.1)
42+
useragent (~> 0.16)
43+
actiontext (8.0.5)
44+
actionpack (= 8.0.5)
45+
activerecord (= 8.0.5)
46+
activestorage (= 8.0.5)
47+
activesupport (= 8.0.5)
5448
globalid (>= 0.6.0)
5549
nokogiri (>= 1.8.5)
56-
actionview (7.1.5.1)
57-
activesupport (= 7.1.5.1)
50+
actionview (8.0.5)
51+
activesupport (= 8.0.5)
5852
builder (~> 3.1)
5953
erubi (~> 1.11)
6054
rails-dom-testing (~> 2.2)
6155
rails-html-sanitizer (~> 1.6)
62-
activejob (7.1.5.1)
63-
activesupport (= 7.1.5.1)
56+
activejob (8.0.5)
57+
activesupport (= 8.0.5)
6458
globalid (>= 0.3.6)
65-
activemodel (7.1.5.1)
66-
activesupport (= 7.1.5.1)
67-
activerecord (7.1.5.1)
68-
activemodel (= 7.1.5.1)
69-
activesupport (= 7.1.5.1)
59+
activemodel (8.0.5)
60+
activesupport (= 8.0.5)
61+
activerecord (8.0.5)
62+
activemodel (= 8.0.5)
63+
activesupport (= 8.0.5)
7064
timeout (>= 0.4.0)
71-
activestorage (7.1.5.1)
72-
actionpack (= 7.1.5.1)
73-
activejob (= 7.1.5.1)
74-
activerecord (= 7.1.5.1)
75-
activesupport (= 7.1.5.1)
65+
activestorage (8.0.5)
66+
actionpack (= 8.0.5)
67+
activejob (= 8.0.5)
68+
activerecord (= 8.0.5)
69+
activesupport (= 8.0.5)
7670
marcel (~> 1.0)
77-
activesupport (7.1.5.1)
71+
activesupport (8.0.5)
7872
base64
7973
benchmark (>= 0.3)
8074
bigdecimal
81-
concurrent-ruby (~> 1.0, >= 1.0.2)
75+
concurrent-ruby (~> 1.0, >= 1.3.1)
8276
connection_pool (>= 2.2.5)
8377
drb
8478
i18n (>= 1.6, < 2)
8579
logger (>= 1.4.2)
8680
minitest (>= 5.1)
87-
mutex_m
8881
securerandom (>= 0.3)
89-
tzinfo (~> 2.0)
82+
tzinfo (~> 2.0, >= 2.0.5)
83+
uri (>= 0.13.1)
9084
acts_as_list (1.1.0)
9185
activerecord (>= 4.2)
9286
addressable (2.8.5)
@@ -126,9 +120,9 @@ GEM
126120
concurrent-ruby (1.3.5)
127121
connection_pool (2.5.3)
128122
crass (1.0.6)
129-
database_cleaner-active_record (2.1.0)
123+
database_cleaner-active_record (2.2.2)
130124
activerecord (>= 5.a)
131-
database_cleaner-core (~> 2.0.0)
125+
database_cleaner-core (~> 2.0)
132126
database_cleaner-core (2.0.1)
133127
date (3.4.1)
134128
devise (4.9.4)
@@ -137,7 +131,7 @@ GEM
137131
railties (>= 4.1.0)
138132
responders
139133
warden (~> 1.2.3)
140-
diff-lcs (1.5.0)
134+
diff-lcs (1.6.2)
141135
docile (1.4.0)
142136
dotenv (2.8.1)
143137
dotenv-rails (2.8.1)
@@ -161,7 +155,7 @@ GEM
161155
faraday-net_http (3.4.0)
162156
net-http (>= 0.5.0)
163157
ffi (1.16.3)
164-
globalid (1.2.1)
158+
globalid (1.3.0)
165159
activesupport (>= 6.1)
166160
hashie (5.0.0)
167161
i18n (1.14.7)
@@ -171,9 +165,9 @@ GEM
171165
pp (>= 0.6.0)
172166
rdoc (>= 4.0.0)
173167
reline (>= 0.4.2)
174-
jbuilder (2.11.5)
175-
actionview (>= 5.0.0)
176-
activesupport (>= 5.0.0)
168+
jbuilder (2.14.1)
169+
actionview (>= 7.0.0)
170+
activesupport (>= 7.0.0)
177171
jquery-rails (4.6.0)
178172
rails-dom-testing (>= 1, < 3)
179173
railties (>= 4.2.0)
@@ -197,12 +191,13 @@ GEM
197191
madmin (1.2.8)
198192
pagy (>= 3.5)
199193
rails (>= 6.0.3)
200-
mail (2.8.1)
194+
mail (2.9.0)
195+
logger
201196
mini_mime (>= 0.1.1)
202197
net-imap
203198
net-pop
204199
net-smtp
205-
marcel (1.0.4)
200+
marcel (1.1.0)
206201
matrix (0.4.2)
207202
mimemagic (0.3.10)
208203
nokogiri (~> 1)
@@ -211,10 +206,9 @@ GEM
211206
minitest (5.25.5)
212207
multi_xml (0.7.2)
213208
bigdecimal (~> 3.1)
214-
mutex_m (0.3.0)
215209
net-http (0.6.0)
216210
uri
217-
net-imap (0.5.8)
211+
net-imap (0.6.4)
218212
date
219213
net-protocol
220214
net-pop (0.1.2)
@@ -292,20 +286,20 @@ GEM
292286
rackup (1.0.1)
293287
rack (< 3)
294288
webrick
295-
rails (7.1.5.1)
296-
actioncable (= 7.1.5.1)
297-
actionmailbox (= 7.1.5.1)
298-
actionmailer (= 7.1.5.1)
299-
actionpack (= 7.1.5.1)
300-
actiontext (= 7.1.5.1)
301-
actionview (= 7.1.5.1)
302-
activejob (= 7.1.5.1)
303-
activemodel (= 7.1.5.1)
304-
activerecord (= 7.1.5.1)
305-
activestorage (= 7.1.5.1)
306-
activesupport (= 7.1.5.1)
289+
rails (8.0.5)
290+
actioncable (= 8.0.5)
291+
actionmailbox (= 8.0.5)
292+
actionmailer (= 8.0.5)
293+
actionpack (= 8.0.5)
294+
actiontext (= 8.0.5)
295+
actionview (= 8.0.5)
296+
activejob (= 8.0.5)
297+
activemodel (= 8.0.5)
298+
activerecord (= 8.0.5)
299+
activestorage (= 8.0.5)
300+
activesupport (= 8.0.5)
307301
bundler (>= 1.15.0)
308-
railties (= 7.1.5.1)
302+
railties (= 8.0.5)
309303
rails-controller-testing (1.0.5)
310304
actionpack (>= 5.0.1.rc1)
311305
actionview (>= 5.0.1.rc1)
@@ -317,13 +311,14 @@ GEM
317311
rails-html-sanitizer (1.6.2)
318312
loofah (~> 2.21)
319313
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
320-
railties (7.1.5.1)
321-
actionpack (= 7.1.5.1)
322-
activesupport (= 7.1.5.1)
323-
irb
314+
railties (8.0.5)
315+
actionpack (= 8.0.5)
316+
activesupport (= 8.0.5)
317+
irb (~> 1.13)
324318
rackup (>= 1.0.0)
325319
rake (>= 12.2)
326320
thor (~> 1.0, >= 1.2.2)
321+
tsort (>= 0.2)
327322
zeitwerk (~> 2.6)
328323
rainbow (3.1.1)
329324
rake (13.3.0)
@@ -342,23 +337,23 @@ GEM
342337
actionpack (>= 5.2)
343338
railties (>= 5.2)
344339
rexml (3.2.6)
345-
rspec-core (3.12.2)
346-
rspec-support (~> 3.12.0)
347-
rspec-expectations (3.12.3)
340+
rspec-core (3.13.6)
341+
rspec-support (~> 3.13.0)
342+
rspec-expectations (3.13.5)
348343
diff-lcs (>= 1.2.0, < 2.0)
349-
rspec-support (~> 3.12.0)
350-
rspec-mocks (3.12.6)
344+
rspec-support (~> 3.13.0)
345+
rspec-mocks (3.13.8)
351346
diff-lcs (>= 1.2.0, < 2.0)
352-
rspec-support (~> 3.12.0)
353-
rspec-rails (6.0.3)
347+
rspec-support (~> 3.13.0)
348+
rspec-rails (6.1.5)
354349
actionpack (>= 6.1)
355350
activesupport (>= 6.1)
356351
railties (>= 6.1)
357-
rspec-core (~> 3.12)
358-
rspec-expectations (~> 3.12)
359-
rspec-mocks (~> 3.12)
360-
rspec-support (~> 3.12)
361-
rspec-support (3.12.1)
352+
rspec-core (~> 3.13)
353+
rspec-expectations (~> 3.13)
354+
rspec-mocks (~> 3.13)
355+
rspec-support (~> 3.13)
356+
rspec-support (3.13.7)
362357
rubocop (1.56.4)
363358
base64 (~> 0.1.1)
364359
json (~> 2.3)
@@ -442,13 +437,15 @@ GEM
442437
thor (1.3.2)
443438
tilt (2.3.0)
444439
timeout (0.4.3)
440+
tsort (0.2.0)
445441
turbolinks (5.2.1)
446442
turbolinks-source (~> 5.2)
447443
turbolinks-source (5.2.0)
448444
tzinfo (2.0.6)
449445
concurrent-ruby (~> 1.0)
450446
unicode-display_width (2.5.0)
451447
uri (1.0.3)
448+
useragent (0.16.11)
452449
version_gem (1.1.8)
453450
warden (1.2.9)
454451
rack (>= 2.0.9)
@@ -491,7 +488,7 @@ DEPENDENCIES
491488
dotenv-rails
492489
factory_bot_rails
493490
faker
494-
jbuilder (~> 2.5)
491+
jbuilder (~> 2.13)
495492
jquery-rails
496493
jquery-ui-rails (~> 6.0)
497494
listen (~> 3.7)
@@ -505,11 +502,11 @@ DEPENDENCIES
505502
puma (~> 6.5)
506503
pundit (~> 2.2)
507504
rack-mini-profiler
508-
rails (~> 7.1.0)
505+
rails (~> 8.0.0)
509506
rails-controller-testing
510507
recursive-open-struct
511508
redcarpet (~> 3.5.1)
512-
rspec-rails (~> 6.0.3)
509+
rspec-rails (~> 6.1)
513510
sass-rails (~> 5.0)
514511
sentry-rails
515512
sentry-ruby

0 commit comments

Comments
 (0)