Commit 3811025
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
- config
- environments
- spec
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 14 | + | |
23 | 15 | | |
24 | 16 | | |
25 | 17 | | |
| |||
40 | 32 | | |
41 | 33 | | |
42 | 34 | | |
43 | | - | |
| 35 | + | |
44 | 36 | | |
45 | 37 | | |
46 | 38 | | |
| |||
73 | 65 | | |
74 | 66 | | |
75 | 67 | | |
76 | | - | |
| 68 | + | |
77 | 69 | | |
78 | 70 | | |
79 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
38 | 32 | | |
39 | | - | |
40 | | - | |
41 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
42 | 36 | | |
43 | | - | |
44 | 37 | | |
45 | 38 | | |
46 | 39 | | |
47 | 40 | | |
48 | 41 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
54 | 48 | | |
55 | 49 | | |
56 | | - | |
57 | | - | |
| 50 | + | |
| 51 | + | |
58 | 52 | | |
59 | 53 | | |
60 | 54 | | |
61 | 55 | | |
62 | | - | |
63 | | - | |
| 56 | + | |
| 57 | + | |
64 | 58 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
70 | 64 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
76 | 70 | | |
77 | | - | |
| 71 | + | |
78 | 72 | | |
79 | 73 | | |
80 | 74 | | |
81 | | - | |
| 75 | + | |
82 | 76 | | |
83 | 77 | | |
84 | 78 | | |
85 | 79 | | |
86 | 80 | | |
87 | | - | |
88 | 81 | | |
89 | | - | |
| 82 | + | |
| 83 | + | |
90 | 84 | | |
91 | 85 | | |
92 | 86 | | |
| |||
126 | 120 | | |
127 | 121 | | |
128 | 122 | | |
129 | | - | |
| 123 | + | |
130 | 124 | | |
131 | | - | |
| 125 | + | |
132 | 126 | | |
133 | 127 | | |
134 | 128 | | |
| |||
137 | 131 | | |
138 | 132 | | |
139 | 133 | | |
140 | | - | |
| 134 | + | |
141 | 135 | | |
142 | 136 | | |
143 | 137 | | |
| |||
161 | 155 | | |
162 | 156 | | |
163 | 157 | | |
164 | | - | |
| 158 | + | |
165 | 159 | | |
166 | 160 | | |
167 | 161 | | |
| |||
171 | 165 | | |
172 | 166 | | |
173 | 167 | | |
174 | | - | |
175 | | - | |
176 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
177 | 171 | | |
178 | 172 | | |
179 | 173 | | |
| |||
197 | 191 | | |
198 | 192 | | |
199 | 193 | | |
200 | | - | |
| 194 | + | |
| 195 | + | |
201 | 196 | | |
202 | 197 | | |
203 | 198 | | |
204 | 199 | | |
205 | | - | |
| 200 | + | |
206 | 201 | | |
207 | 202 | | |
208 | 203 | | |
| |||
211 | 206 | | |
212 | 207 | | |
213 | 208 | | |
214 | | - | |
215 | 209 | | |
216 | 210 | | |
217 | | - | |
| 211 | + | |
218 | 212 | | |
219 | 213 | | |
220 | 214 | | |
| |||
292 | 286 | | |
293 | 287 | | |
294 | 288 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
307 | 301 | | |
308 | | - | |
| 302 | + | |
309 | 303 | | |
310 | 304 | | |
311 | 305 | | |
| |||
317 | 311 | | |
318 | 312 | | |
319 | 313 | | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
324 | 318 | | |
325 | 319 | | |
326 | 320 | | |
| 321 | + | |
327 | 322 | | |
328 | 323 | | |
329 | 324 | | |
| |||
342 | 337 | | |
343 | 338 | | |
344 | 339 | | |
345 | | - | |
346 | | - | |
347 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
348 | 343 | | |
349 | | - | |
350 | | - | |
| 344 | + | |
| 345 | + | |
351 | 346 | | |
352 | | - | |
353 | | - | |
| 347 | + | |
| 348 | + | |
354 | 349 | | |
355 | 350 | | |
356 | 351 | | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
362 | 357 | | |
363 | 358 | | |
364 | 359 | | |
| |||
442 | 437 | | |
443 | 438 | | |
444 | 439 | | |
| 440 | + | |
445 | 441 | | |
446 | 442 | | |
447 | 443 | | |
448 | 444 | | |
449 | 445 | | |
450 | 446 | | |
451 | 447 | | |
| 448 | + | |
452 | 449 | | |
453 | 450 | | |
454 | 451 | | |
| |||
491 | 488 | | |
492 | 489 | | |
493 | 490 | | |
494 | | - | |
| 491 | + | |
495 | 492 | | |
496 | 493 | | |
497 | 494 | | |
| |||
505 | 502 | | |
506 | 503 | | |
507 | 504 | | |
508 | | - | |
| 505 | + | |
509 | 506 | | |
510 | 507 | | |
511 | 508 | | |
512 | | - | |
| 509 | + | |
513 | 510 | | |
514 | 511 | | |
515 | 512 | | |
| |||
0 commit comments