Skip to content

Commit e0b03cb

Browse files
authored
Upgrade Rails from 8.0.2.1 to 8.1.1 (#366)
* Upgrade Rails from 8.0.2.1 to 8.1.1 * fix linter * fix tests
1 parent d0f6e10 commit e0b03cb

24 files changed

+862
-79
lines changed

.standard.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ignore:
2+
- 'db/migrate/*'

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
44
ruby "3.4.7"
55

66
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
7-
gem "rails", "8.0.2.1"
7+
gem "rails", "8.1.1"
88
# The modern asset pipeline for Rails [https://github.com/rails/propshaft]
99
gem "propshaft", "1.3.1"
1010
# Use sqlite3 as the database for Active Record

Gemfile.lock

Lines changed: 66 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -22,72 +22,75 @@ GIT
2222
GEM
2323
remote: https://rubygems.org/
2424
specs:
25-
actioncable (8.0.2.1)
26-
actionpack (= 8.0.2.1)
27-
activesupport (= 8.0.2.1)
25+
action_text-trix (2.1.15)
26+
railties
27+
actioncable (8.1.1)
28+
actionpack (= 8.1.1)
29+
activesupport (= 8.1.1)
2830
nio4r (~> 2.0)
2931
websocket-driver (>= 0.6.1)
3032
zeitwerk (~> 2.6)
31-
actionmailbox (8.0.2.1)
32-
actionpack (= 8.0.2.1)
33-
activejob (= 8.0.2.1)
34-
activerecord (= 8.0.2.1)
35-
activestorage (= 8.0.2.1)
36-
activesupport (= 8.0.2.1)
33+
actionmailbox (8.1.1)
34+
actionpack (= 8.1.1)
35+
activejob (= 8.1.1)
36+
activerecord (= 8.1.1)
37+
activestorage (= 8.1.1)
38+
activesupport (= 8.1.1)
3739
mail (>= 2.8.0)
38-
actionmailer (8.0.2.1)
39-
actionpack (= 8.0.2.1)
40-
actionview (= 8.0.2.1)
41-
activejob (= 8.0.2.1)
42-
activesupport (= 8.0.2.1)
40+
actionmailer (8.1.1)
41+
actionpack (= 8.1.1)
42+
actionview (= 8.1.1)
43+
activejob (= 8.1.1)
44+
activesupport (= 8.1.1)
4345
mail (>= 2.8.0)
4446
rails-dom-testing (~> 2.2)
45-
actionpack (8.0.2.1)
46-
actionview (= 8.0.2.1)
47-
activesupport (= 8.0.2.1)
47+
actionpack (8.1.1)
48+
actionview (= 8.1.1)
49+
activesupport (= 8.1.1)
4850
nokogiri (>= 1.8.5)
4951
rack (>= 2.2.4)
5052
rack-session (>= 1.0.1)
5153
rack-test (>= 0.6.3)
5254
rails-dom-testing (~> 2.2)
5355
rails-html-sanitizer (~> 1.6)
5456
useragent (~> 0.16)
55-
actiontext (8.0.2.1)
56-
actionpack (= 8.0.2.1)
57-
activerecord (= 8.0.2.1)
58-
activestorage (= 8.0.2.1)
59-
activesupport (= 8.0.2.1)
57+
actiontext (8.1.1)
58+
action_text-trix (~> 2.1.15)
59+
actionpack (= 8.1.1)
60+
activerecord (= 8.1.1)
61+
activestorage (= 8.1.1)
62+
activesupport (= 8.1.1)
6063
globalid (>= 0.6.0)
6164
nokogiri (>= 1.8.5)
62-
actionview (8.0.2.1)
63-
activesupport (= 8.0.2.1)
65+
actionview (8.1.1)
66+
activesupport (= 8.1.1)
6467
builder (~> 3.1)
6568
erubi (~> 1.11)
6669
rails-dom-testing (~> 2.2)
6770
rails-html-sanitizer (~> 1.6)
68-
activejob (8.0.2.1)
69-
activesupport (= 8.0.2.1)
71+
activejob (8.1.1)
72+
activesupport (= 8.1.1)
7073
globalid (>= 0.3.6)
71-
activemodel (8.0.2.1)
72-
activesupport (= 8.0.2.1)
73-
activerecord (8.0.2.1)
74-
activemodel (= 8.0.2.1)
75-
activesupport (= 8.0.2.1)
74+
activemodel (8.1.1)
75+
activesupport (= 8.1.1)
76+
activerecord (8.1.1)
77+
activemodel (= 8.1.1)
78+
activesupport (= 8.1.1)
7679
timeout (>= 0.4.0)
77-
activestorage (8.0.2.1)
78-
actionpack (= 8.0.2.1)
79-
activejob (= 8.0.2.1)
80-
activerecord (= 8.0.2.1)
81-
activesupport (= 8.0.2.1)
80+
activestorage (8.1.1)
81+
actionpack (= 8.1.1)
82+
activejob (= 8.1.1)
83+
activerecord (= 8.1.1)
84+
activesupport (= 8.1.1)
8285
marcel (~> 1.0)
83-
activesupport (8.0.2.1)
86+
activesupport (8.1.1)
8487
base64
85-
benchmark (>= 0.3)
8688
bigdecimal
8789
concurrent-ruby (~> 1.0, >= 1.3.1)
8890
connection_pool (>= 2.2.5)
8991
drb
9092
i18n (>= 1.6, < 2)
93+
json
9194
logger (>= 1.4.2)
9295
minitest (>= 5.1)
9396
securerandom (>= 0.3)
@@ -97,7 +100,6 @@ GEM
97100
public_suffix (>= 2.0.2, < 7.0)
98101
ast (2.4.3)
99102
base64 (0.3.0)
100-
benchmark (0.5.0)
101103
bigdecimal (3.3.1)
102104
bindex (0.8.1)
103105
bootsnap (1.19.0)
@@ -127,7 +129,7 @@ GEM
127129
drb (2.2.3)
128130
erb (6.0.0)
129131
erubi (1.13.1)
130-
globalid (1.2.1)
132+
globalid (1.3.0)
131133
activesupport (>= 6.1)
132134
i18n (1.14.7)
133135
concurrent-ruby (~> 1.0)
@@ -147,19 +149,20 @@ GEM
147149
nokogiri (>= 1.12.0)
148150
lucide-rails (0.7.1)
149151
railties (>= 4.1.0)
150-
mail (2.8.1)
152+
mail (2.9.0)
153+
logger
151154
mini_mime (>= 0.1.1)
152155
net-imap
153156
net-pop
154157
net-smtp
155-
marcel (1.0.4)
158+
marcel (1.1.0)
156159
matrix (0.4.2)
157160
method_source (1.1.0)
158161
mini_mime (1.1.5)
159162
mini_portile2 (2.8.9)
160163
minitest (5.26.2)
161164
msgpack (1.8.0)
162-
net-imap (0.5.9)
165+
net-imap (0.5.12)
163166
date
164167
net-protocol
165168
net-pop (0.1.2)
@@ -168,7 +171,7 @@ GEM
168171
timeout
169172
net-smtp (0.5.1)
170173
net-protocol
171-
nio4r (2.7.4)
174+
nio4r (2.7.5)
172175
nokogiri (1.18.10)
173176
mini_portile2 (~> 2.8.2)
174177
racc (~> 1.4)
@@ -204,34 +207,35 @@ GEM
204207
rack (>= 1.3)
205208
rackup (2.2.1)
206209
rack (>= 3)
207-
rails (8.0.2.1)
208-
actioncable (= 8.0.2.1)
209-
actionmailbox (= 8.0.2.1)
210-
actionmailer (= 8.0.2.1)
211-
actionpack (= 8.0.2.1)
212-
actiontext (= 8.0.2.1)
213-
actionview (= 8.0.2.1)
214-
activejob (= 8.0.2.1)
215-
activemodel (= 8.0.2.1)
216-
activerecord (= 8.0.2.1)
217-
activestorage (= 8.0.2.1)
218-
activesupport (= 8.0.2.1)
210+
rails (8.1.1)
211+
actioncable (= 8.1.1)
212+
actionmailbox (= 8.1.1)
213+
actionmailer (= 8.1.1)
214+
actionpack (= 8.1.1)
215+
actiontext (= 8.1.1)
216+
actionview (= 8.1.1)
217+
activejob (= 8.1.1)
218+
activemodel (= 8.1.1)
219+
activerecord (= 8.1.1)
220+
activestorage (= 8.1.1)
221+
activesupport (= 8.1.1)
219222
bundler (>= 1.15.0)
220-
railties (= 8.0.2.1)
223+
railties (= 8.1.1)
221224
rails-dom-testing (2.3.0)
222225
activesupport (>= 5.0.0)
223226
minitest
224227
nokogiri (>= 1.6)
225228
rails-html-sanitizer (1.6.2)
226229
loofah (~> 2.21)
227230
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)
228-
railties (8.0.2.1)
229-
actionpack (= 8.0.2.1)
230-
activesupport (= 8.0.2.1)
231+
railties (8.1.1)
232+
actionpack (= 8.1.1)
233+
activesupport (= 8.1.1)
231234
irb (~> 1.13)
232235
rackup (>= 1.0.0)
233236
rake (>= 12.2)
234237
thor (~> 1.0, >= 1.2.2)
238+
tsort (>= 0.2)
235239
zeitwerk (~> 2.6)
236240
rainbow (3.1.1)
237241
rake (13.3.1)
@@ -293,7 +297,7 @@ GEM
293297
tailwind_merge (1.3.1)
294298
sin_lru_redux (~> 2.5)
295299
thor (1.4.0)
296-
timeout (0.4.3)
300+
timeout (0.4.4)
297301
tsort (0.2.0)
298302
turbo-rails (2.0.20)
299303
actionpack (>= 7.1.0)
@@ -336,7 +340,7 @@ DEPENDENCIES
336340
propshaft (= 1.3.1)
337341
pry (= 0.15.2)
338342
puma (= 7.1.0)
339-
rails (= 8.0.2.1)
343+
rails (= 8.1.1)
340344
rouge (~> 4.6)
341345
ruby_ui!
342346
selenium-webdriver

bin/ci

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env ruby
2+
require_relative "../config/boot"
3+
require "active_support/continuous_integration"
4+
5+
CI = ActiveSupport::ContinuousIntegration
6+
require_relative "../config/ci.rb"

bin/rubocop

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env ruby
2+
require "rubygems"
3+
require "bundler/setup"
4+
5+
# Explicit RuboCop config increases performance slightly while avoiding config confusion.
6+
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
7+
8+
load Gem.bin_path("rubocop", "rubocop")

bin/setup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ FileUtils.chdir APP_ROOT do
1515
puts "== Installing dependencies =="
1616
system("bundle check") || system!("bundle install")
1717
system!("pnpm install --force")
18-
1918
# puts "\n== Copying sample files =="
2019
# unless File.exist?("config/database.yml")
2120
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
2221
# end
2322

2423
puts "\n== Preparing database =="
2524
system! "bin/rails db:prepare"
25+
system! "bin/rails db:reset" if ARGV.include?("--reset")
2626

2727
puts "\n== Removing old logs and tempfiles =="
2828
system! "bin/rails log:clear tmp:clear"

config/application.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
# you've limited to :test, :development, or :production.
77
Bundler.require(*Rails.groups)
88

9-
module RubyUIWeb
9+
module RubyUiWeb
1010
class Application < Rails::Application
1111
# Initialize configuration defaults for originally generated Rails version.
12-
config.load_defaults 8.0
12+
config.load_defaults 8.1
1313

14-
config.active_support.to_time_preserves_timezone = :zone
1514
# Please, add to the `ignore` list any other `lib` subdirectories that do
1615
# not contain `.rb` files, or that should not be reloaded or eager loaded.
1716
# Common ones are `templates`, `generators`, or `middleware`, for example.
@@ -24,5 +23,7 @@ class Application < Rails::Application
2423
#
2524
# config.time_zone = "Central Time (US & Canada)"
2625
# config.eager_load_paths << Rails.root.join("extras")
26+
27+
config.exceptions_app = ->(env) { ErrorsController.action(:not_found).call(env) }
2728
end
2829
end

config/ci.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Run using bin/ci
2+
3+
CI.run do
4+
step "Setup", "bin/setup --skip-server"
5+
6+
step "Style: Ruby", "bin/rubocop"
7+
8+
step "Security: Importmap vulnerability audit", "bin/importmap audit"
9+
10+
step "Tests: Rails", "bin/rails test"
11+
step "Tests: System", "bin/rails test:system"
12+
step "Tests: Seeds", "env RAILS_ENV=test bin/rails db:seed:replant"
13+
14+
# Optional: set a green GitHub commit status to unblock PR merge.
15+
# Requires the `gh` CLI and `gh extension install basecamp/gh-signoff`.
16+
# if success?
17+
# step "Signoff: All systems go. Ready for merge and deploy.", "gh signoff"
18+
# else
19+
# failure "Signoff: CI failed. Do not merge or deploy.", "Fix the issues and try again."
20+
# end
21+
end

config/environments/development.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@
5555
# Highlight code that enqueued background job in logs.
5656
config.active_job.verbose_enqueue_logs = true
5757

58+
# Highlight code that triggered redirect in logs.
59+
config.action_dispatch.verbose_redirect_logs = true
60+
61+
# Suppress logger output for asset requests.
62+
config.assets.quiet = true
63+
5864
# Raises error for missing translations.
5965
# config.i18n.raise_on_missing_translations = true
6066

config/environments/production.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535

3636
# Log to STDOUT with the current request id as a default log tag.
3737
config.log_tags = [:request_id]
38-
# config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
38+
config.logger = ActiveSupport::TaggedLogging.logger($stdout)
3939

40-
# Change to "debug" to log everything (including potentially personally-identifiable information!)
40+
# Change to "debug" to log everything (including potentially personally-identifiable information!).
4141
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
4242

4343
# Prevent health checks from clogging up the logs.
@@ -59,7 +59,7 @@
5959
# Set host to be used by links generated in mailer templates.
6060
config.action_mailer.default_url_options = {host: "example.com"}
6161

62-
# Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit.
62+
# Specify outgoing SMTP server. Remember to add smtp/* credentials via bin/rails credentials:edit.
6363
# config.action_mailer.smtp_settings = {
6464
# user_name: Rails.application.credentials.dig(:smtp, :user_name),
6565
# password: Rails.application.credentials.dig(:smtp, :password),

0 commit comments

Comments
 (0)