Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 7.1 upgrade #26

Merged
merged 7 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source "https://rubygems.org"
ENV['PKG_CONFIG_PATH'] = [ "/opt/logjam/lib/pkgconfig", ENV['PKG_CONFIG_PATH'] ].compact.join(':')

gem "rake"
gem "rails", '~> 7.0.1'
gem "rails", '~> 7.1.0'
gem "dalli", '~> 3.1'
gem "mongo", '~> 2.17', '>= 2.17.1'
gem "bson", '~> 4.5'
Expand All @@ -13,7 +13,7 @@ gem "ffi", '~> 1.15'
gem "ffi-rzmq-core", '~> 1.0.5' #, :path => "~/src/ffi-rzmq-core"
gem "ffi-rzmq", '~> 2.0.1'
gem "snappy", '~> 0.3.0' #, :path => "~/src/rbsnappy"
gem "logjam_agent", '>= 0.32.2' #, :path => "~/src/logjam_agent"
gem "logjam_agent", '>= 0.39.0' # , :path => "~/src/logjam_agent"
gem "time_bandits", '>= 0.10' #, :path => "~/src/time_bandits"
gem "gc_hacks"
gem "whenever", :require => false
Expand Down
177 changes: 104 additions & 73 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,71 +1,81 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.8)
actionpack (= 7.0.8)
activesupport (= 7.0.8)
actioncable (7.1.0)
actionpack (= 7.1.0)
activesupport (= 7.1.0)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.8)
actionpack (= 7.0.8)
activejob (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
zeitwerk (~> 2.6)
actionmailbox (7.1.0)
actionpack (= 7.1.0)
activejob (= 7.1.0)
activerecord (= 7.1.0)
activestorage (= 7.1.0)
activesupport (= 7.1.0)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.8)
actionpack (= 7.0.8)
actionview (= 7.0.8)
activejob (= 7.0.8)
activesupport (= 7.0.8)
actionmailer (7.1.0)
actionpack (= 7.1.0)
actionview (= 7.1.0)
activejob (= 7.1.0)
activesupport (= 7.1.0)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.8)
actionview (= 7.0.8)
activesupport (= 7.0.8)
rack (~> 2.0, >= 2.2.4)
rails-dom-testing (~> 2.2)
actionpack (7.1.0)
actionview (= 7.1.0)
activesupport (= 7.1.0)
nokogiri (>= 1.8.5)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.8)
actionpack (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.0)
actionpack (= 7.1.0)
activerecord (= 7.1.0)
activestorage (= 7.1.0)
activesupport (= 7.1.0)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.8)
activesupport (= 7.0.8)
actionview (7.1.0)
activesupport (= 7.1.0)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.8)
activesupport (= 7.0.8)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.0)
activesupport (= 7.1.0)
globalid (>= 0.3.6)
activemodel (7.0.8)
activesupport (= 7.0.8)
activerecord (7.0.8)
activemodel (= 7.0.8)
activesupport (= 7.0.8)
activestorage (7.0.8)
actionpack (= 7.0.8)
activejob (= 7.0.8)
activerecord (= 7.0.8)
activesupport (= 7.0.8)
activemodel (7.1.0)
activesupport (= 7.1.0)
activerecord (7.1.0)
activemodel (= 7.1.0)
activesupport (= 7.1.0)
timeout (>= 0.4.0)
activestorage (7.1.0)
actionpack (= 7.1.0)
activejob (= 7.1.0)
activerecord (= 7.1.0)
activesupport (= 7.1.0)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.8)
activesupport (7.1.0)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
base64 (0.1.1)
bigdecimal (3.1.4)
bindex (0.8.1)
bson (4.15.0)
builder (3.2.4)
Expand All @@ -79,14 +89,17 @@ GEM
capistrano_colors (0.5.5)
chronic (0.10.2)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
crass (1.0.6)
cssbundling-rails (1.3.3)
railties (>= 6.0.0)
dalli (3.2.6)
date (3.3.3)
drb (2.1.1)
ruby2_keywords
erubi (1.12.0)
execjs (2.9.1)
ffi (1.16.2)
ffi (1.16.3)
ffi-rzmq (2.0.7)
ffi-rzmq-core (>= 1.0.7)
ffi-rzmq-core (1.0.7)
Expand All @@ -98,14 +111,18 @@ GEM
highline (2.1.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
io-console (0.6.0)
irb (1.8.1)
rdoc
reline (>= 0.3.8)
jsbundling-rails (1.2.1)
railties (>= 6.0.0)
logjam_agent (0.38.5)
logjam_agent (0.39.0)
activesupport
ffi-rzmq (>= 2.0.4)
ffi-rzmq-core (>= 1.0.5)
time_bandits (>= 0.12.2)
loofah (2.21.3)
loofah (2.21.4)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
Expand All @@ -114,12 +131,12 @@ GEM
net-pop
net-smtp
marcel (1.0.2)
method_source (1.0.0)
mini_mime (1.1.5)
minitest (5.20.0)
mongo (2.19.1)
bson (>= 4.14.1, < 5.0.0)
net-imap (0.3.7)
mutex_m (0.1.2)
net-imap (0.4.1)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -145,39 +162,52 @@ GEM
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
oj (3.16.1)
psych (5.1.1)
stringio
racc (1.7.1)
rack (2.2.8)
rack (3.0.8)
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.8)
actioncable (= 7.0.8)
actionmailbox (= 7.0.8)
actionmailer (= 7.0.8)
actionpack (= 7.0.8)
actiontext (= 7.0.8)
actionview (= 7.0.8)
activejob (= 7.0.8)
activemodel (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rails (7.1.0)
actioncable (= 7.1.0)
actionmailbox (= 7.1.0)
actionmailer (= 7.1.0)
actionpack (= 7.1.0)
actiontext (= 7.1.0)
actionview (= 7.1.0)
activejob (= 7.1.0)
activemodel (= 7.1.0)
activerecord (= 7.1.0)
activestorage (= 7.1.0)
activesupport (= 7.1.0)
bundler (>= 1.15.0)
railties (= 7.0.8)
railties (= 7.1.0)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.8)
actionpack (= 7.0.8)
activesupport (= 7.0.8)
method_source
railties (7.1.0)
actionpack (= 7.1.0)
activesupport (= 7.1.0)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rake (13.0.6)
rdoc (6.5.0)
psych (>= 4.0.0)
reline (0.3.9)
io-console (~> 0.5)
ruby2_keywords (0.0.5)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.4.0)
Expand All @@ -196,12 +226,13 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
stringio (3.0.8)
terser (1.1.18)
execjs (>= 0.3.0, < 3)
thor (1.2.2)
thread_variables (0.2.0)
tilt (2.3.0)
time_bandits (0.13.1)
time_bandits (0.14.1)
activesupport (>= 5.2.0)
thread_variables
timeout (0.4.0)
Expand Down Expand Up @@ -239,10 +270,10 @@ DEPENDENCIES
foreman
gc_hacks
jsbundling-rails
logjam_agent (>= 0.32.2)
logjam_agent (>= 0.39.0)
mongo (~> 2.17, >= 2.17.1)
oj (~> 3.0)
rails (~> 7.0.1)
rails (~> 7.1.0)
rake
sass-rails
snappy (~> 0.3.0)
Expand Down
2 changes: 1 addition & 1 deletion bin/rails
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../config/application', __dir__)
APP_PATH = File.expand_path("../config/application", __dir__)
require_relative "../config/boot"
require "rails/commands"
14 changes: 7 additions & 7 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
require "fileutils"

# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
APP_ROOT = File.expand_path("..", __dir__)

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 dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
puts "== Installing dependencies =="
system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install")

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

puts "\n== Restarting application server =="
system! 'bin/rails restart'
system! "bin/rails restart"
end
23 changes: 18 additions & 5 deletions config/application.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
require_relative 'boot'
require_relative "boot"

require "rails"
# Pick the frameworks you want:
# require "active_model/railtie"
require "active_model/railtie"
# require "active_job/railtie"
# require "active_record/railtie"
# require "active_storage/engine"
require "action_controller/railtie"
# require "action_mailer/railtie"
# require "action_mailbox/engine"
# require "action_text/engine"
require "action_view/railtie"
# require "action_cable/engine"
require "sprockets/railtie"
Expand All @@ -25,9 +28,7 @@

module LogjamApp
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.0

# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
Expand All @@ -45,6 +46,18 @@ class Application < Rails::Application
Rails.cache.logger = Rails.logger
Mongo::Logger.logger = Rails.logger
end
# 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
# in config/environments, which are processed later.
#
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")
end
end

Expand Down
5 changes: 3 additions & 2 deletions config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
ENV['ZMQ_LIB_PATH'] ||= "/opt/logjam/lib"
require 'bundler/setup' # Set up gems listed in the Gemfile.
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

require "bundler/setup" # Set up gems listed in the Gemfile.
Loading