Skip to content

Commit

Permalink
Upgrade to Rails 7.2.1
Browse files Browse the repository at this point in the history
We want to stay on the latest stable version of Rails to benefit from
security patches and improvements.

This change introduces the new Rails library and associated config.
  • Loading branch information
felixclack committed Oct 17, 2024
1 parent 882ae50 commit de021f3
Show file tree
Hide file tree
Showing 21 changed files with 397 additions and 195 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ruby "3.3.0"

gem "audits1984", "~> 0.1.7"
gem "bootsnap", require: false
gem "console1984", "~> 0.1.29"
gem "console1984", "~> 0.2.1"
gem "cssbundling-rails"
gem "data_migrate"
gem "devise"
Expand All @@ -30,7 +30,7 @@ gem "omniauth-rails_csrf_protection"
gem "pg", "~> 1.5"
gem "puma", "~> 6.4"
gem "rack-attack"
gem "rails", "~> 7.1.3"
gem "rails", "~> 7.2.1"
gem "sentry-rails"
gem "sidekiq", "< 7" # v7 requires Redis 6.2 that Azure doesn't support yet
gem "sidekiq-cron", "~> 1.10"
Expand Down
159 changes: 80 additions & 79 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,80 +13,76 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.4)
actioncable (7.2.1)
actionpack (= 7.2.1)
activesupport (= 7.2.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.3.4)
actionpack (= 7.1.3.4)
activejob (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.3.4)
actionpack (= 7.1.3.4)
actionview (= 7.1.3.4)
activejob (= 7.1.3.4)
activesupport (= 7.1.3.4)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
actionmailbox (7.2.1)
actionpack (= 7.2.1)
activejob (= 7.2.1)
activerecord (= 7.2.1)
activestorage (= 7.2.1)
activesupport (= 7.2.1)
mail (>= 2.8.0)
actionmailer (7.2.1)
actionpack (= 7.2.1)
actionview (= 7.2.1)
activejob (= 7.2.1)
activesupport (= 7.2.1)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.1.3.4)
actionview (= 7.1.3.4)
activesupport (= 7.1.3.4)
actionpack (7.2.1)
actionview (= 7.2.1)
activesupport (= 7.2.1)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack (>= 2.2.4, < 3.2)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.3.4)
actionpack (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
useragent (~> 0.16)
actiontext (7.2.1)
actionpack (= 7.2.1)
activerecord (= 7.2.1)
activestorage (= 7.2.1)
activesupport (= 7.2.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.3.4)
activesupport (= 7.1.3.4)
actionview (7.2.1)
activesupport (= 7.2.1)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.3.4)
activesupport (= 7.1.3.4)
activejob (7.2.1)
activesupport (= 7.2.1)
globalid (>= 0.3.6)
activemodel (7.1.3.4)
activesupport (= 7.1.3.4)
activerecord (7.1.3.4)
activemodel (= 7.1.3.4)
activesupport (= 7.1.3.4)
activemodel (7.2.1)
activesupport (= 7.2.1)
activerecord (7.2.1)
activemodel (= 7.2.1)
activesupport (= 7.2.1)
timeout (>= 0.4.0)
activestorage (7.1.3.4)
actionpack (= 7.1.3.4)
activejob (= 7.1.3.4)
activerecord (= 7.1.3.4)
activesupport (= 7.1.3.4)
activestorage (7.2.1)
actionpack (= 7.2.1)
activejob (= 7.2.1)
activerecord (= 7.2.1)
activesupport (= 7.2.1)
marcel (~> 1.0)
activesupport (7.1.3.4)
activesupport (7.2.1)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
annotate (3.2.0)
Expand Down Expand Up @@ -124,8 +120,10 @@ GEM
coderay (1.1.3)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
console1984 (0.1.29)
console1984 (0.2.1)
irb (~> 1.13)
parser
rails (>= 7.0)
rainbow
crack (0.4.5)
rexml
Expand Down Expand Up @@ -212,10 +210,10 @@ GEM
concurrent-ruby (~> 1.0)
inflection (1.0.0)
io-console (0.7.2)
irb (1.14.0)
irb (1.14.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jaro_winkler (1.5.4)
jaro_winkler (1.6.0)
jsbundling-rails (1.3.0)
railties (>= 6.0.0)
json (2.7.1)
Expand All @@ -225,6 +223,7 @@ GEM
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
language_server-protocol (3.17.0.3)
logger (1.6.1)
logstop (0.3.1)
loofah (2.22.0)
crass (~> 1.0.2)
Expand All @@ -241,27 +240,26 @@ GEM
activesupport (>= 5.2.4.6)
notifications-ruby-client (~> 5.1)
rack (>= 2.1.4.1)
marcel (1.0.2)
marcel (1.0.4)
matrix (0.4.2)
method_source (1.0.0)
mini_mime (1.1.5)
minitest (5.25.1)
msgpack (1.6.0)
multi_xml (0.6.0)
multipart-post (2.4.1)
mutex_m (0.2.0)
net-http (0.4.1)
uri
net-imap (0.4.10)
net-imap (0.4.17)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
timeout
net-smtp (0.4.0.1)
net-smtp (0.5.0)
net-protocol
nio4r (2.7.0)
nio4r (2.7.3)
nokogiri (1.16.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-darwin)
Expand Down Expand Up @@ -310,7 +308,7 @@ GEM
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.8.1)
rack (2.2.9)
rack (2.2.10)
rack-attack (6.7.0)
rack (>= 1.0, < 4)
rack-protection (3.0.1)
Expand All @@ -322,20 +320,20 @@ GEM
rackup (1.0.0)
rack (< 3)
webrick
rails (7.1.3.4)
actioncable (= 7.1.3.4)
actionmailbox (= 7.1.3.4)
actionmailer (= 7.1.3.4)
actionpack (= 7.1.3.4)
actiontext (= 7.1.3.4)
actionview (= 7.1.3.4)
activejob (= 7.1.3.4)
activemodel (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
rails (7.2.1)
actioncable (= 7.2.1)
actionmailbox (= 7.2.1)
actionmailer (= 7.2.1)
actionpack (= 7.2.1)
actiontext (= 7.2.1)
actionview (= 7.2.1)
activejob (= 7.2.1)
activemodel (= 7.2.1)
activerecord (= 7.2.1)
activestorage (= 7.2.1)
activesupport (= 7.2.1)
bundler (>= 1.15.0)
railties (= 7.1.3.4)
railties (= 7.2.1)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
Expand All @@ -352,10 +350,10 @@ GEM
rack
railties (>= 5.1)
semantic_logger (~> 4.13)
railties (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.4)
irb
railties (7.2.1)
actionpack (= 7.2.1)
activesupport (= 7.2.1)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
Expand Down Expand Up @@ -438,6 +436,7 @@ GEM
ruby-graphviz (1.2.5)
rexml
ruby-progressbar (1.13.0)
securerandom (0.3.1)
semantic_logger (4.15.0)
concurrent-ruby (~> 1.0)
sentry-rails (5.19.0)
Expand Down Expand Up @@ -511,6 +510,7 @@ GEM
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
uri (0.13.0)
useragent (0.16.10)
vcr (6.2.0)
version_gem (1.1.1)
view_component (3.9.0)
Expand All @@ -528,14 +528,14 @@ GEM
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.8.1)
webrick (1.8.2)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.36)
zeitwerk (2.6.18)
zeitwerk (2.7.0)
zendesk_api (3.0.5)
faraday (> 2.0.0)
faraday-multipart
Expand All @@ -547,6 +547,7 @@ GEM
PLATFORMS
arm64-darwin-21
arm64-darwin-23
arm64-darwin-24
x86_64-darwin-21
x86_64-linux

Expand All @@ -556,7 +557,7 @@ DEPENDENCIES
bootsnap
capybara (~> 3.40)
capybara-email
console1984 (~> 0.1.29)
console1984 (~> 0.2.1)
cssbundling-rails
cuprite (~> 0.15)
data_migrate
Expand Down Expand Up @@ -584,7 +585,7 @@ DEPENDENCIES
pry-byebug
puma (~> 6.4)
rack-attack
rails (~> 7.1.3)
rails (~> 7.2.1)
rails-erd
rails_semantic_logger
rladr (~> 1.2)
Expand Down
Empty file modified bin/.gitkeep
100644 → 100755
Empty file.
8 changes: 8 additions & 0 deletions bin/rubocop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"

# explicit rubocop config increases performance slightly while avoiding config confusion.
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))

load Gem.bin_path("rubocop", "rubocop")
18 changes: 8 additions & 10 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#!/usr/bin/env ruby
require "fileutils"

# path to your application root.
APP_ROOT = File.expand_path("..", __dir__)
APP_NAME = "find-a-lost-trn"

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
system(*args, exception: true)
end

FileUtils.chdir APP_ROOT do
# This script is a way to set up or update your development environment automatically.
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this file.

puts "== Installing Ruby dependencies =="
puts "== Installing dependencies =="
system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install")

puts "\n== Installing Node dependencies =="
system("yarn")
system! "yarn"

# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
Expand All @@ -28,15 +28,13 @@ FileUtils.chdir APP_ROOT do
puts "\n== Preparing database =="
system! "bin/rails db:prepare"

puts "\n== Running data migrations =="
system! "bin/rails db:migrate:with_data"

puts "\n== Formatting db/data_schema.rb =="
system! "yarn run prettier --write 'db/data_schema.rb'"

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

puts "\n== Restarting application server =="
system! "bin/rails restart"

# puts "\n== Configuring puma-dev =="
# system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
end
5 changes: 5 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.0

# Please, add to the `ignore` list any other `lib` subdirectories that do
# not contain `.rb` files, or that should not be reloaded or eager loaded.
# Common ones are `templates`, `generators`, or `middleware`, for example.
config.autoload_lib(ignore: %w[assets tasks])

# Configuration for the application, engines, and railties goes here.
#
# These settings can be overridden in specific environments using the files
Expand Down
Loading

0 comments on commit de021f3

Please sign in to comment.