From de7bf5459997d59a3b76ab50b11e03f6baa64cfb Mon Sep 17 00:00:00 2001 From: Hoerin Doh Date: Wed, 27 Dec 2023 17:47:10 +0900 Subject: [PATCH] Upgrade rails to 7.1 --- Gemfile | 3 +- Gemfile.lock | 193 +++++++++++++++++++++++----------------- app/models/api_token.rb | 2 +- config/application.yml | 1 + config/newrelic.yml | 4 + 5 files changed, 119 insertions(+), 84 deletions(-) create mode 100644 config/application.yml diff --git a/Gemfile b/Gemfile index f40edb4..297c384 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,7 @@ gem "redis" gem "hiredis" # Web server -gem "puma", "~> 5.6" +gem "puma" gem "rack-cors", "~> 1.1" # Utilities @@ -30,6 +30,7 @@ gem "faraday", "~> 2.2" # Ruby extensions gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ] gem "bootsnap", require: false +gem "figjam" # Monitoring gem "newrelic_rpm" diff --git a/Gemfile.lock b/Gemfile.lock index e4f8fd9..ee58482 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,73 +8,84 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8) - actionpack (= 7.0.8) - activesupport (= 7.0.8) + actioncable (7.1.2) + actionpack (= 7.1.2) + activesupport (= 7.1.2) 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.2) + actionpack (= 7.1.2) + activejob (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) 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.2) + actionpack (= 7.1.2) + actionview (= 7.1.2) + activejob (= 7.1.2) + activesupport (= 7.1.2) 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.2) + actionview (= 7.1.2) + activesupport (= 7.1.2) + nokogiri (>= 1.8.5) + racc + 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.2) + actionpack (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.8) - activesupport (= 7.0.8) + actionview (7.1.2) + activesupport (= 7.1.2) 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.2) + activesupport (= 7.1.2) 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.2) + activesupport (= 7.1.2) + activerecord (7.1.2) + activemodel (= 7.1.2) + activesupport (= 7.1.2) + timeout (>= 0.4.0) + activestorage (7.1.2) + actionpack (= 7.1.2) + activejob (= 7.1.2) + activerecord (= 7.1.2) + activesupport (= 7.1.2) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.8) + activesupport (7.1.2) + 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) android_key_attestation (0.3.0) awrence (1.2.1) + base64 (0.2.0) + bigdecimal (3.1.5) bindata (2.4.15) bootsnap (1.16.0) msgpack (~> 1.2) @@ -87,12 +98,14 @@ GEM cbor (~> 0.5.9) openssl-signature_algorithm (~> 1.0) crass (1.0.6) - date (3.3.3) + date (3.3.4) debug (1.8.0) irb (>= 1.5.0) reline (>= 0.3.1) diff-lcs (1.5.0) docile (1.4.0) + drb (2.2.0) + ruby2_keywords erubi (1.12.0) factory_bot (6.2.1) activesupport (>= 5.0.0) @@ -105,6 +118,8 @@ GEM faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) faraday-net_http (3.0.2) + figjam (1.6.0) + thor (>= 0.14.0, < 2) github-markup (4.0.1) globalid (1.2.1) activesupport (>= 6.1) @@ -112,11 +127,12 @@ GEM hiredis (0.6.3) i18n (1.14.1) concurrent-ruby (~> 1.0) - io-console (0.6.0) - irb (1.7.1) - reline (>= 0.3.0) + io-console (0.7.1) + irb (1.11.0) + rdoc + reline (>= 0.3.8) jwt (2.7.1) - loofah (2.21.4) + loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -125,51 +141,58 @@ GEM net-pop net-smtp marcel (1.0.2) - method_source (1.0.0) mini_mime (1.1.5) minitest (5.20.0) msgpack (1.7.1) - net-imap (0.4.2) + mutex_m (0.2.0) + net-imap (0.4.9) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout net-smtp (0.4.0) net-protocol newrelic_rpm (9.3.0) - nio4r (2.5.9) - nokogiri (1.15.4-arm64-darwin) + nio4r (2.7.0) + nokogiri (1.15.5-arm64-darwin) racc (~> 1.4) - nokogiri (1.15.4-x86_64-linux) + nokogiri (1.15.5-x86_64-linux) racc (~> 1.4) openssl (3.1.0) openssl-signature_algorithm (1.3.0) openssl (> 2.0) pg (1.5.3) - puma (5.6.7) + psych (5.1.2) + stringio + puma (6.4.0) nio4r (~> 2.0) - racc (1.7.1) - rack (2.2.8) + racc (1.7.3) + rack (3.0.8) rack-cors (1.1.1) rack (>= 2.0.0) + 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.2) + actioncable (= 7.1.2) + actionmailbox (= 7.1.2) + actionmailer (= 7.1.2) + actionpack (= 7.1.2) + actiontext (= 7.1.2) + actionview (= 7.1.2) + activejob (= 7.1.2) + activemodel (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) bundler (>= 1.15.0) - railties (= 7.0.8) + railties (= 7.1.2) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -177,19 +200,22 @@ GEM 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.2) + actionpack (= 7.1.2) + activesupport (= 7.1.2) + irb + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) - rake (13.0.6) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rake (13.1.0) + rdoc (6.6.2) + psych (>= 4.0.0) redis (5.0.6) redis-client (>= 0.9.0) redis-client (0.14.1) connection_pool - reline (0.3.5) + reline (0.4.1) io-console (~> 0.5) rspec-core (3.12.2) rspec-support (~> 3.12.0) @@ -217,9 +243,10 @@ GEM simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) + stringio (3.1.0) thor (1.3.0) timecop (0.9.6) - timeout (0.4.0) + timeout (0.4.1) tpm-key_attestation (0.12.0) bindata (~> 2.4) openssl (> 2.0) @@ -235,6 +262,7 @@ GEM openssl (>= 2.2) safety_net_attestation (~> 0.4.0) tpm-key_attestation (~> 0.12.0) + webrick (1.8.1) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -251,13 +279,14 @@ DEPENDENCIES factory_bot_rails faker faraday (~> 2.2) + figjam github-markup graphql (~> 2.0) hiredis jwt newrelic_rpm pg (~> 1.1) - puma (~> 5.6) + puma rack-cors (~> 1.1) rails (~> 7.0) redis diff --git a/app/models/api_token.rb b/app/models/api_token.rb index 1d0b1af..81131ea 100644 --- a/app/models/api_token.rb +++ b/app/models/api_token.rb @@ -39,7 +39,7 @@ def self.validate_key(key, key_type) private def self.secret - Rails.application.secrets.api_token_secret + Figjam.env.api_token_secret end def self.generate_jwt(payload, valid_until) diff --git a/config/application.yml b/config/application.yml new file mode 100644 index 0000000..59573c7 --- /dev/null +++ b/config/application.yml @@ -0,0 +1 @@ +API_TOKEN_SECRET: dummy diff --git a/config/newrelic.yml b/config/newrelic.yml index 4e7848f..3d30e43 100644 --- a/config/newrelic.yml +++ b/config/newrelic.yml @@ -10,6 +10,10 @@ development: <<: *default_settings log_level: debug +test: + <<: *default_settings + log_level: debug + production: <<: *default_settings log_level: info