Skip to content

Commit 0d87508

Browse files
justin808claude
andauthored
Upgrade Rails to 8.1.2 and modernize config (#703)
* Upgrade Rails to 8.1.2 and modernize defaults * Fix RuboCop violations and PRODUCTION_HOST nil safety from PR review - Add frozen_string_literal comments to boot.rb, ci.rb, filter_parameter_logging.rb, and production.rb - Use %i[] notation for symbol array in filter_parameter_logging.rb - Fix Gemfile gem ordering (bootsnap before puma before thruster) - Fix array bracket spacing in production.rb - Use $stdout instead of STDOUT per Style/GlobalStdStream - Remove nil fallback from ENV.fetch('PRODUCTION_HOST') so missing config fails at boot instead of producing broken Action Cable URLs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add frozen_string_literal comments to fix RuboCop lint CI Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Address PR review feedback: fix bin/ci, puma, ActionCable, and config defaults - Rewrite bin/ci to use plain Ruby (TutorialCI module) instead of non-existent ActiveSupport::ContinuousIntegration DSL - Add test asset build step to CI pipeline - Use bin/conductor-exec wrapper for all CI commands - Restore worker_timeout 3600 for development in puma.rb - Restore default thread count to 5 in puma.rb - Comment out solid_queue plugin (gem not in Gemfile) - Make PRODUCTION_HOST optional with conditional guard - Make deprecation reporting configurable via RAILS_REPORT_DEPRECATIONS env var - Restore conditional cache store toggle in development.rb - Preserve to_time_preserves_timezone = false in application.rb - Use action_cable_meta_tag for client-side WebSocket URL construction - Add actionCableUrl.js helper to read cable URL from meta tag Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix CI lint offenses and SSR ActionCable loading * Fix ActionCable subscription leaks and remove deprecated config - Store subscription ref from subscriptions.create() in CommentBox and Stimulus comments_controller so cleanup actually works on unmount - Add disconnect() to Stimulus controller to close WebSocket on teardown - Remove deprecated to_time_preserves_timezone setting (no-op in Rails 8.1) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Remove unused listen gem The listen gem was only needed for ActiveSupport::EventedFileUpdateChecker in development.rb, which was removed during the Rails 8.1 config modernization. Rails 8.1 defaults to polling without it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3a384e3 commit 0d87508

File tree

20 files changed

+185
-198
lines changed

20 files changed

+185
-198
lines changed

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ gem "react_on_rails", "16.4.0"
99
gem "shakapacker", "9.7.0"
1010

1111
# Bundle edge Rails instead: gem "rails", github: "rails/rails"
12-
gem "listen"
13-
gem "rails", "~> 8.0"
12+
gem "rails", "~> 8.1.2"
1413

1514
gem "pg"
1615

16+
gem "bootsnap", require: false
1717
gem "puma"
1818
gem "thruster", "~> 0.1"
1919

Gemfile.lock

Lines changed: 86 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,68 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
action_text-trix (2.1.15)
4+
action_text-trix (2.1.17)
55
railties
6-
actioncable (8.1.1)
7-
actionpack (= 8.1.1)
8-
activesupport (= 8.1.1)
6+
actioncable (8.1.2)
7+
actionpack (= 8.1.2)
8+
activesupport (= 8.1.2)
99
nio4r (~> 2.0)
1010
websocket-driver (>= 0.6.1)
1111
zeitwerk (~> 2.6)
12-
actionmailbox (8.1.1)
13-
actionpack (= 8.1.1)
14-
activejob (= 8.1.1)
15-
activerecord (= 8.1.1)
16-
activestorage (= 8.1.1)
17-
activesupport (= 8.1.1)
12+
actionmailbox (8.1.2)
13+
actionpack (= 8.1.2)
14+
activejob (= 8.1.2)
15+
activerecord (= 8.1.2)
16+
activestorage (= 8.1.2)
17+
activesupport (= 8.1.2)
1818
mail (>= 2.8.0)
19-
actionmailer (8.1.1)
20-
actionpack (= 8.1.1)
21-
actionview (= 8.1.1)
22-
activejob (= 8.1.1)
23-
activesupport (= 8.1.1)
19+
actionmailer (8.1.2)
20+
actionpack (= 8.1.2)
21+
actionview (= 8.1.2)
22+
activejob (= 8.1.2)
23+
activesupport (= 8.1.2)
2424
mail (>= 2.8.0)
2525
rails-dom-testing (~> 2.2)
26-
actionpack (8.1.1)
27-
actionview (= 8.1.1)
28-
activesupport (= 8.1.1)
26+
actionpack (8.1.2)
27+
actionview (= 8.1.2)
28+
activesupport (= 8.1.2)
2929
nokogiri (>= 1.8.5)
3030
rack (>= 2.2.4)
3131
rack-session (>= 1.0.1)
3232
rack-test (>= 0.6.3)
3333
rails-dom-testing (~> 2.2)
3434
rails-html-sanitizer (~> 1.6)
3535
useragent (~> 0.16)
36-
actiontext (8.1.1)
36+
actiontext (8.1.2)
3737
action_text-trix (~> 2.1.15)
38-
actionpack (= 8.1.1)
39-
activerecord (= 8.1.1)
40-
activestorage (= 8.1.1)
41-
activesupport (= 8.1.1)
38+
actionpack (= 8.1.2)
39+
activerecord (= 8.1.2)
40+
activestorage (= 8.1.2)
41+
activesupport (= 8.1.2)
4242
globalid (>= 0.6.0)
4343
nokogiri (>= 1.8.5)
44-
actionview (8.1.1)
45-
activesupport (= 8.1.1)
44+
actionview (8.1.2)
45+
activesupport (= 8.1.2)
4646
builder (~> 3.1)
4747
erubi (~> 1.11)
4848
rails-dom-testing (~> 2.2)
4949
rails-html-sanitizer (~> 1.6)
50-
activejob (8.1.1)
51-
activesupport (= 8.1.1)
50+
activejob (8.1.2)
51+
activesupport (= 8.1.2)
5252
globalid (>= 0.3.6)
53-
activemodel (8.1.1)
54-
activesupport (= 8.1.1)
55-
activerecord (8.1.1)
56-
activemodel (= 8.1.1)
57-
activesupport (= 8.1.1)
53+
activemodel (8.1.2)
54+
activesupport (= 8.1.2)
55+
activerecord (8.1.2)
56+
activemodel (= 8.1.2)
57+
activesupport (= 8.1.2)
5858
timeout (>= 0.4.0)
59-
activestorage (8.1.1)
60-
actionpack (= 8.1.1)
61-
activejob (= 8.1.1)
62-
activerecord (= 8.1.1)
63-
activesupport (= 8.1.1)
59+
activestorage (8.1.2)
60+
actionpack (= 8.1.2)
61+
activejob (= 8.1.2)
62+
activerecord (= 8.1.2)
63+
activesupport (= 8.1.2)
6464
marcel (~> 1.0)
65-
activesupport (8.1.1)
65+
activesupport (8.1.2)
6666
base64
6767
bigdecimal
6868
concurrent-ruby (~> 1.0, >= 1.3.1)
@@ -82,10 +82,12 @@ GEM
8282
execjs (~> 2)
8383
awesome_print (1.9.2)
8484
base64 (0.3.0)
85-
bigdecimal (3.3.1)
85+
bigdecimal (4.0.1)
8686
bindex (0.8.1)
8787
binding_of_caller (1.0.1)
8888
debug_inspector (>= 1.2.0)
89+
bootsnap (1.23.0)
90+
msgpack (~> 1.2)
8991
builder (3.3.0)
9092
byebug (11.1.3)
9193
capybara (3.40.0)
@@ -111,8 +113,8 @@ GEM
111113
coffee-script-source
112114
execjs
113115
coffee-script-source (1.12.2)
114-
concurrent-ruby (1.3.5)
115-
connection_pool (2.5.5)
116+
concurrent-ruby (1.3.6)
117+
connection_pool (3.0.2)
116118
coveralls_reborn (0.25.0)
117119
simplecov (>= 0.18.1, < 0.22.0)
118120
term-ansicolor (~> 1.6)
@@ -125,15 +127,15 @@ GEM
125127
activerecord (>= 5.a)
126128
database_cleaner-core (~> 2.0.0)
127129
database_cleaner-core (2.0.1)
128-
date (3.5.0)
130+
date (3.5.1)
129131
debug (1.9.2)
130132
irb (~> 1.10)
131133
reline (>= 0.3.8)
132134
debug_inspector (1.2.0)
133135
diff-lcs (1.5.1)
134136
docile (1.4.0)
135137
drb (2.2.3)
136-
erb (6.0.0)
138+
erb (6.0.2)
137139
erubi (1.13.1)
138140
erubis (2.7.0)
139141
execjs (2.10.0)
@@ -150,27 +152,25 @@ GEM
150152
railties (>= 3.0.0)
151153
globalid (1.3.0)
152154
activesupport (>= 6.1)
153-
i18n (1.14.7)
155+
i18n (1.14.8)
154156
concurrent-ruby (~> 1.0)
155157
interception (0.5)
156-
io-console (0.8.1)
157-
irb (1.15.3)
158+
io-console (0.8.2)
159+
irb (1.17.0)
158160
pp (>= 0.6.0)
161+
prism (>= 1.3.0)
159162
rdoc (>= 4.0.0)
160163
reline (>= 0.4.2)
161164
jbuilder (2.12.0)
162165
actionview (>= 5.0.0)
163166
activesupport (>= 5.0.0)
164-
json (2.16.0)
167+
json (2.19.1)
165168
language_server-protocol (3.17.0.5)
166169
launchy (3.0.1)
167170
addressable (~> 2.8)
168171
childprocess (~> 5.0)
169-
listen (3.9.0)
170-
rb-fsevent (~> 0.10, >= 0.10.3)
171-
rb-inotify (~> 0.9, >= 0.9.10)
172172
logger (1.7.0)
173-
loofah (2.24.1)
173+
loofah (2.25.1)
174174
crass (~> 1.0.2)
175175
nokogiri (>= 1.12.0)
176176
mail (2.9.0)
@@ -183,10 +183,13 @@ GEM
183183
matrix (0.4.2)
184184
method_source (1.1.0)
185185
mini_mime (1.1.5)
186-
minitest (5.26.2)
186+
minitest (6.0.2)
187+
drb (~> 2.0)
188+
prism (~> 1.5)
187189
mize (0.4.1)
188190
protocol (~> 2.0)
189-
net-imap (0.5.12)
191+
msgpack (1.8.0)
192+
net-imap (0.6.3)
190193
date
191194
net-protocol
192195
net-pop (0.1.2)
@@ -196,9 +199,9 @@ GEM
196199
net-smtp (0.5.1)
197200
net-protocol
198201
nio4r (2.7.5)
199-
nokogiri (1.18.10-arm64-darwin)
202+
nokogiri (1.19.1-arm64-darwin)
200203
racc (~> 1.4)
201-
nokogiri (1.18.10-x86_64-linux-gnu)
204+
nokogiri (1.19.1-x86_64-linux-gnu)
202205
racc (~> 1.4)
203206
package_json (0.2.0)
204207
parallel (1.27.0)
@@ -229,43 +232,43 @@ GEM
229232
pry-stack_explorer (0.6.1)
230233
binding_of_caller (~> 1.0)
231234
pry (~> 0.13)
232-
psych (5.2.6)
235+
psych (5.3.1)
233236
date
234237
stringio
235238
public_suffix (6.0.2)
236239
puma (6.4.2)
237240
nio4r (~> 2.0)
238241
racc (1.8.1)
239-
rack (3.2.4)
242+
rack (3.2.5)
240243
rack-proxy (0.7.7)
241244
rack
242245
rack-session (2.1.1)
243246
base64 (>= 0.1.0)
244247
rack (>= 3.0.0)
245248
rack-test (2.2.0)
246249
rack (>= 1.3)
247-
rackup (2.2.1)
250+
rackup (2.3.1)
248251
rack (>= 3)
249-
rails (8.1.1)
250-
actioncable (= 8.1.1)
251-
actionmailbox (= 8.1.1)
252-
actionmailer (= 8.1.1)
253-
actionpack (= 8.1.1)
254-
actiontext (= 8.1.1)
255-
actionview (= 8.1.1)
256-
activejob (= 8.1.1)
257-
activemodel (= 8.1.1)
258-
activerecord (= 8.1.1)
259-
activestorage (= 8.1.1)
260-
activesupport (= 8.1.1)
252+
rails (8.1.2)
253+
actioncable (= 8.1.2)
254+
actionmailbox (= 8.1.2)
255+
actionmailer (= 8.1.2)
256+
actionpack (= 8.1.2)
257+
actiontext (= 8.1.2)
258+
actionview (= 8.1.2)
259+
activejob (= 8.1.2)
260+
activemodel (= 8.1.2)
261+
activerecord (= 8.1.2)
262+
activestorage (= 8.1.2)
263+
activesupport (= 8.1.2)
261264
bundler (>= 1.15.0)
262-
railties (= 8.1.1)
265+
railties (= 8.1.2)
263266
rails-dom-testing (2.3.0)
264267
activesupport (>= 5.0.0)
265268
minitest
266269
nokogiri (>= 1.6)
267-
rails-html-sanitizer (1.6.2)
268-
loofah (~> 2.21)
270+
rails-html-sanitizer (1.7.0)
271+
loofah (~> 2.25)
269272
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)
270273
rails_best_practices (1.23.2)
271274
activesupport
@@ -275,9 +278,9 @@ GEM
275278
json
276279
require_all (~> 3.0)
277280
ruby-progressbar
278-
railties (8.1.1)
279-
actionpack (= 8.1.1)
280-
activesupport (= 8.1.1)
281+
railties (8.1.2)
282+
actionpack (= 8.1.2)
283+
activesupport (= 8.1.2)
281284
irb (~> 1.13)
282285
rackup (>= 1.0.0)
283286
rake (>= 12.2)
@@ -289,7 +292,7 @@ GEM
289292
rb-fsevent (0.11.2)
290293
rb-inotify (0.11.1)
291294
ffi (~> 1.0)
292-
rdoc (6.15.1)
295+
rdoc (7.2.0)
293296
erb
294297
psych (>= 4.0.0)
295298
tsort
@@ -408,17 +411,17 @@ GEM
408411
sprockets (>= 3.0.0)
409412
stimulus-rails (1.3.3)
410413
railties (>= 6.0.0)
411-
stringio (3.1.8)
414+
stringio (3.2.0)
412415
strscan (3.1.0)
413416
sync (0.5.0)
414417
term-ansicolor (1.10.2)
415418
mize
416419
tins (~> 1.0)
417-
thor (1.4.0)
420+
thor (1.5.0)
418421
thruster (0.1.16-arm64-darwin)
419422
thruster (0.1.16-x86_64-linux)
420423
tilt (2.4.0)
421-
timeout (0.4.4)
424+
timeout (0.6.1)
422425
tins (1.33.0)
423426
bigdecimal
424427
sync
@@ -448,7 +451,7 @@ GEM
448451
xpath (3.2.0)
449452
nokogiri (~> 1.8)
450453
yard (0.9.36)
451-
zeitwerk (2.7.3)
454+
zeitwerk (2.7.5)
452455

453456
PLATFORMS
454457
arm64-darwin
@@ -459,6 +462,7 @@ PLATFORMS
459462
DEPENDENCIES
460463
autoprefixer-rails
461464
awesome_print
465+
bootsnap
462466
capybara
463467
capybara-screenshot
464468
coffee-rails
@@ -470,7 +474,6 @@ DEPENDENCIES
470474
generator_spec
471475
jbuilder
472476
launchy
473-
listen
474477
pg
475478
pry
476479
pry-byebug
@@ -479,7 +482,7 @@ DEPENDENCIES
479482
pry-rescue
480483
pry-stack_explorer
481484
puma
482-
rails (~> 8.0)
485+
rails (~> 8.1.2)
483486
rails-html-sanitizer
484487
rails_best_practices
485488
rainbow

app/views/layouts/application.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<%= javascript_pack_tag('data-turbolinks-track': true, defer: true) %>
2626

2727
<%= csrf_meta_tags %>
28+
<%= action_cable_meta_tag %>
2829
</head>
2930
<body class="min-h-screen flex flex-col bg-sky-50 text-gray-700">
3031
<%= yield :body_content %>

bin/ci

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
require "English"
5+
require_relative "../config/ci"
6+
7+
def run_step(name, command)
8+
puts "\n== #{name} =="
9+
puts "$ #{command}"
10+
system(command)
11+
return if $CHILD_STATUS.success?
12+
13+
warn "\nStep failed: #{name}"
14+
exit($CHILD_STATUS.exitstatus || 1)
15+
end
16+
17+
TutorialCI::STEPS.each do |name, command|
18+
run_step(name, command)
19+
end
20+
21+
puts "\nAll CI steps passed."

0 commit comments

Comments
 (0)