diff --git a/.circleci/config.yml b/.circleci/config.yml index b7a96395..de7c19ae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,10 +4,10 @@ jobs: test: working_directory: ~/monolithium docker: - - image: cimg/ruby:3.2.2-browsers + - image: cimg/ruby:3.3.0-browsers environment: RAILS_ENV: test - - image: cimg/postgres:14.7 + - image: cimg/postgres:14.10 steps: - checkout diff --git a/.tool-versions b/.tool-versions index f2a971aa..3294aeda 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -ruby 3.2.2 +ruby 3.3.0 diff --git a/Gemfile b/Gemfile index 42d26d5e..e468f169 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" ruby File.read(".tool-versions").split.last -gem "rails", "7.0.7" +gem "rails", "7.1.2" gem "pg" gem "puma" diff --git a/Gemfile.lock b/Gemfile.lock index 6afe4a09..ba061e12 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,74 +1,85 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.0.7) - actionpack (= 7.0.7) - activesupport (= 7.0.7) + actioncable (7.1.2) + actionpack (= 7.1.2) + activesupport (= 7.1.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.7) - actionpack (= 7.0.7) - activejob (= 7.0.7) - activerecord (= 7.0.7) - activestorage (= 7.0.7) - activesupport (= 7.0.7) + 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.7) - actionpack (= 7.0.7) - actionview (= 7.0.7) - activejob (= 7.0.7) - activesupport (= 7.0.7) + 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.7) - actionview (= 7.0.7) - activesupport (= 7.0.7) - 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.7) - actionpack (= 7.0.7) - activerecord (= 7.0.7) - activestorage (= 7.0.7) - activesupport (= 7.0.7) + 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.7) - activesupport (= 7.0.7) + 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.7) - activesupport (= 7.0.7) + 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.7) - activesupport (= 7.0.7) - activerecord (7.0.7) - activemodel (= 7.0.7) - activesupport (= 7.0.7) - activestorage (7.0.7) - actionpack (= 7.0.7) - activejob (= 7.0.7) - activerecord (= 7.0.7) - activesupport (= 7.0.7) + 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.7) + 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) - addressable (2.8.5) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) + base64 (0.2.0) + bigdecimal (3.1.5) builder (3.2.4) capybara (3.39.2) addressable @@ -86,7 +97,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - date (3.3.3) + date (3.3.4) decent_exposure (3.0.4) activesupport (>= 4.0) diff-lcs (1.5.0) @@ -94,41 +105,50 @@ GEM dotenv-rails (2.8.1) dotenv (= 2.8.1) railties (>= 3.2) + drb (2.2.0) + ruby2_keywords erubi (1.12.0) - factory_bot (6.2.1) + factory_bot (6.4.5) activesupport (>= 5.0.0) - factory_bot_rails (6.2.0) - factory_bot (~> 6.2.0) + factory_bot_rails (6.4.3) + factory_bot (~> 6.4) railties (>= 5.0.0) - faraday (2.7.10) + faraday (2.8.1) + base64 faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) faraday-follow_redirects (0.3.0) faraday (>= 1, < 3) faraday-net_http (3.0.2) - globalid (1.1.0) - activesupport (>= 5.0) - graphql (2.0.26) + globalid (1.2.1) + activesupport (>= 6.1) + graphql (2.2.4) + racc (~> 1.4) graphql-client (0.18.0) activesupport (>= 3.0) graphql - haml (6.1.1) + haml (6.3.0) temple (>= 0.8.2) thor tilt - hashdiff (1.0.1) + hashdiff (1.1.0) i18n (1.14.1) concurrent-ruby (~> 1.0) - importmap-rails (1.2.1) + importmap-rails (2.0.1) actionpack (>= 6.0.0) + activesupport (>= 6.0.0) railties (>= 6.0.0) + io-console (0.7.1) + irb (1.11.0) + rdoc + reline (>= 0.3.8) jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) - json (2.6.3) + json (2.7.1) language_server-protocol (3.17.0.3) lint_roller (1.1.0) - loofah (2.21.3) + loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -140,52 +160,60 @@ GEM matrix (0.4.2) method_source (1.0.0) mini_mime (1.1.5) - mini_portile2 (2.8.4) - minitest (5.19.0) - net-imap (0.3.7) + mini_portile2 (2.8.5) + minitest (5.20.0) + mutex_m (0.2.0) + net-imap (0.4.9.1) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.4.0.1) net-protocol - nio4r (2.5.9) - nokogiri (1.15.3) + nio4r (2.7.0) + nokogiri (1.16.0) mini_portile2 (~> 2.8.2) racc (~> 1.4) - parallel (1.23.0) - parser (3.2.2.3) + parallel (1.24.0) + parser (3.3.0.0) ast (~> 2.4.1) racc - pg (1.5.3) + pg (1.5.4) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) pry-rails (0.3.9) pry (>= 0.10.4) - public_suffix (5.0.3) - puma (6.3.0) + psych (5.1.2) + stringio + public_suffix (5.0.4) + puma (6.4.1) nio4r (~> 2.0) - racc (1.7.1) - rack (2.2.8) + racc (1.7.3) + rack (3.0.8) + rack-session (2.0.0) + rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.7) - actioncable (= 7.0.7) - actionmailbox (= 7.0.7) - actionmailer (= 7.0.7) - actionpack (= 7.0.7) - actiontext (= 7.0.7) - actionview (= 7.0.7) - activejob (= 7.0.7) - activemodel (= 7.0.7) - activerecord (= 7.0.7) - activestorage (= 7.0.7) - activesupport (= 7.0.7) + 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.7) + railties (= 7.1.2) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -198,21 +226,26 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.0.7) - actionpack (= 7.0.7) - activesupport (= 7.0.7) - 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) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.0.6) + rake (13.1.0) + rdoc (6.6.2) + psych (>= 4.0.0) redcarpet (3.6.0) - redis (5.0.7) - redis-client (>= 0.9.0) - redis-client (0.15.0) + redis (5.0.8) + redis-client (>= 0.17.0) + redis-client (0.19.1) connection_pool - regexp_parser (2.8.1) + regexp_parser (2.8.3) + reline (0.4.2) + io-console (~> 0.5) rexml (3.2.6) rspec-core (3.12.2) rspec-support (~> 3.12.0) @@ -222,7 +255,7 @@ GEM rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-rails (6.0.3) + rspec-rails (6.1.0) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) @@ -231,80 +264,83 @@ GEM rspec-mocks (~> 3.12) rspec-support (~> 3.12) rspec-support (3.12.1) - rubocop (1.52.1) + rubocop (1.59.0) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.3) + parser (>= 3.2.2.4) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) + rubocop-ast (1.30.0) parser (>= 3.2.1.0) - rubocop-performance (1.18.0) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) + rubocop-performance (1.20.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) ruby-graphviz (1.2.5) rexml ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) rubyzip (2.3.2) - selenium-webdriver (4.11.0) + selenium-webdriver (4.16.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sidekiq (7.1.2) + sidekiq (7.2.0) concurrent-ruby (< 2) connection_pool (>= 2.3.0) rack (>= 2.2.4) redis-client (>= 0.14.0) - sprockets (4.2.0) + sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - standard (1.30.1) + standard (1.33.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.52.0) + rubocop (~> 1.59.0) standard-custom (~> 1.0.0) - standard-performance (~> 1.1.0) + standard-performance (~> 1.3) standard-custom (1.0.2) lint_roller (~> 1.0) rubocop (~> 1.50) - standard-performance (1.1.2) + standard-performance (1.3.0) lint_roller (~> 1.1) - rubocop-performance (~> 1.18.0) - stimulus-rails (1.2.2) + rubocop-performance (~> 1.20.1) + stimulus-rails (1.3.3) railties (>= 6.0.0) - tailwindcss-rails (2.0.30) + stringio (3.1.0) + tailwindcss-rails (2.2.0) railties (>= 6.0.0) - temple (0.10.2) - thor (1.2.2) - tilt (2.2.0) - timeout (0.4.0) - turbo-rails (1.4.0) + temple (0.10.3) + thor (1.3.0) + tilt (2.3.0) + timeout (0.4.1) + turbo-rails (1.5.0) actionpack (>= 6.0.0) activejob (>= 6.0.0) railties (>= 6.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.4.2) - webmock (3.18.1) + unicode-display_width (2.5.0) + webmock (3.19.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - websocket (1.2.9) + webrick (1.8.1) + websocket (1.2.10) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.11) + zeitwerk (2.6.12) PLATFORMS ruby @@ -323,7 +359,7 @@ DEPENDENCIES pg pry-rails puma - rails (= 7.0.7) + rails (= 7.1.2) rails-erd redcarpet redis @@ -338,7 +374,7 @@ DEPENDENCIES webmock RUBY VERSION - ruby 3.2.2p53 + ruby 3.3.0p0 BUNDLED WITH 2.4.3 diff --git a/app/controllers/admin/books_controller.rb b/app/controllers/admin/books_controller.rb index e0209066..4a5195a6 100644 --- a/app/controllers/admin/books_controller.rb +++ b/app/controllers/admin/books_controller.rb @@ -3,6 +3,7 @@ class Admin::BooksController < ApplicationController def create if book.save + EnhanceBookJob.perform_later(book.id) redirect_to edit_admin_book_path(book) else flash.alert = book.errors.full_messages diff --git a/app/models/book.rb b/app/models/book.rb index d6be58e3..b158d8c0 100644 --- a/app/models/book.rb +++ b/app/models/book.rb @@ -2,8 +2,6 @@ class Book < ApplicationRecord validates :isbn, presence: true validates :finished_on, presence: true - after_create :enqueue_enhance - def enhance! open_data = OpenLibraryApi.get_book(isbn) return unless open_data @@ -15,10 +13,4 @@ def enhance! } update!(open_attrs) end - - private - - def enqueue_enhance - EnhanceBookJob.perform_later(id) - end end diff --git a/app/models/killswitch.rb b/app/models/killswitch.rb index 9c1baf3a..e95d5381 100644 --- a/app/models/killswitch.rb +++ b/app/models/killswitch.rb @@ -6,7 +6,7 @@ def self.instance def self.load_instance killswitch = first || create path = Rails.root.join("config/initializers/killswitch.yml") - attrs = YAML.safe_load(File.read(path)) + attrs = YAML.safe_load_file(path) killswitch.update(attrs) killswitch end diff --git a/config/application.rb b/config/application.rb index 71e26e3f..3f3fe725 100644 --- a/config/application.rb +++ b/config/application.rb @@ -15,8 +15,8 @@ module Monolithium class Application < Rails::Application config.action_cable.disable_request_forgery_protection = true - config.active_record.legacy_connection_handling = false config.active_record.schema_format = :sql config.generators.system_tests = nil + config.load_defaults 7.1 end end diff --git a/spec/requests/api/v1/raw_hooks_spec.rb b/spec/requests/api/v1/raw_hooks_spec.rb index 3a2e9fcf..04e463be 100644 --- a/spec/requests/api/v1/raw_hooks_spec.rb +++ b/spec/requests/api/v1/raw_hooks_spec.rb @@ -9,7 +9,6 @@ HTTP_ACCEPT HTTP_COOKIE HTTP_HOST - HTTP_VERSION ORIGINAL_FULLPATH ORIGINAL_SCRIPT_NAME PATH_INFO