Skip to content

Commit ec2dd38

Browse files
authored
Merge pull request #872 from Fryguy/upgrade_rails
Upgrade to Rails 8.0
2 parents de69487 + 27a6f8c commit ec2dd38

18 files changed

Lines changed: 693 additions & 435 deletions

Gemfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ruby "~> 3.3.10"
66
plugin 'bundler-inject'
77
require File.join(Bundler::Plugin.index.load_paths("bundler-inject")[0], "bundler-inject") rescue nil
88

9-
gem 'rails', '~> 7.2.3'
9+
gem 'rails', '~> 8.0.4'
1010

1111
# Use PostgreSQL as the database for Active Record
1212
gem 'pg'
@@ -58,7 +58,3 @@ group :test do
5858
gem 'factory_bot_rails'
5959
gem 'webmock'
6060
end
61-
62-
# Gems listed to avoid warnings about their removal in future rubies
63-
gem 'drb' # Used by activesupport-7.0.8.7/lib/active_support/testing/parallelization.rb
64-
gem 'mutex_m' # Used by activesupport-7.0.8.7/lib/active_support/notifications.rb

Gemfile.lock

Lines changed: 56 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,65 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (7.2.3)
5-
actionpack (= 7.2.3)
6-
activesupport (= 7.2.3)
4+
actioncable (8.0.4)
5+
actionpack (= 8.0.4)
6+
activesupport (= 8.0.4)
77
nio4r (~> 2.0)
88
websocket-driver (>= 0.6.1)
99
zeitwerk (~> 2.6)
10-
actionmailbox (7.2.3)
11-
actionpack (= 7.2.3)
12-
activejob (= 7.2.3)
13-
activerecord (= 7.2.3)
14-
activestorage (= 7.2.3)
15-
activesupport (= 7.2.3)
10+
actionmailbox (8.0.4)
11+
actionpack (= 8.0.4)
12+
activejob (= 8.0.4)
13+
activerecord (= 8.0.4)
14+
activestorage (= 8.0.4)
15+
activesupport (= 8.0.4)
1616
mail (>= 2.8.0)
17-
actionmailer (7.2.3)
18-
actionpack (= 7.2.3)
19-
actionview (= 7.2.3)
20-
activejob (= 7.2.3)
21-
activesupport (= 7.2.3)
17+
actionmailer (8.0.4)
18+
actionpack (= 8.0.4)
19+
actionview (= 8.0.4)
20+
activejob (= 8.0.4)
21+
activesupport (= 8.0.4)
2222
mail (>= 2.8.0)
2323
rails-dom-testing (~> 2.2)
24-
actionpack (7.2.3)
25-
actionview (= 7.2.3)
26-
activesupport (= 7.2.3)
27-
cgi
24+
actionpack (8.0.4)
25+
actionview (= 8.0.4)
26+
activesupport (= 8.0.4)
2827
nokogiri (>= 1.8.5)
29-
racc
30-
rack (>= 2.2.4, < 3.3)
28+
rack (>= 2.2.4)
3129
rack-session (>= 1.0.1)
3230
rack-test (>= 0.6.3)
3331
rails-dom-testing (~> 2.2)
3432
rails-html-sanitizer (~> 1.6)
3533
useragent (~> 0.16)
36-
actiontext (7.2.3)
37-
actionpack (= 7.2.3)
38-
activerecord (= 7.2.3)
39-
activestorage (= 7.2.3)
40-
activesupport (= 7.2.3)
34+
actiontext (8.0.4)
35+
actionpack (= 8.0.4)
36+
activerecord (= 8.0.4)
37+
activestorage (= 8.0.4)
38+
activesupport (= 8.0.4)
4139
globalid (>= 0.6.0)
4240
nokogiri (>= 1.8.5)
43-
actionview (7.2.3)
44-
activesupport (= 7.2.3)
41+
actionview (8.0.4)
42+
activesupport (= 8.0.4)
4543
builder (~> 3.1)
46-
cgi
4744
erubi (~> 1.11)
4845
rails-dom-testing (~> 2.2)
4946
rails-html-sanitizer (~> 1.6)
50-
activejob (7.2.3)
51-
activesupport (= 7.2.3)
47+
activejob (8.0.4)
48+
activesupport (= 8.0.4)
5249
globalid (>= 0.3.6)
53-
activemodel (7.2.3)
54-
activesupport (= 7.2.3)
55-
activerecord (7.2.3)
56-
activemodel (= 7.2.3)
57-
activesupport (= 7.2.3)
50+
activemodel (8.0.4)
51+
activesupport (= 8.0.4)
52+
activerecord (8.0.4)
53+
activemodel (= 8.0.4)
54+
activesupport (= 8.0.4)
5855
timeout (>= 0.4.0)
59-
activestorage (7.2.3)
60-
actionpack (= 7.2.3)
61-
activejob (= 7.2.3)
62-
activerecord (= 7.2.3)
63-
activesupport (= 7.2.3)
56+
activestorage (8.0.4)
57+
actionpack (= 8.0.4)
58+
activejob (= 8.0.4)
59+
activerecord (= 8.0.4)
60+
activesupport (= 8.0.4)
6461
marcel (~> 1.0)
65-
activesupport (7.2.3)
62+
activesupport (8.0.4)
6663
base64
6764
benchmark (>= 0.3)
6865
bigdecimal
@@ -74,6 +71,7 @@ GEM
7471
minitest (>= 5.1)
7572
securerandom (>= 0.3)
7673
tzinfo (~> 2.0, >= 2.0.5)
74+
uri (>= 0.13.1)
7775
addressable (2.8.8)
7876
public_suffix (>= 2.0.2, < 8.0)
7977
ast (2.4.3)
@@ -181,7 +179,6 @@ GEM
181179
more_core_extensions (4.5.1)
182180
activesupport
183181
sync
184-
mutex_m (0.3.0)
185182
net-http (0.9.1)
186183
uri (>= 0.11.1)
187184
net-imap (0.5.7)
@@ -229,31 +226,30 @@ GEM
229226
rackup (1.0.1)
230227
rack (< 3)
231228
webrick
232-
rails (7.2.3)
233-
actioncable (= 7.2.3)
234-
actionmailbox (= 7.2.3)
235-
actionmailer (= 7.2.3)
236-
actionpack (= 7.2.3)
237-
actiontext (= 7.2.3)
238-
actionview (= 7.2.3)
239-
activejob (= 7.2.3)
240-
activemodel (= 7.2.3)
241-
activerecord (= 7.2.3)
242-
activestorage (= 7.2.3)
243-
activesupport (= 7.2.3)
229+
rails (8.0.4)
230+
actioncable (= 8.0.4)
231+
actionmailbox (= 8.0.4)
232+
actionmailer (= 8.0.4)
233+
actionpack (= 8.0.4)
234+
actiontext (= 8.0.4)
235+
actionview (= 8.0.4)
236+
activejob (= 8.0.4)
237+
activemodel (= 8.0.4)
238+
activerecord (= 8.0.4)
239+
activestorage (= 8.0.4)
240+
activesupport (= 8.0.4)
244241
bundler (>= 1.15.0)
245-
railties (= 7.2.3)
242+
railties (= 8.0.4)
246243
rails-dom-testing (2.3.0)
247244
activesupport (>= 5.0.0)
248245
minitest
249246
nokogiri (>= 1.6)
250247
rails-html-sanitizer (1.6.2)
251248
loofah (~> 2.21)
252249
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)
253-
railties (7.2.3)
254-
actionpack (= 7.2.3)
255-
activesupport (= 7.2.3)
256-
cgi
250+
railties (8.0.4)
251+
actionpack (= 8.0.4)
252+
activesupport (= 8.0.4)
257253
irb (~> 1.13)
258254
rackup (>= 1.0.0)
259255
rake (>= 12.2)
@@ -402,7 +398,6 @@ DEPENDENCIES
402398
awesome_spawn (~> 1.6)
403399
config
404400
default_value_for (~> 4.0)
405-
drb
406401
factory_bot_rails
407402
faraday (~> 2.14)
408403
faraday-http-cache (~> 2.6.0)
@@ -415,12 +410,11 @@ DEPENDENCIES
415410
manageiq-style (~> 1.5, >= 1.5.6)
416411
minigit (~> 0.0.4)
417412
more_core_extensions (~> 4.4)
418-
mutex_m
419413
net-ssh (~> 7.3.0)
420414
octokit (~> 4.25.0)
421415
pg
422416
puma
423-
rails (~> 7.2.3)
417+
rails (~> 8.0.4)
424418
rspec
425419
rspec-rails
426420
rugged

bin/dev

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env ruby
2+
exec "./bin/rails", "server", *ARGV

bin/setup

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
require "fileutils"
33

44
APP_ROOT = File.expand_path("..", __dir__)
5-
APP_NAME = "miq-bot"
65

76
def system!(*args)
87
system(*args, exception: true)
@@ -14,7 +13,6 @@ FileUtils.chdir APP_ROOT do
1413
# Add necessary setup steps to this file.
1514

1615
puts "== Installing dependencies =="
17-
system! "gem install bundler --conservative"
1816
system("bundle check") || system!("bundle install")
1917

2018
puts "\n== Copying sample files =="
@@ -28,10 +26,9 @@ FileUtils.chdir APP_ROOT do
2826
puts "\n== Removing old logs and tempfiles =="
2927
system! "bin/rails log:clear tmp:clear"
3028

31-
puts "\n== Restarting application server =="
32-
system! "bin/rails restart"
33-
34-
# puts "\n== Configuring puma-dev =="
35-
# system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
36-
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
29+
# unless ARGV.include?("--skip-server")
30+
# puts "\n== Starting development server =="
31+
# STDOUT.flush # flush the output before exec(2) so that it displays
32+
# exec "bin/dev"
33+
# end
3734
end

config/application.rb

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

9+
require "sidekiq/api"
10+
911
module MiqBot
1012
VERSION = "0.26.2".freeze
1113

@@ -20,7 +22,7 @@ def self.version
2022

2123
class Application < Rails::Application
2224
# Initialize configuration defaults for originally generated Rails version.
23-
config.load_defaults 7.2
25+
config.load_defaults 8.0
2426

2527
# Please, add to the `ignore` list any other `lib` subdirectories that do
2628
# not contain `.rb` files, or that should not be reloaded or eager loaded.

config/environments/development.rb

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
Rails.application.configure do
44
# Settings specified here will take precedence over those in config/application.rb.
55

6-
# In the development environment your application's code is reloaded any time
7-
# it changes. This slows down response time but is perfect for development
8-
# since you don't have to restart the web server when you make code changes.
6+
# Make code changes take effect immediately without server restart.
97
config.enable_reloading = true
108

119
# Do not eager load code on boot.
@@ -17,53 +15,46 @@
1715
# Enable server timing.
1816
config.server_timing = true
1917

20-
# Enable/disable caching. By default caching is disabled.
21-
# Run rails dev:cache to toggle caching.
18+
# Enable/disable Action Controller caching. By default Action Controller caching is disabled.
19+
# Run rails dev:cache to toggle Action Controller caching.
2220
if Rails.root.join("tmp/caching-dev.txt").exist?
2321
config.action_controller.perform_caching = true
2422
config.action_controller.enable_fragment_cache_logging = true
25-
26-
config.cache_store = :memory_store
27-
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" }
23+
config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
2824
else
2925
config.action_controller.perform_caching = false
30-
31-
config.cache_store = :null_store
3226
end
3327

28+
# Change to :null_store to avoid any caching.
29+
config.cache_store = :memory_store
30+
3431
# Store uploaded files on the local file system (see config/storage.yml for options).
3532
config.active_storage.service = :local
3633

3734
# Don't care if the mailer can't send.
3835
config.action_mailer.raise_delivery_errors = false
3936

40-
# Disable caching for Action Mailer templates even if Action Controller
41-
# caching is enabled.
37+
# Make template changes take effect immediately.
4238
config.action_mailer.perform_caching = false
4339

40+
# Set localhost to be used by links generated in mailer templates.
4441
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
4542

4643
# Print deprecation notices to the Rails logger.
4744
config.active_support.deprecation = :log
4845

49-
# Raise exceptions for disallowed deprecations.
50-
config.active_support.disallowed_deprecation = :raise
51-
52-
# Tell Active Support which deprecation messages to disallow.
53-
config.active_support.disallowed_deprecation_warnings = []
54-
5546
# Raise an error on page load if there are pending migrations.
5647
config.active_record.migration_error = :page_load
5748

5849
# Highlight code that triggered database queries in logs.
5950
config.active_record.verbose_query_logs = true
6051

52+
# Append comments with runtime information tags to SQL queries in logs.
53+
config.active_record.query_log_tags_enabled = true
54+
6155
# Highlight code that enqueued background job in logs.
6256
config.active_job.verbose_enqueue_logs = true
6357

64-
# Suppress logger output for asset requests.
65-
config.assets.quiet = true
66-
6758
# Raises error for missing translations.
6859
# config.i18n.raise_on_missing_translations = true
6960

0 commit comments

Comments
 (0)