From 864745d3a569b77069f41f94c8c4ae3d82c37284 Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Wed, 5 Aug 2026 15:07:29 -0400 Subject: [PATCH 01/14] Initial update to Rails 8.0 This includes setting config.load_defaults to 8.0 from 7.2, which is slightly out of order from the usual process. --- Gemfile | 10 +-- Gemfile.lock | 144 +++++++++++++++++++++--------------------- config/application.rb | 2 +- 3 files changed, 78 insertions(+), 78 deletions(-) diff --git a/Gemfile b/Gemfile index ac428b72..c1c4c9a9 100644 --- a/Gemfile +++ b/Gemfile @@ -32,7 +32,9 @@ gem 'importmap-rails' # Build JSON APIs with ease [https://github.com/rails/jbuilder] gem 'jbuilder' -gem 'mitlibraries-theme', git: 'https://github.com/mitlibraries/mitlibraries-theme', tag: 'v1.4' +gem 'mitlibraries-theme', + git: 'https://github.com/mitlibraries/mitlibraries-theme', + tag: 'v1.5' # Use OmniAuth as Touchstone middleware and include the OIDC strategy and CSRF protection gems gem 'omniauth' @@ -52,7 +54,7 @@ gem 'puma', '>= 5.0' gem 'scout_apm' # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" -gem 'rails', '~> 7.2.2' +gem 'rails', '~> 8.0.0' # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] gem 'sprockets-rails' @@ -87,7 +89,7 @@ gem 'stringex' # gem "image_processing", "~> 1.2" group :production do - gem 'connection_pool', '< 3' + gem 'connection_pool' # Use postgres as the database for Active Record gem 'pg' end @@ -129,7 +131,7 @@ group :test do # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] gem 'capybara' gem 'climate_control' - gem 'minitest', '< 6' + gem 'minitest' gem 'mocha' gem 'selenium-webdriver' gem 'simplecov' diff --git a/Gemfile.lock b/Gemfile.lock index a7af478b..981e6bd1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,77 +1,74 @@ GIT remote: https://github.com/mitlibraries/mitlibraries-theme - revision: ba5bdc9840ef817ba0b92e522b92da3f52669fc3 - tag: v1.4 + revision: 135390daff870937212f1d9020abb6aea53c87d9 + tag: v1.5 specs: - mitlibraries-theme (1.0.2) - rails (>= 6, < 8) + mitlibraries-theme (1.1.0) + rails (>= 6, < 9) sassc-rails (~> 2) GEM remote: https://rubygems.org/ specs: - actioncable (7.2.3.2) - actionpack (= 7.2.3.2) - activesupport (= 7.2.3.2) + actioncable (8.0.5.1) + actionpack (= 8.0.5.1) + activesupport (= 8.0.5.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.2.3.2) - actionpack (= 7.2.3.2) - activejob (= 7.2.3.2) - activerecord (= 7.2.3.2) - activestorage (= 7.2.3.2) - activesupport (= 7.2.3.2) + actionmailbox (8.0.5.1) + actionpack (= 8.0.5.1) + activejob (= 8.0.5.1) + activerecord (= 8.0.5.1) + activestorage (= 8.0.5.1) + activesupport (= 8.0.5.1) mail (>= 2.8.0) - actionmailer (7.2.3.2) - actionpack (= 7.2.3.2) - actionview (= 7.2.3.2) - activejob (= 7.2.3.2) - activesupport (= 7.2.3.2) + actionmailer (8.0.5.1) + actionpack (= 8.0.5.1) + actionview (= 8.0.5.1) + activejob (= 8.0.5.1) + activesupport (= 8.0.5.1) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.2.3.2) - actionview (= 7.2.3.2) - activesupport (= 7.2.3.2) - cgi + actionpack (8.0.5.1) + actionview (= 8.0.5.1) + activesupport (= 8.0.5.1) nokogiri (>= 1.8.5) - racc - rack (>= 2.2.4, < 3.3) + rack (>= 2.2.4) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actiontext (7.2.3.2) - actionpack (= 7.2.3.2) - activerecord (= 7.2.3.2) - activestorage (= 7.2.3.2) - activesupport (= 7.2.3.2) + actiontext (8.0.5.1) + actionpack (= 8.0.5.1) + activerecord (= 8.0.5.1) + activestorage (= 8.0.5.1) + activesupport (= 8.0.5.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.2.3.2) - activesupport (= 7.2.3.2) + actionview (8.0.5.1) + activesupport (= 8.0.5.1) builder (~> 3.1) - cgi erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.2.3.2) - activesupport (= 7.2.3.2) + activejob (8.0.5.1) + activesupport (= 8.0.5.1) globalid (>= 0.3.6) - activemodel (7.2.3.2) - activesupport (= 7.2.3.2) - activerecord (7.2.3.2) - activemodel (= 7.2.3.2) - activesupport (= 7.2.3.2) + activemodel (8.0.5.1) + activesupport (= 8.0.5.1) + activerecord (8.0.5.1) + activemodel (= 8.0.5.1) + activesupport (= 8.0.5.1) timeout (>= 0.4.0) - activestorage (7.2.3.2) - actionpack (= 7.2.3.2) - activejob (= 7.2.3.2) - activerecord (= 7.2.3.2) - activesupport (= 7.2.3.2) + activestorage (8.0.5.1) + actionpack (= 8.0.5.1) + activejob (= 8.0.5.1) + activerecord (= 8.0.5.1) + activesupport (= 8.0.5.1) marcel (~> 1.0) - activesupport (7.2.3.2) + activesupport (8.0.5.1) base64 benchmark (>= 0.3) bigdecimal @@ -80,9 +77,10 @@ GEM drb i18n (>= 1.6, < 2) logger (>= 1.4.2) - minitest (>= 5.1, < 6) + minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) addressable (2.9.0) public_suffix (>= 2.0.2, < 8.0) administrate (1.0.0) @@ -91,9 +89,9 @@ GEM activerecord (>= 6.0, < 9.0) kaminari (~> 1.2.2) aes_key_wrap (1.1.0) - annotate (3.2.0) - activerecord (>= 3.2, < 8.0) - rake (>= 10.4, < 14.0) + annotate (2.6.5) + activerecord (>= 2.3.0) + rake (>= 0.8.7) ast (2.4.3) attr_required (1.0.2) awesome_print (1.9.2) @@ -120,10 +118,9 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - cgi (0.5.2) climate_control (1.2.0) concurrent-ruby (1.3.8) - connection_pool (2.5.5) + connection_pool (3.0.2) crack (1.0.1) bigdecimal rexml @@ -146,7 +143,7 @@ GEM dotenv (= 3.2.0) railties (>= 6.1) drb (2.2.3) - erb (6.0.6) + erb (6.0.7) erubi (1.13.1) faraday (2.14.3) faraday-net_http (>= 2.0, < 3.5) @@ -230,7 +227,9 @@ GEM marcel (1.2.1) matrix (0.4.3) mini_mime (1.1.5) - minitest (5.27.0) + minitest (6.0.6) + drb (~> 2.0) + prism (~> 1.5) mocha (3.1.0) ruby2_keywords (>= 0.0.5) msgpack (1.8.4) @@ -332,20 +331,20 @@ GEM rack (>= 1.3) rackup (2.3.1) rack (>= 3) - rails (7.2.3.2) - actioncable (= 7.2.3.2) - actionmailbox (= 7.2.3.2) - actionmailer (= 7.2.3.2) - actionpack (= 7.2.3.2) - actiontext (= 7.2.3.2) - actionview (= 7.2.3.2) - activejob (= 7.2.3.2) - activemodel (= 7.2.3.2) - activerecord (= 7.2.3.2) - activestorage (= 7.2.3.2) - activesupport (= 7.2.3.2) + rails (8.0.5.1) + actioncable (= 8.0.5.1) + actionmailbox (= 8.0.5.1) + actionmailer (= 8.0.5.1) + actionpack (= 8.0.5.1) + actiontext (= 8.0.5.1) + actionview (= 8.0.5.1) + activejob (= 8.0.5.1) + activemodel (= 8.0.5.1) + activerecord (= 8.0.5.1) + activestorage (= 8.0.5.1) + activesupport (= 8.0.5.1) bundler (>= 1.15.0) - railties (= 7.2.3.2) + railties (= 8.0.5.1) rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest @@ -353,10 +352,9 @@ GEM rails-html-sanitizer (1.7.1) loofah (~> 2.25, >= 2.25.2) 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) - railties (7.2.3.2) - actionpack (= 7.2.3.2) - activesupport (= 7.2.3.2) - cgi + railties (8.0.5.1) + actionpack (= 8.0.5.1) + activesupport (= 8.0.5.1) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) @@ -538,7 +536,7 @@ DEPENDENCIES cancancan capybara climate_control - connection_pool (< 3) + connection_pool csv debug devise @@ -547,7 +545,7 @@ DEPENDENCIES http importmap-rails jbuilder - minitest (< 6) + minitest mitlibraries-theme! mocha omniauth @@ -558,7 +556,7 @@ DEPENDENCIES pg puma (>= 5.0) rack-cors - rails (~> 7.2.2) + rails (~> 8.0.0) rubocop rubocop-capybara rubocop-graphql diff --git a/config/application.rb b/config/application.rb index 324bbac6..4e2b9ab1 100644 --- a/config/application.rb +++ b/config/application.rb @@ -9,7 +9,7 @@ module Tacos class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.2 + config.load_defaults 8.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. From ccc58837d0912e0f59523d3cbf1a882ad5b2923f Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Wed, 5 Aug 2026 16:46:22 -0400 Subject: [PATCH 02/14] accept app:update changes without modification Running bin/rails app:update generated a number of changes that were accepted without any modification. Those include: - Updates to public/error pages - Files in bin/ - Updated logging of filtered parameters (new filtered values) - Removed a comment block from assets.rb - Changes to the test environment initialization --- bin/dev | 2 + bin/setup | 13 +- config/environments/test.rb | 24 +-- config/initializers/assets.rb | 5 - .../initializers/filter_parameter_logging.rb | 2 +- public/400.html | 114 +++++++++++ public/404.html | 179 +++++++++++------- public/406-unsupported-browser.html | 178 ++++++++++------- public/422.html | 179 +++++++++++------- public/500.html | 178 ++++++++++------- public/icon.png | Bin 5599 -> 4166 bytes public/icon.svg | 4 +- 12 files changed, 581 insertions(+), 297 deletions(-) create mode 100755 bin/dev create mode 100644 public/400.html diff --git a/bin/dev b/bin/dev new file mode 100755 index 00000000..5f91c205 --- /dev/null +++ b/bin/dev @@ -0,0 +1,2 @@ +#!/usr/bin/env ruby +exec "./bin/rails", "server", *ARGV diff --git a/bin/setup b/bin/setup index 65d3106a..be3db3c0 100755 --- a/bin/setup +++ b/bin/setup @@ -2,7 +2,6 @@ require "fileutils" APP_ROOT = File.expand_path("..", __dir__) -APP_NAME = "tacos" def system!(*args) system(*args, exception: true) @@ -14,7 +13,6 @@ FileUtils.chdir APP_ROOT do # Add necessary setup steps to this file. puts "== Installing dependencies ==" - system! "gem install bundler --conservative" system("bundle check") || system!("bundle install") # puts "\n== Copying sample files ==" @@ -28,10 +26,9 @@ FileUtils.chdir APP_ROOT do 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" + unless ARGV.include?("--skip-server") + puts "\n== Starting development server ==" + STDOUT.flush # flush the output before exec(2) so that it displays + exec "bin/dev" + end end diff --git a/config/environments/test.rb b/config/environments/test.rb index 0c616a1b..c2095b11 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,5 +1,3 @@ -require "active_support/core_ext/integer/time" - # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped @@ -17,12 +15,11 @@ # loading is working properly before deploying your code. config.eager_load = ENV["CI"].present? - # Configure public file server for tests with Cache-Control for performance. - config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" } + # Configure public file server for tests with cache-control for performance. + config.public_file_server.headers = { "cache-control" => "public, max-age=3600" } - # Show full error reports and disable caching. + # Show full error reports. config.consider_all_requests_local = true - config.action_controller.perform_caching = false config.cache_store = :null_store # Render exception templates for rescuable exceptions and raise for other exceptions. @@ -34,28 +31,17 @@ # Store uploaded files on the local file system in a temporary directory. config.active_storage.service = :test - # Disable caching for Action Mailer templates even if Action Controller - # caching is enabled. - config.action_mailer.perform_caching = false - # Tell Action Mailer not to deliver emails to the real world. # The :test delivery method accumulates sent emails in the # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test - # Unlike controllers, the mailer instance doesn't have any context about the - # incoming request so you'll need to provide the :host parameter yourself. - config.action_mailer.default_url_options = { host: "www.example.com" } + # Set host to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "example.com" } # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr - # Raise exceptions for disallowed deprecations. - config.active_support.disallowed_deprecation = :raise - - # Tell Active Support which deprecation messages to disallow. - config.active_support.disallowed_deprecation_warnings = [] - # Raises error for missing translations. # config.i18n.raise_on_missing_translations = true diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index bd5bcd2b..48732442 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -5,8 +5,3 @@ # Add additional assets to the asset load path. # Rails.application.config.assets.paths << Emoji.images_path - -# Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in the app/assets -# folder are already added. -# Rails.application.config.assets.precompile += %w[ admin.js admin.css ] diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index 9b8100bd..c0b717f7 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -4,5 +4,5 @@ # Use this to limit dissemination of sensitive information. # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. Rails.application.config.filter_parameters += [ - :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp + :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc ] diff --git a/public/400.html b/public/400.html new file mode 100644 index 00000000..282dbc8c --- /dev/null +++ b/public/400.html @@ -0,0 +1,114 @@ + + + + + + + The server cannot process the request due to a client error (400 Bad Request) + + + + + + + + + + + + + +
+
+ +
+
+

The server cannot process the request due to a client error. Please check the request and try again. If you’re the application owner check the logs for more information.

+
+
+ + + + diff --git a/public/404.html b/public/404.html index 2be3af26..c0670bc8 100644 --- a/public/404.html +++ b/public/404.html @@ -1,67 +1,114 @@ - - - - The page you were looking for doesn't exist (404) - - - - - - -
-
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
-

If you are the application owner check the logs for more information.

-
- + + + + + + + The page you were looking for doesn’t exist (404 Not found) + + + + + + + + + + + + + +
+
+ +
+
+

The page you were looking for doesn’t exist. You may have mistyped the address or the page may have moved. If you’re the application owner check the logs for more information.

+
+
+ + + diff --git a/public/406-unsupported-browser.html b/public/406-unsupported-browser.html index 7cf1e168..9532a9cc 100644 --- a/public/406-unsupported-browser.html +++ b/public/406-unsupported-browser.html @@ -1,66 +1,114 @@ - - - - Your browser is not supported (406) - - - - - - -
-
-

Your browser is not supported.

-

Please upgrade your browser to continue.

-
-
- + + + + + + + Your browser is not supported (406 Not Acceptable) + + + + + + + + + + + + + +
+
+ +
+
+

Your browser is not supported.
Please upgrade your browser to continue.

+
+
+ + + diff --git a/public/422.html b/public/422.html index c08eac0d..8bcf0601 100644 --- a/public/422.html +++ b/public/422.html @@ -1,67 +1,114 @@ - - - - The change you wanted was rejected (422) - - - - - - -
-
-

The change you wanted was rejected.

-

Maybe you tried to change something you didn't have access to.

-
-

If you are the application owner check the logs for more information.

-
- + + + + + + + The change you wanted was rejected (422 Unprocessable Entity) + + + + + + + + + + + + + +
+
+ +
+
+

The change you wanted was rejected. Maybe you tried to change something you didn’t have access to. If you’re the application owner check the logs for more information.

+
+
+ + + diff --git a/public/500.html b/public/500.html index 78a030af..d77718c3 100644 --- a/public/500.html +++ b/public/500.html @@ -1,66 +1,114 @@ - - - - We're sorry, but something went wrong (500) - - - - - - -
-
-

We're sorry, but something went wrong.

-
-

If you are the application owner check the logs for more information.

-
- + + + + + + + We’re sorry, but something went wrong (500 Internal Server Error) + + + + + + + + + + + + + +
+
+ +
+
+

We’re sorry, but something went wrong.
If you’re the application owner check the logs for more information.

+
+
+ + + diff --git a/public/icon.png b/public/icon.png index f3b5abcbde91cf6d7a6a26e514eb7e30f476f950..c4c9dbfbbd2f7c1421ffd5727188146213abbcef 100644 GIT binary patch literal 4166 zcmd6qU;WFw?|v@m)Sk^&NvB8tcujdV-r1b=i(NJxn&7{KTb zX$3(M+3TP2o^#KAo{#tIjl&t~(8D-k004kqPglzn0HFG(Q~(I*AKsD#M*g7!XK0T7 zN6P7j>HcT8rZgKl$v!xr806dyN19Bd4C0x_R*I-a?#zsTvb_89cyhuC&T**i|Rc zq5b8M;+{8KvoJ~uj9`u~d_f6`V&3+&ZX9x5pc8s)d175;@pjm(?dapmBcm0&vl9+W zx1ZD2o^nuyUHWj|^A8r>lUorO`wFF;>9XL-Jy!P}UXC{(z!FO%SH~8k`#|9;Q|eue zqWL0^Bp(fg_+Pkm!fDKRSY;+^@BF?AJE zCUWpXPst~hi_~u)SzYBDZroR+Z4xeHIlm_3Yc_9nZ(o_gg!jDgVa=E}Y8uDgem9`b zf=mfJ_@(BXSkW53B)F2s!&?_R4ptb1fYXlF++@vPhd=marQgEGRZS@B4g1Mu?euknL= z67P~tZ?*>-Hmi7GwlisNHHJDku-dSm7g@!=a}9cSL6Pa^w^2?&?$Oi8ibrr>w)xqx zOH_EMU@m05)9kuNR>>4@H%|){U$^yvVQ(YgOlh;5oU_-vivG-p4=LrN-k7D?*?u1u zsWly%tfAzKd6Fb=`eU2un_uaTXmcT#tlOL+aRS=kZZf}A7qT8lvcTx~7j` z*b>=z)mwg7%B2_!D0!1IZ?Nq{^Y$uI4Qx*6T!E2Col&2{k?ImCO=dD~A&9f9diXy^$x{6CwkBimn|1E09 zAMSezYtiL?O6hS37KpvDM?22&d{l)7h-!F)C-d3j8Z`c@($?mfd{R82)H>Qe`h{~G z!I}(2j(|49{LR?w4Jspl_i!(4T{31|dqCOpI52r5NhxYV+cDAu(xp*4iqZ2e-$YP= zoFOPmm|u*7C?S{Fp43y+V;>~@FFR76bCl@pTtyB93vNWy5yf;HKr8^0d7&GVIslYm zo3Tgt@M!`8B6IW&lK{Xk>%zp41G%`(DR&^u z5^pwD4>E6-w<8Kl2DzJ%a@~QDE$(e87lNhy?-Qgep!$b?5f7+&EM7$e>|WrX+=zCb z=!f5P>MxFyy;mIRxjc(H*}mceXw5a*IpC0PEYJ8Y3{JdoIW)@t97{wcUB@u+$FCCO z;s2Qe(d~oJC^`m$7DE-dsha`glrtu&v&93IZadvl_yjp!c89>zo;Krk+d&DEG4?x$ zufC1n+c1XD7dolX1q|7}uelR$`pT0Z)1jun<39$Sn2V5g&|(j~Z!wOddfYiZo7)A< z!dK`aBHOOk+-E_xbWCA3VR-+o$i5eO9`rMI#p_0xQ}rjEpGW;U!&&PKnivOcG(|m9 z!C8?WC6nCXw25WVa*eew)zQ=h45k8jSIPbq&?VE{oG%?4>9rwEeB4&qe#?-y_es4c|7ufw%+H5EY#oCgv!Lzv291#-oNlX~X+Jl5(riC~r z=0M|wMOP)Tt8@hNg&%V@Z9@J|Q#K*hE>sr6@oguas9&6^-=~$*2Gs%h#GF@h)i=Im z^iKk~ipWJg1VrvKS;_2lgs3n1zvNvxb27nGM=NXE!D4C!U`f*K2B@^^&ij9y}DTLB*FI zEnBL6y{jc?JqXWbkIZd7I16hA>(f9T!iwbIxJj~bKPfrO;>%*5nk&Lf?G@c2wvGrY&41$W{7HM9+b@&XY@>NZM5s|EK_Dp zQX60CBuantx>|d#DsaZ*8MW(we|#KTYZ=vNa#d*DJQe6hr~J6{_rI#?wi@s|&O}FR zG$kfPxheXh1?IZ{bDT-CWB4FTvO-k5scW^mi8?iY5Q`f8JcnnCxiy@m@D-%lO;y0pTLhh6i6l@x52j=#^$5_U^os}OFg zzdHbo(QI`%9#o*r8GCW~T3UdV`szO#~)^&X_(VW>o~umY9-ns9-V4lf~j z`QBD~pJ4a#b`*6bJ^3RS5y?RAgF7K5$ll97Y8#WZduZ`j?IEY~H(s^doZg>7-tk*t z4_QE1%%bb^p~4F5SB$t2i1>DBG1cIo;2(xTaj*Y~hlM{tSDHojL-QPg%Mo%6^7FrpB*{ z4G0@T{-77Por4DCMF zB_5Y~Phv%EQ64W8^GS6h?x6xh;w2{z3$rhC;m+;uD&pR74j+i22P5DS-tE8ABvH(U~indEbBUTAAAXfHZg5QpB@TgV9eI<)JrAkOI z8!TSOgfAJiWAXeM&vR4Glh;VxH}WG&V$bVb`a`g}GSpwggti*&)taV1@Ak|{WrV|5 zmNYx)Ans=S{c52qv@+jmGQ&vd6>6yX6IKq9O$3r&0xUTdZ!m1!irzn`SY+F23Rl6# zFRxws&gV-kM1NX(3(gnKpGi0Q)Dxi~#?nyzOR9!en;Ij>YJZVFAL*=R%7y%Mz9hU% zs>+ZB?qRmZ)nISx7wxY)y#cd$iaC~{k0avD>BjyF1q^mNQ1QcwsxiTySe<6C&cC6P zE`vwO9^k-d`9hZ!+r@Jnr+MF*2;2l8WjZ}DrwDUHzSF{WoG zucbSWguA!3KgB3MU%HH`R;XqVv0CcaGq?+;v_A5A2kpmk5V%qZE3yzQ7R5XWhq=eR zyUezH=@V)y>L9T-M-?tW(PQYTRBKZSVb_!$^H-Pn%ea;!vS_?M<~Tm>_rWIW43sPW z=!lY&fWc1g7+r?R)0p8(%zp&vl+FK4HRkns%BW+Up&wK8!lQ2~bja|9bD12WrKn#M zK)Yl9*8$SI7MAwSK$%)dMd>o+1UD<2&aQMhyjS5R{-vV+M;Q4bzl~Z~=4HFj_#2V9 zB)Gfzx3ncy@uzx?yzi}6>d%-?WE}h7v*w)Jr_gBl!2P&F3DX>j_1#--yjpL%<;JMR z*b70Gr)MMIBWDo~#<5F^Q0$VKI;SBIRneuR7)yVsN~A9I@gZTXe)E?iVII+X5h0~H zx^c(fP&4>!*q>fb6dAOC?MI>Cz3kld#J*;uik+Ps49cwm1B4 zZc1|ZxYyTv;{Z!?qS=D)sgRKx^1AYf%;y_V&VgZglfU>d+Ufk5&LV$sKv}Hoj+s; xK3FZRYdhbXT_@RW*ff3@`D1#ps#~H)p+y&j#(J|vk^lW{fF9OJt5(B-_&*Xgn9~3N literal 5599 zcmeHL-D}fO6hCR_taXJlzs3}~RuB=Iujyo=i*=1|1FN%E=zNfMTjru|Q<6v{J{U!C zBEE}?j6I3sz>fzN!6}L_BKjcuASk~1;Dg|U_@d{g?V8mM`~#9U+>>*Ezw>c(PjYWA z4(;!cgge6k5E&d$G5`S-0}!Ik>CV(0Y#1}s-v_gAHhja2=W1?nBAte9D2HG<(+)uj z!5=W4u*{VKMw#{V@^NNs4TClr!FAA%ID-*gc{R%CFKEzG<6gm*9s_uy)oMGW*=nJf zw{(Mau|2FHfXIv6C0@Wk5k)F=3jo1srV-C{pl&k&)4_&JjYrnbJiul}d0^NCSh(#7h=F;3{|>EU>h z6U8_p;^wK6mAB(1b92>5-HxJ~V}@3?G`&Qq-TbJ2(&~-HsH6F#8mFaAG(45eT3VPO zM|(Jd<+;UZs;w>0Qw}0>D%{~r{uo_Fl5_Bo3ABWi zWo^j^_T3dxG6J6fH8X)$a^%TJ#PU!=LxF=#Fd9EvKx_x>q<(KY%+y-08?kN9dXjXK z**Q=yt-FTU*13ouhCdqq-0&;Ke{T3sQU9IdzhV9LhQIpq*P{N)+}|Mh+a-VV=x?R} c>%+pvTcMWshj-umO}|qP?%A)*_KlqT3uEqhU;qFB diff --git a/public/icon.svg b/public/icon.svg index 78307ccd..04b34bf8 100644 --- a/public/icon.svg +++ b/public/icon.svg @@ -1,3 +1,3 @@ - - + + From f2b9f110a76e94f7f7f2721ee30f694a7f89e450 Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Wed, 5 Aug 2026 17:31:49 -0400 Subject: [PATCH 03/14] accept app:update changes with some modification After running bin/rails app:update, a few files were changed in a way that needed some modification before committing. Those modifications are in this commit, and include: 1. config/environments/development.rb - Kept local logging overrides in place 2. config/environments/production.rb - kept config.public_file_server.enabled, but behind an env var - kept config.assets.compile = false - kept the config.logger block intact, which adds a formatter prior to tagging 3. config/initilizaers/cors.rb - rejected the suggested removal of the block we're actually using (this results in no actual change to the file) 4. config/puma.rb - kept the barnes gem in place for additional reporting in Heroku See: https://mitlibraries.atlassian.net/browse/TCO-78 https://github.com/heroku/barnes --- config/environments/development.rb | 33 ++++++--------- config/environments/production.rb | 68 ++++++++++++++---------------- config/puma.rb | 11 ++++- 3 files changed, 52 insertions(+), 60 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index 45332dc0..caaf8a3d 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -3,9 +3,7 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - # In the development environment your application's code is reloaded any time - # it changes. This slows down response time but is perfect for development - # since you don't have to restart the web server when you make code changes. + # Make code changes take effect immediately without server restart. config.enable_reloading = true # Do not eager load code on boot. @@ -17,53 +15,46 @@ # Enable server timing. config.server_timing = true - # Enable/disable caching. By default caching is disabled. - # Run rails dev:cache to toggle caching. + # Enable/disable Action Controller caching. By default Action Controller caching is disabled. + # Run rails dev:cache to toggle Action Controller caching. if Rails.root.join("tmp/caching-dev.txt").exist? config.action_controller.perform_caching = true config.action_controller.enable_fragment_cache_logging = true - - config.cache_store = :memory_store - config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" } + config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" } else config.action_controller.perform_caching = false - - config.cache_store = :null_store end + # Change to :null_store to avoid any caching. + config.cache_store = :memory_store + # Store uploaded files on the local file system (see config/storage.yml for options). config.active_storage.service = :local # Don't care if the mailer can't send. config.action_mailer.raise_delivery_errors = false - # Disable caching for Action Mailer templates even if Action Controller - # caching is enabled. + # Make template changes take effect immediately. config.action_mailer.perform_caching = false + # Set localhost to be used by links generated in mailer templates. config.action_mailer.default_url_options = { host: "localhost", port: 3000 } # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log - # Raise exceptions for disallowed deprecations. - config.active_support.disallowed_deprecation = :raise - - # Tell Active Support which deprecation messages to disallow. - config.active_support.disallowed_deprecation_warnings = [] - # Raise an error on page load if there are pending migrations. config.active_record.migration_error = :page_load # Highlight code that triggered database queries in logs. config.active_record.verbose_query_logs = true + # Append comments with runtime information tags to SQL queries in logs. + config.active_record.query_log_tags_enabled = true + # Highlight code that enqueued background job in logs. config.active_job.verbose_enqueue_logs = true - # Suppress logger output for asset requests. - config.assets.quiet = true - # Raises error for missing translations. # config.i18n.raise_on_missing_translations = true diff --git a/config/environments/production.rb b/config/environments/production.rb index b1771c62..a8c2151f 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -6,25 +6,20 @@ # Code is not reloaded between requests. config.enable_reloading = false - # Eager load code on boot. This eager loads most of Rails and - # your application in memory, allowing both threaded web servers - # and those relying on copy on write to perform better. - # Rake tasks automatically ignore this option for performance. + # Eager load code on boot for better performance and memory savings (ignored by Rake tasks). config.eager_load = true - # Full error reports are disabled and caching is turned on. + # Full error reports are disabled. config.consider_all_requests_local = false - config.action_controller.perform_caching = true - # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment - # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files). - # config.require_master_key = true + # Turn on fragment caching in view templates. + config.action_controller.perform_caching = true # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. - config.public_file_server.enabled = true + config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? - # Compress CSS using a preprocessor. - # config.assets.css_compressor = :sass + # Cache assets for far-future expiry since they are all digest stamped. + config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" } # Do not fall back to assets pipeline if a precompiled asset is missed. config.assets.compile = false @@ -32,21 +27,11 @@ # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.asset_host = "http://assets.example.com" - # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache - # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX - # Store uploaded files on the local file system (see config/storage.yml for options). config.active_storage.service = :local - # Mount Action Cable outside main process or domain. - # config.action_cable.mount_path = nil - # config.action_cable.url = "wss://example.com/cable" - # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] - # Assume all access to the app is happening through a SSL-terminating reverse proxy. - # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies. - # config.assume_ssl = true + config.assume_ssl = true # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. config.force_ssl = true @@ -59,36 +44,44 @@ .tap { |logger| logger.formatter = ::Logger::Formatter.new } .then { |logger| ActiveSupport::TaggedLogging.new(logger) } - # Prepend all log lines with the following tags. + # Log to STDOUT with the current request id as a default log tag. config.log_tags = [ :request_id ] - # "info" includes generic and useful information about system operation, but avoids logging too much - # information to avoid inadvertent exposure of personally identifiable information (PII). If you - # want to log everything, set the level to "debug". + # Change to "debug" to log everything (including potentially personally-identifiable information!) config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") - # Use a different cache store in production. + # Prevent health checks from clogging up the logs. + config.silence_healthcheck_path = "/up" + + # Don't log any deprecations. + config.active_support.report_deprecations = false + + # Replace the default in-process memory cache store with a durable alternative. # config.cache_store = :mem_cache_store - # Use a real queuing backend for Active Job (and separate queues per environment). + # Replace the default in-process and non-durable queuing backend for Active Job. # config.active_job.queue_adapter = :resque - # config.active_job.queue_name_prefix = "tacos_production" - - # Disable caching for Action Mailer templates even if Action Controller - # caching is enabled. - config.action_mailer.perform_caching = false # Ignore bad email addresses and do not raise email delivery errors. # Set this to true and configure the email server for immediate delivery to raise delivery errors. # config.action_mailer.raise_delivery_errors = false + # Set host to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "example.com" } + + # Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit. + # config.action_mailer.smtp_settings = { + # user_name: Rails.application.credentials.dig(:smtp, :user_name), + # password: Rails.application.credentials.dig(:smtp, :password), + # address: "smtp.example.com", + # port: 587, + # authentication: :plain + # } + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true - # Don't log any deprecations. - config.active_support.report_deprecations = false - # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false @@ -100,6 +93,7 @@ # "example.com", # Allow requests from example.com # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` # ] + # # Skip DNS rebinding protection for the default health check endpoint. # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } end diff --git a/config/puma.rb b/config/puma.rb index 7f170318..a3e70a02 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,13 +1,17 @@ # This configuration file will be evaluated by Puma. The top-level methods that # are invoked here are part of Puma's configuration DSL. For more information # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. - +# # Puma starts a configurable number of processes (workers) and each process # serves each request in a thread from an internal thread pool. # +# You can control the number of workers using ENV["WEB_CONCURRENCY"]. You +# should only set this value when you want to run 2 or more workers. The +# default is already 1. +# # The ideal number of threads per worker depends both on how much time the # application spends waiting for IO operations and on how much you wish to -# to prioritize throughput over latency. +# prioritize throughput over latency. # # As a rule of thumb, increasing the number of threads will increase how much # traffic a given process can handle (throughput), but due to CRuby's @@ -37,6 +41,9 @@ Barnes.start # Must have enabled worker mode for this to block to be called end +# Run the Solid Queue supervisor inside of Puma for single-server deployments +plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"] + # Specify the PID file. Defaults to tmp/pids/server.pid in development. # In other environments, only set the PID file if requested. pidfile ENV["PIDFILE"] if ENV["PIDFILE"] From f2c5f39e0efcc58bd30d2c20ad93a8e68ce0a309 Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Thu, 6 Aug 2026 11:38:48 -0400 Subject: [PATCH 04/14] Update renovate integration --- renovate.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renovate.json b/renovate.json index e79a64f6..7409904d 100644 --- a/renovate.json +++ b/renovate.json @@ -8,13 +8,13 @@ "matchPackageNames": [ "ruby" ], - "allowedVersions": "<3.5" + "allowedVersions": "<4" }, { "matchPackageNames": [ "rails" ], - "allowedVersions": "<8" + "allowedVersions": "<8.1" } ] } From 201cbff09042aaccd5d3136fabd1548845a23b88 Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Thu, 6 Aug 2026 11:46:04 -0400 Subject: [PATCH 05/14] Swap from annotate to annotaterb gems This also adds a readme section describing the existing makefile command --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- Makefile | 2 +- README.md | 4 ++++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index c1c4c9a9..d68656a4 100644 --- a/Gemfile +++ b/Gemfile @@ -109,7 +109,7 @@ end group :development do # Add annotations to model, test, fixtures when run - gem 'annotate' + gem 'annotaterb' # RuboCop is a Ruby static code analyzer (a.k.a. linter) and code formatter. gem 'rubocop', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 981e6bd1..1773dace 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -89,9 +89,9 @@ GEM activerecord (>= 6.0, < 9.0) kaminari (~> 1.2.2) aes_key_wrap (1.1.0) - annotate (2.6.5) - activerecord (>= 2.3.0) - rake (>= 0.8.7) + annotaterb (4.24.0) + activerecord (>= 6.0.0) + activesupport (>= 6.0.0) ast (2.4.3) attr_required (1.0.2) awesome_print (1.9.2) @@ -529,7 +529,7 @@ PLATFORMS DEPENDENCIES administrate (~> 1.0.0) - annotate + annotaterb awesome_print barnes bootsnap diff --git a/Makefile b/Makefile index ca21f571..37d4ebd3 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ coverage: test # Run tests and open coverage report in default web browser ####################### annotate: # update Rails models documentation header - bundle exec annotate --models + bundle exec annotaterb models docserver: # runs local documentation server rm -rf .yardoc # Clears cache as it's sketchy af diff --git a/README.md b/README.md index dad8ecfc..ad561170 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,10 @@ apps; it should never be manually set or overridden in any environment. [Pattern Detection and Enhancement](docs/explanation/pattern_detection_and_enhancement.md) +### Annotations + +`make annotate` when making changes to models will update their internal documentation. + ### Reference `make docserver` will start a `yard` server using the RDoc comments from the codebase. RDoc in this application is a work-in-progress and should improve over time. As of this writing, the index page generated contains broken links to our markdown documentation, but they "files" navigation displays them properly. From dfcec8720cda08b24c3cbd1cdd215df060f6f8aa Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Thu, 6 Aug 2026 11:46:16 -0400 Subject: [PATCH 06/14] Output of make annotaterb --- app/models/categorization.rb | 15 +++++++++++++-- app/models/category.rb | 6 +++++- app/models/confirmation.rb | 20 +++++++++++++++++--- app/models/detection.rb | 16 ++++++++++++++-- app/models/detector.rb | 4 ++++ app/models/detector_category.rb | 16 ++++++++++++++-- app/models/fingerprint.rb | 4 ++++ app/models/journal.rb | 6 +++++- app/models/metrics/algorithms.rb | 14 +++++++------- app/models/search_event.rb | 7 ++++++- app/models/suggested_pattern.rb | 16 +++++++++++++--- app/models/suggested_resource.rb | 10 +++++++++- app/models/term.rb | 14 +++++++++++++- app/models/user.rb | 9 +++++++-- test/fixtures/categories.yml | 6 +++++- test/fixtures/categorizations.yml | 15 +++++++++++++-- test/fixtures/confirmations.yml | 20 +++++++++++++++++--- test/fixtures/detections.yml | 16 ++++++++++++++-- test/fixtures/detector_categories.yml | 16 ++++++++++++++-- test/fixtures/detectors.yml | 4 ++++ test/fixtures/fingerprints.yml | 4 ++++ test/fixtures/journals.yml | 6 +++++- test/fixtures/search_events.yml | 7 ++++++- test/fixtures/suggested_patterns.yml | 16 +++++++++++++--- test/fixtures/suggested_resources.yml | 10 +++++++++- test/fixtures/terms.yml | 14 +++++++++++++- test/fixtures/users.yml | 9 +++++++-- test/models/categorization_test.rb | 15 +++++++++++++-- test/models/category_test.rb | 6 +++++- test/models/confirmation_test.rb | 20 +++++++++++++++++--- test/models/detection_test.rb | 16 ++++++++++++++-- test/models/detector_test.rb | 4 ++++ test/models/fingerprint_test.rb | 4 ++++ test/models/journal_test.rb | 6 +++++- test/models/metrics/algorithms_test.rb | 14 +++++++------- test/models/search_event_test.rb | 7 ++++++- test/models/suggested_pattern_test.rb | 16 +++++++++++++--- test/models/suggested_resource_test.rb | 10 +++++++++- test/models/term_test.rb | 14 +++++++++++++- test/models/user_test.rb | 9 +++++++-- 40 files changed, 372 insertions(+), 69 deletions(-) diff --git a/app/models/categorization.rb b/app/models/categorization.rb index e5d9d1f8..9d8e268f 100644 --- a/app/models/categorization.rb +++ b/app/models/categorization.rb @@ -13,12 +13,23 @@ # Table name: categorizations # # id :integer not null, primary key -# category_id :integer not null -# term_id :integer not null # confidence :float # detector_version :string # created_at :datetime not null # updated_at :datetime not null +# category_id :integer not null +# term_id :integer not null +# +# Indexes +# +# idx_on_term_id_category_id_confidence_detector_vers_2ed1c1cbf9 (term_id,category_id,confidence,detector_version) UNIQUE +# index_categorizations_on_category_id (category_id) +# index_categorizations_on_term_id (term_id) +# +# Foreign Keys +# +# category_id (category_id => categories.id) +# term_id (term_id => terms.id) # class Categorization < ApplicationRecord belongs_to :term diff --git a/app/models/category.rb b/app/models/category.rb index 4b389f51..fdb4b428 100644 --- a/app/models/category.rb +++ b/app/models/category.rb @@ -5,11 +5,15 @@ # Table name: categories # # id :integer not null, primary key -# name :string # description :text +# name :string # created_at :datetime not null # updated_at :datetime not null # +# Indexes +# +# index_categories_on_name (name) UNIQUE +# class Category < ApplicationRecord has_many :detector_categories, dependent: :destroy has_many :detectors, through: :detector_categories diff --git a/app/models/confirmation.rb b/app/models/confirmation.rb index ce937dc8..2f26e554 100644 --- a/app/models/confirmation.rb +++ b/app/models/confirmation.rb @@ -14,11 +14,25 @@ # Table name: confirmations # # id :integer not null, primary key -# user_id :integer not null -# term_id :integer not null -# category_id :integer not null # created_at :datetime not null # updated_at :datetime not null +# category_id :integer not null +# term_id :integer not null +# user_id :integer not null +# +# Indexes +# +# index_confirmations_on_category_id (category_id) +# index_confirmations_on_term_id (term_id) +# index_confirmations_on_term_id_and_user_id (term_id,user_id) UNIQUE +# index_confirmations_on_user_id (user_id) +# index_confirmations_on_user_id_and_term_id (user_id,term_id) UNIQUE +# +# Foreign Keys +# +# category_id (category_id => categories.id) +# term_id (term_id => terms.id) +# user_id (user_id => users.id) # class Confirmation < ApplicationRecord belongs_to :user diff --git a/app/models/detection.rb b/app/models/detection.rb index 7729e28b..b1430619 100644 --- a/app/models/detection.rb +++ b/app/models/detection.rb @@ -13,11 +13,23 @@ # Table name: detections # # id :integer not null, primary key -# term_id :integer not null -# detector_id :integer not null # detector_version :string # created_at :datetime not null # updated_at :datetime not null +# detector_id :integer not null +# term_id :integer not null +# +# Indexes +# +# idx_on_detector_id_term_id_detector_version_2afa383b1f (detector_id,term_id,detector_version) UNIQUE +# idx_on_term_id_detector_id_detector_version_03898e846f (term_id,detector_id,detector_version) UNIQUE +# index_detections_on_detector_id (detector_id) +# index_detections_on_term_id (term_id) +# +# Foreign Keys +# +# detector_id (detector_id => detectors.id) +# term_id (term_id => terms.id) # class Detection < ApplicationRecord belongs_to :term diff --git a/app/models/detector.rb b/app/models/detector.rb index 3a0c9297..4b4dd0f1 100644 --- a/app/models/detector.rb +++ b/app/models/detector.rb @@ -19,6 +19,10 @@ # created_at :datetime not null # updated_at :datetime not null # +# Indexes +# +# index_detectors_on_name (name) UNIQUE +# class Detector < ApplicationRecord has_many :detector_categories, dependent: :destroy has_many :categories, through: :detector_categories diff --git a/app/models/detector_category.rb b/app/models/detector_category.rb index d322332e..ab6ebdfd 100644 --- a/app/models/detector_category.rb +++ b/app/models/detector_category.rb @@ -5,11 +5,23 @@ # Table name: detector_categories # # id :integer not null, primary key -# detector_id :integer not null -# category_id :integer not null # confidence :float # created_at :datetime not null # updated_at :datetime not null +# category_id :integer not null +# detector_id :integer not null +# +# Indexes +# +# index_detector_categories_on_category_id (category_id) +# index_detector_categories_on_category_id_and_detector_id (category_id,detector_id) +# index_detector_categories_on_detector_id (detector_id) +# index_detector_categories_on_detector_id_and_category_id (detector_id,category_id) +# +# Foreign Keys +# +# category_id (category_id => categories.id) +# detector_id (detector_id => detectors.id) # class DetectorCategory < ApplicationRecord belongs_to :category diff --git a/app/models/fingerprint.rb b/app/models/fingerprint.rb index db69eec7..fca3fa40 100644 --- a/app/models/fingerprint.rb +++ b/app/models/fingerprint.rb @@ -9,6 +9,10 @@ # created_at :datetime not null # updated_at :datetime not null # +# Indexes +# +# unique_fingerprint (value) UNIQUE +# class Fingerprint < ApplicationRecord has_many :terms, dependent: :nullify diff --git a/app/models/journal.rb b/app/models/journal.rb index e4b89f34..df744040 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -5,11 +5,15 @@ # Table name: journals # # id :integer not null, primary key -# name :string # additional_info :json +# name :string # created_at :datetime not null # updated_at :datetime not null # +# Indexes +# +# index_journals_on_name (name) +# # Journal is the list of academic journals which are known to TACOS. This list of records is referred to by the # Detector::Journal model in order to determine whether a given term matches a known journal. The names of these diff --git a/app/models/metrics/algorithms.rb b/app/models/metrics/algorithms.rb index 27c7f292..14e3970e 100644 --- a/app/models/metrics/algorithms.rb +++ b/app/models/metrics/algorithms.rb @@ -5,19 +5,19 @@ # Table name: metrics_algorithms # # id :integer not null, primary key -# month :date +# barcode :integer +# citation :integer # doi :integer -# issn :integer # isbn :integer +# issn :integer +# journal_exact :integer +# lcsh :integer +# month :date # pmid :integer +# suggested_resource_exact :integer # unmatched :integer # created_at :datetime not null # updated_at :datetime not null -# journal_exact :integer -# suggested_resource_exact :integer -# lcsh :integer -# citation :integer -# barcode :integer # module Metrics # Algorithms aggregates statistics for matches for all SearchEvents diff --git a/app/models/search_event.rb b/app/models/search_event.rb index 7042b8f5..6ea43d2a 100644 --- a/app/models/search_event.rb +++ b/app/models/search_event.rb @@ -5,10 +5,15 @@ # Table name: search_events # # id :integer not null, primary key -# term_id :integer # source :string # created_at :datetime not null # updated_at :datetime not null +# term_id :integer +# +# Indexes +# +# index_search_events_on_source (source) +# index_search_events_on_term_id (term_id) # # SearchEvent represents an instance of a logged search Term diff --git a/app/models/suggested_pattern.rb b/app/models/suggested_pattern.rb index d5af8703..d17022d9 100644 --- a/app/models/suggested_pattern.rb +++ b/app/models/suggested_pattern.rb @@ -5,14 +5,24 @@ # Table name: suggested_patterns # # id :integer not null, primary key -# title :string not null -# url :string not null +# confidence :float default(0.9) # pattern :string not null # shortcode :string not null +# title :string not null +# url :string not null # created_at :datetime not null # updated_at :datetime not null # category_id :integer -# confidence :float default(0.9) +# +# Indexes +# +# index_suggested_patterns_on_category_id (category_id) +# index_suggested_patterns_on_pattern (pattern) UNIQUE +# index_suggested_patterns_on_shortcode (shortcode) UNIQUE +# +# Foreign Keys +# +# category_id (category_id => categories.id) ON DELETE => nullify # class SuggestedPattern < ApplicationRecord validates :title, presence: true diff --git a/app/models/suggested_resource.rb b/app/models/suggested_resource.rb index 51d107bd..b547bcf6 100644 --- a/app/models/suggested_resource.rb +++ b/app/models/suggested_resource.rb @@ -5,12 +5,20 @@ # Table name: suggested_resources # # id :integer not null, primary key +# confidence :float default(0.9) # title :string # url :string # created_at :datetime not null # updated_at :datetime not null # category_id :integer -# confidence :float default(0.9) +# +# Indexes +# +# index_suggested_resources_on_category_id (category_id) +# +# Foreign Keys +# +# category_id (category_id => categories.id) ON DELETE => nullify # class SuggestedResource < ApplicationRecord has_many :terms, dependent: :nullify diff --git a/app/models/term.rb b/app/models/term.rb index 23e20d6c..7ff13408 100644 --- a/app/models/term.rb +++ b/app/models/term.rb @@ -8,13 +8,25 @@ # Table name: terms # # id :integer not null, primary key +# flag :boolean +# label :boolean # phrase :string # created_at :datetime not null # updated_at :datetime not null -# flag :boolean # fingerprint_id :integer # suggested_resource_id :integer # +# Indexes +# +# index_terms_on_fingerprint_id (fingerprint_id) +# index_terms_on_suggested_resource_id (suggested_resource_id) +# unique_phrase (phrase) UNIQUE +# +# Foreign Keys +# +# fingerprint_id (fingerprint_id => fingerprints.id) +# suggested_resource_id (suggested_resource_id => suggested_resources.id) ON DELETE => nullify +# class Term < ApplicationRecord has_many :search_events, dependent: :destroy has_many :detections, dependent: :destroy diff --git a/app/models/user.rb b/app/models/user.rb index b453ed72..0cb3bf9d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -5,11 +5,16 @@ # Table name: users # # id :integer not null, primary key -# uid :string not null +# admin :boolean default(FALSE) # email :string not null +# uid :string not null # created_at :datetime not null # updated_at :datetime not null -# admin :boolean default(FALSE) +# +# Indexes +# +# index_users_on_email (email) UNIQUE +# index_users_on_uid (uid) UNIQUE # class User < ApplicationRecord has_many :confirmations, dependent: :destroy diff --git a/test/fixtures/categories.yml b/test/fixtures/categories.yml index 8816b8ce..951e9bf5 100644 --- a/test/fixtures/categories.yml +++ b/test/fixtures/categories.yml @@ -3,11 +3,15 @@ # Table name: categories # # id :integer not null, primary key -# name :string # description :text +# name :string # created_at :datetime not null # updated_at :datetime not null # +# Indexes +# +# index_categories_on_name (name) UNIQUE +# informational: name: 'Informational' description: '...' diff --git a/test/fixtures/categorizations.yml b/test/fixtures/categorizations.yml index 5af399ca..e1500940 100644 --- a/test/fixtures/categorizations.yml +++ b/test/fixtures/categorizations.yml @@ -3,12 +3,23 @@ # Table name: categorizations # # id :integer not null, primary key -# category_id :integer not null -# term_id :integer not null # confidence :float # detector_version :string # created_at :datetime not null # updated_at :datetime not null +# category_id :integer not null +# term_id :integer not null +# +# Indexes +# +# idx_on_term_id_category_id_confidence_detector_vers_2ed1c1cbf9 (term_id,category_id,confidence,detector_version) UNIQUE +# index_categorizations_on_category_id (category_id) +# index_categorizations_on_term_id (term_id) +# +# Foreign Keys +# +# category_id (category_id => categories.id) +# term_id (term_id => terms.id) # one: category: transactional diff --git a/test/fixtures/confirmations.yml b/test/fixtures/confirmations.yml index d37d1df3..7e80805e 100644 --- a/test/fixtures/confirmations.yml +++ b/test/fixtures/confirmations.yml @@ -3,11 +3,25 @@ # Table name: confirmations # # id :integer not null, primary key -# user_id :integer not null -# term_id :integer not null -# category_id :integer not null # created_at :datetime not null # updated_at :datetime not null +# category_id :integer not null +# term_id :integer not null +# user_id :integer not null +# +# Indexes +# +# index_confirmations_on_category_id (category_id) +# index_confirmations_on_term_id (term_id) +# index_confirmations_on_term_id_and_user_id (term_id,user_id) UNIQUE +# index_confirmations_on_user_id (user_id) +# index_confirmations_on_user_id_and_term_id (user_id,term_id) UNIQUE +# +# Foreign Keys +# +# category_id (category_id => categories.id) +# term_id (term_id => terms.id) +# user_id (user_id => users.id) # minimal: user: valid diff --git a/test/fixtures/detections.yml b/test/fixtures/detections.yml index 4dea1150..5ea1aac6 100644 --- a/test/fixtures/detections.yml +++ b/test/fixtures/detections.yml @@ -3,11 +3,23 @@ # Table name: detections # # id :integer not null, primary key -# term_id :integer not null -# detector_id :integer not null # detector_version :string # created_at :datetime not null # updated_at :datetime not null +# detector_id :integer not null +# term_id :integer not null +# +# Indexes +# +# idx_on_detector_id_term_id_detector_version_2afa383b1f (detector_id,term_id,detector_version) UNIQUE +# idx_on_term_id_detector_id_detector_version_03898e846f (term_id,detector_id,detector_version) UNIQUE +# index_detections_on_detector_id (detector_id) +# index_detections_on_term_id (term_id) +# +# Foreign Keys +# +# detector_id (detector_id => detectors.id) +# term_id (term_id => terms.id) # one: term: doi diff --git a/test/fixtures/detector_categories.yml b/test/fixtures/detector_categories.yml index b60bbe1c..f5d43fcd 100644 --- a/test/fixtures/detector_categories.yml +++ b/test/fixtures/detector_categories.yml @@ -3,11 +3,23 @@ # Table name: detector_categories # # id :integer not null, primary key -# detector_id :integer not null -# category_id :integer not null # confidence :float # created_at :datetime not null # updated_at :datetime not null +# category_id :integer not null +# detector_id :integer not null +# +# Indexes +# +# index_detector_categories_on_category_id (category_id) +# index_detector_categories_on_category_id_and_detector_id (category_id,detector_id) +# index_detector_categories_on_detector_id (detector_id) +# index_detector_categories_on_detector_id_and_category_id (detector_id,category_id) +# +# Foreign Keys +# +# category_id (category_id => categories.id) +# detector_id (detector_id => detectors.id) # one: detector: doi diff --git a/test/fixtures/detectors.yml b/test/fixtures/detectors.yml index 9a59e697..9b00dae2 100644 --- a/test/fixtures/detectors.yml +++ b/test/fixtures/detectors.yml @@ -7,6 +7,10 @@ # created_at :datetime not null # updated_at :datetime not null # +# Indexes +# +# index_detectors_on_name (name) UNIQUE +# barcode: name: 'Barcode' diff --git a/test/fixtures/fingerprints.yml b/test/fixtures/fingerprints.yml index 934c9596..bcf82efe 100644 --- a/test/fixtures/fingerprints.yml +++ b/test/fixtures/fingerprints.yml @@ -7,6 +7,10 @@ # created_at :datetime not null # updated_at :datetime not null # +# Indexes +# +# unique_fingerprint (value) UNIQUE +# cool: value: cool search super diff --git a/test/fixtures/journals.yml b/test/fixtures/journals.yml index 100d8a82..e6533a3f 100644 --- a/test/fixtures/journals.yml +++ b/test/fixtures/journals.yml @@ -3,11 +3,15 @@ # Table name: journals # # id :integer not null, primary key -# name :string # additional_info :json +# name :string # created_at :datetime not null # updated_at :datetime not null # +# Indexes +# +# index_journals_on_name (name) +# # Note: fixtures bypass ActiveRecord callbacks so while our model auto downcases titles, # these fixtures will be stored mixed case unless they are all manually downcased here. diff --git a/test/fixtures/search_events.yml b/test/fixtures/search_events.yml index c77f4ca2..912fd991 100644 --- a/test/fixtures/search_events.yml +++ b/test/fixtures/search_events.yml @@ -3,10 +3,15 @@ # Table name: search_events # # id :integer not null, primary key -# term_id :integer # source :string # created_at :datetime not null # updated_at :datetime not null +# term_id :integer +# +# Indexes +# +# index_search_events_on_source (source) +# index_search_events_on_term_id (term_id) # timdex_cool: diff --git a/test/fixtures/suggested_patterns.yml b/test/fixtures/suggested_patterns.yml index de204cc9..f50ddaec 100644 --- a/test/fixtures/suggested_patterns.yml +++ b/test/fixtures/suggested_patterns.yml @@ -3,14 +3,24 @@ # Table name: suggested_patterns # # id :integer not null, primary key -# title :string not null -# url :string not null +# confidence :float default(0.9) # pattern :string not null # shortcode :string not null +# title :string not null +# url :string not null # created_at :datetime not null # updated_at :datetime not null # category_id :integer -# confidence :float default(0.9) +# +# Indexes +# +# index_suggested_patterns_on_category_id (category_id) +# index_suggested_patterns_on_pattern (pattern) UNIQUE +# index_suggested_patterns_on_shortcode (shortcode) UNIQUE +# +# Foreign Keys +# +# category_id (category_id => categories.id) ON DELETE => nullify # astm: diff --git a/test/fixtures/suggested_resources.yml b/test/fixtures/suggested_resources.yml index ed86816f..94a6ab7d 100644 --- a/test/fixtures/suggested_resources.yml +++ b/test/fixtures/suggested_resources.yml @@ -3,12 +3,20 @@ # Table name: suggested_resources # # id :integer not null, primary key +# confidence :float default(0.9) # title :string # url :string # created_at :datetime not null # updated_at :datetime not null # category_id :integer -# confidence :float default(0.9) +# +# Indexes +# +# index_suggested_resources_on_category_id (category_id) +# +# Foreign Keys +# +# category_id (category_id => categories.id) ON DELETE => nullify # diff --git a/test/fixtures/terms.yml b/test/fixtures/terms.yml index 86269083..803d1ae3 100644 --- a/test/fixtures/terms.yml +++ b/test/fixtures/terms.yml @@ -3,13 +3,25 @@ # Table name: terms # # id :integer not null, primary key +# flag :boolean +# label :boolean # phrase :string # created_at :datetime not null # updated_at :datetime not null -# flag :boolean # fingerprint_id :integer # suggested_resource_id :integer # +# Indexes +# +# index_terms_on_fingerprint_id (fingerprint_id) +# index_terms_on_suggested_resource_id (suggested_resource_id) +# unique_phrase (phrase) UNIQUE +# +# Foreign Keys +# +# fingerprint_id (fingerprint_id => fingerprints.id) +# suggested_resource_id (suggested_resource_id => suggested_resources.id) ON DELETE => nullify +# cool: phrase: Super cool search diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml index a3e5e4c9..74b7433c 100644 --- a/test/fixtures/users.yml +++ b/test/fixtures/users.yml @@ -3,11 +3,16 @@ # Table name: users # # id :integer not null, primary key -# uid :string not null +# admin :boolean default(FALSE) # email :string not null +# uid :string not null # created_at :datetime not null # updated_at :datetime not null -# admin :boolean default(FALSE) +# +# Indexes +# +# index_users_on_email (email) UNIQUE +# index_users_on_uid (uid) UNIQUE # # This model initially had no columns defined. If you add columns to the diff --git a/test/models/categorization_test.rb b/test/models/categorization_test.rb index 39f4486d..4f0c5592 100644 --- a/test/models/categorization_test.rb +++ b/test/models/categorization_test.rb @@ -5,12 +5,23 @@ # Table name: categorizations # # id :integer not null, primary key -# category_id :integer not null -# term_id :integer not null # confidence :float # detector_version :string # created_at :datetime not null # updated_at :datetime not null +# category_id :integer not null +# term_id :integer not null +# +# Indexes +# +# idx_on_term_id_category_id_confidence_detector_vers_2ed1c1cbf9 (term_id,category_id,confidence,detector_version) UNIQUE +# index_categorizations_on_category_id (category_id) +# index_categorizations_on_term_id (term_id) +# +# Foreign Keys +# +# category_id (category_id => categories.id) +# term_id (term_id => terms.id) # require 'test_helper' diff --git a/test/models/category_test.rb b/test/models/category_test.rb index 110b387d..857acd6b 100644 --- a/test/models/category_test.rb +++ b/test/models/category_test.rb @@ -5,11 +5,15 @@ # Table name: categories # # id :integer not null, primary key -# name :string # description :text +# name :string # created_at :datetime not null # updated_at :datetime not null # +# Indexes +# +# index_categories_on_name (name) UNIQUE +# require 'test_helper' class CategoryTest < ActiveSupport::TestCase diff --git a/test/models/confirmation_test.rb b/test/models/confirmation_test.rb index 782eb2d1..4aa93b5f 100644 --- a/test/models/confirmation_test.rb +++ b/test/models/confirmation_test.rb @@ -5,11 +5,25 @@ # Table name: confirmations # # id :integer not null, primary key -# user_id :integer not null -# term_id :integer not null -# category_id :integer not null # created_at :datetime not null # updated_at :datetime not null +# category_id :integer not null +# term_id :integer not null +# user_id :integer not null +# +# Indexes +# +# index_confirmations_on_category_id (category_id) +# index_confirmations_on_term_id (term_id) +# index_confirmations_on_term_id_and_user_id (term_id,user_id) UNIQUE +# index_confirmations_on_user_id (user_id) +# index_confirmations_on_user_id_and_term_id (user_id,term_id) UNIQUE +# +# Foreign Keys +# +# category_id (category_id => categories.id) +# term_id (term_id => terms.id) +# user_id (user_id => users.id) # require 'test_helper' diff --git a/test/models/detection_test.rb b/test/models/detection_test.rb index 6a49d18a..e0f6ab52 100644 --- a/test/models/detection_test.rb +++ b/test/models/detection_test.rb @@ -5,11 +5,23 @@ # Table name: detections # # id :integer not null, primary key -# term_id :integer not null -# detector_id :integer not null # detector_version :string # created_at :datetime not null # updated_at :datetime not null +# detector_id :integer not null +# term_id :integer not null +# +# Indexes +# +# idx_on_detector_id_term_id_detector_version_2afa383b1f (detector_id,term_id,detector_version) UNIQUE +# idx_on_term_id_detector_id_detector_version_03898e846f (term_id,detector_id,detector_version) UNIQUE +# index_detections_on_detector_id (detector_id) +# index_detections_on_term_id (term_id) +# +# Foreign Keys +# +# detector_id (detector_id => detectors.id) +# term_id (term_id => terms.id) # require 'test_helper' diff --git a/test/models/detector_test.rb b/test/models/detector_test.rb index b4fd66f5..95db2bb7 100644 --- a/test/models/detector_test.rb +++ b/test/models/detector_test.rb @@ -9,6 +9,10 @@ # created_at :datetime not null # updated_at :datetime not null # +# Indexes +# +# index_detectors_on_name (name) UNIQUE +# require 'test_helper' class DetectorTest < ActiveSupport::TestCase diff --git a/test/models/fingerprint_test.rb b/test/models/fingerprint_test.rb index df61e322..45cd3388 100644 --- a/test/models/fingerprint_test.rb +++ b/test/models/fingerprint_test.rb @@ -9,6 +9,10 @@ # created_at :datetime not null # updated_at :datetime not null # +# Indexes +# +# unique_fingerprint (value) UNIQUE +# require 'test_helper' class FingerprintTest < ActiveSupport::TestCase diff --git a/test/models/journal_test.rb b/test/models/journal_test.rb index 8c9078a6..0403c991 100644 --- a/test/models/journal_test.rb +++ b/test/models/journal_test.rb @@ -5,11 +5,15 @@ # Table name: journals # # id :integer not null, primary key -# name :string # additional_info :json +# name :string # created_at :datetime not null # updated_at :datetime not null # +# Indexes +# +# index_journals_on_name (name) +# require 'test_helper' class JournalTest < ActiveSupport::TestCase diff --git a/test/models/metrics/algorithms_test.rb b/test/models/metrics/algorithms_test.rb index cdcb1a20..c93091e9 100644 --- a/test/models/metrics/algorithms_test.rb +++ b/test/models/metrics/algorithms_test.rb @@ -5,19 +5,19 @@ # Table name: metrics_algorithms # # id :integer not null, primary key -# month :date +# barcode :integer +# citation :integer # doi :integer -# issn :integer # isbn :integer +# issn :integer +# journal_exact :integer +# lcsh :integer +# month :date # pmid :integer +# suggested_resource_exact :integer # unmatched :integer # created_at :datetime not null # updated_at :datetime not null -# journal_exact :integer -# suggested_resource_exact :integer -# lcsh :integer -# citation :integer -# barcode :integer # require 'test_helper' diff --git a/test/models/search_event_test.rb b/test/models/search_event_test.rb index 7e670078..462be6cf 100644 --- a/test/models/search_event_test.rb +++ b/test/models/search_event_test.rb @@ -5,10 +5,15 @@ # Table name: search_events # # id :integer not null, primary key -# term_id :integer # source :string # created_at :datetime not null # updated_at :datetime not null +# term_id :integer +# +# Indexes +# +# index_search_events_on_source (source) +# index_search_events_on_term_id (term_id) # require 'test_helper' diff --git a/test/models/suggested_pattern_test.rb b/test/models/suggested_pattern_test.rb index b988dbd8..75e71029 100644 --- a/test/models/suggested_pattern_test.rb +++ b/test/models/suggested_pattern_test.rb @@ -5,14 +5,24 @@ # Table name: suggested_patterns # # id :integer not null, primary key -# title :string not null -# url :string not null +# confidence :float default(0.9) # pattern :string not null # shortcode :string not null +# title :string not null +# url :string not null # created_at :datetime not null # updated_at :datetime not null # category_id :integer -# confidence :float default(0.9) +# +# Indexes +# +# index_suggested_patterns_on_category_id (category_id) +# index_suggested_patterns_on_pattern (pattern) UNIQUE +# index_suggested_patterns_on_shortcode (shortcode) UNIQUE +# +# Foreign Keys +# +# category_id (category_id => categories.id) ON DELETE => nullify # require 'test_helper' diff --git a/test/models/suggested_resource_test.rb b/test/models/suggested_resource_test.rb index b8848912..39100b5c 100644 --- a/test/models/suggested_resource_test.rb +++ b/test/models/suggested_resource_test.rb @@ -5,12 +5,20 @@ # Table name: suggested_resources # # id :integer not null, primary key +# confidence :float default(0.9) # title :string # url :string # created_at :datetime not null # updated_at :datetime not null # category_id :integer -# confidence :float default(0.9) +# +# Indexes +# +# index_suggested_resources_on_category_id (category_id) +# +# Foreign Keys +# +# category_id (category_id => categories.id) ON DELETE => nullify # require 'test_helper' diff --git a/test/models/term_test.rb b/test/models/term_test.rb index ef54bb05..9c74373f 100644 --- a/test/models/term_test.rb +++ b/test/models/term_test.rb @@ -5,13 +5,25 @@ # Table name: terms # # id :integer not null, primary key +# flag :boolean +# label :boolean # phrase :string # created_at :datetime not null # updated_at :datetime not null -# flag :boolean # fingerprint_id :integer # suggested_resource_id :integer # +# Indexes +# +# index_terms_on_fingerprint_id (fingerprint_id) +# index_terms_on_suggested_resource_id (suggested_resource_id) +# unique_phrase (phrase) UNIQUE +# +# Foreign Keys +# +# fingerprint_id (fingerprint_id => fingerprints.id) +# suggested_resource_id (suggested_resource_id => suggested_resources.id) ON DELETE => nullify +# require 'test_helper' class TermTest < ActiveSupport::TestCase diff --git a/test/models/user_test.rb b/test/models/user_test.rb index b76ff4a9..6267959f 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -5,11 +5,16 @@ # Table name: users # # id :integer not null, primary key -# uid :string not null +# admin :boolean default(FALSE) # email :string not null +# uid :string not null # created_at :datetime not null # updated_at :datetime not null -# admin :boolean default(FALSE) +# +# Indexes +# +# index_users_on_email (email) UNIQUE +# index_users_on_uid (uid) UNIQUE # require 'test_helper' From f0c5d5ef3710af17a9f05d94e1a003611e390fa9 Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Thu, 6 Aug 2026 17:14:48 +0000 Subject: [PATCH 07/14] Update gemfile to Rails 8.1 --- Gemfile | 2 +- Gemfile.lock | 135 +++++++++++++++++++++++++-------------------------- 2 files changed, 66 insertions(+), 71 deletions(-) diff --git a/Gemfile b/Gemfile index d68656a4..8a6513fd 100644 --- a/Gemfile +++ b/Gemfile @@ -54,7 +54,7 @@ gem 'puma', '>= 5.0' gem 'scout_apm' # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" -gem 'rails', '~> 8.0.0' +gem 'rails', '~> 8.1.0' # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] gem 'sprockets-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 1773dace..3067fd64 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,29 +10,31 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (8.0.5.1) - actionpack (= 8.0.5.1) - activesupport (= 8.0.5.1) + action_text-trix (2.1.19) + railties + actioncable (8.1.3.1) + actionpack (= 8.1.3.1) + activesupport (= 8.1.3.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (8.0.5.1) - actionpack (= 8.0.5.1) - activejob (= 8.0.5.1) - activerecord (= 8.0.5.1) - activestorage (= 8.0.5.1) - activesupport (= 8.0.5.1) + actionmailbox (8.1.3.1) + actionpack (= 8.1.3.1) + activejob (= 8.1.3.1) + activerecord (= 8.1.3.1) + activestorage (= 8.1.3.1) + activesupport (= 8.1.3.1) mail (>= 2.8.0) - actionmailer (8.0.5.1) - actionpack (= 8.0.5.1) - actionview (= 8.0.5.1) - activejob (= 8.0.5.1) - activesupport (= 8.0.5.1) + actionmailer (8.1.3.1) + actionpack (= 8.1.3.1) + actionview (= 8.1.3.1) + activejob (= 8.1.3.1) + activesupport (= 8.1.3.1) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (8.0.5.1) - actionview (= 8.0.5.1) - activesupport (= 8.0.5.1) + actionpack (8.1.3.1) + actionview (= 8.1.3.1) + activesupport (= 8.1.3.1) nokogiri (>= 1.8.5) rack (>= 2.2.4) rack-session (>= 1.0.1) @@ -40,42 +42,43 @@ GEM rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actiontext (8.0.5.1) - actionpack (= 8.0.5.1) - activerecord (= 8.0.5.1) - activestorage (= 8.0.5.1) - activesupport (= 8.0.5.1) + actiontext (8.1.3.1) + action_text-trix (~> 2.1.15) + actionpack (= 8.1.3.1) + activerecord (= 8.1.3.1) + activestorage (= 8.1.3.1) + activesupport (= 8.1.3.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (8.0.5.1) - activesupport (= 8.0.5.1) + actionview (8.1.3.1) + activesupport (= 8.1.3.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (8.0.5.1) - activesupport (= 8.0.5.1) + activejob (8.1.3.1) + activesupport (= 8.1.3.1) globalid (>= 0.3.6) - activemodel (8.0.5.1) - activesupport (= 8.0.5.1) - activerecord (8.0.5.1) - activemodel (= 8.0.5.1) - activesupport (= 8.0.5.1) + activemodel (8.1.3.1) + activesupport (= 8.1.3.1) + activerecord (8.1.3.1) + activemodel (= 8.1.3.1) + activesupport (= 8.1.3.1) timeout (>= 0.4.0) - activestorage (8.0.5.1) - actionpack (= 8.0.5.1) - activejob (= 8.0.5.1) - activerecord (= 8.0.5.1) - activesupport (= 8.0.5.1) + activestorage (8.1.3.1) + actionpack (= 8.1.3.1) + activejob (= 8.1.3.1) + activerecord (= 8.1.3.1) + activesupport (= 8.1.3.1) marcel (~> 1.0) - activesupport (8.0.5.1) + activesupport (8.1.3.1) base64 - benchmark (>= 0.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + json logger (>= 1.4.2) minitest (>= 5.1) securerandom (>= 0.3) @@ -101,7 +104,6 @@ GEM ostruct base64 (0.3.0) bcrypt (3.1.22) - benchmark (0.5.0) bigdecimal (4.1.2) bindata (3.0.0) bindex (0.8.1) @@ -136,7 +138,6 @@ GEM railties (>= 7.0) responders warden (~> 1.2.3) - docile (1.4.1) domain_name (0.6.20240107) dotenv (3.2.0) dotenv-rails (3.2.0) @@ -331,20 +332,20 @@ GEM rack (>= 1.3) rackup (2.3.1) rack (>= 3) - rails (8.0.5.1) - actioncable (= 8.0.5.1) - actionmailbox (= 8.0.5.1) - actionmailer (= 8.0.5.1) - actionpack (= 8.0.5.1) - actiontext (= 8.0.5.1) - actionview (= 8.0.5.1) - activejob (= 8.0.5.1) - activemodel (= 8.0.5.1) - activerecord (= 8.0.5.1) - activestorage (= 8.0.5.1) - activesupport (= 8.0.5.1) + rails (8.1.3.1) + actioncable (= 8.1.3.1) + actionmailbox (= 8.1.3.1) + actionmailer (= 8.1.3.1) + actionpack (= 8.1.3.1) + actiontext (= 8.1.3.1) + actionview (= 8.1.3.1) + activejob (= 8.1.3.1) + activemodel (= 8.1.3.1) + activerecord (= 8.1.3.1) + activestorage (= 8.1.3.1) + activesupport (= 8.1.3.1) bundler (>= 1.15.0) - railties (= 8.0.5.1) + railties (= 8.1.3.1) rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest @@ -352,9 +353,9 @@ GEM rails-html-sanitizer (1.7.1) loofah (~> 2.25, >= 2.25.2) 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) - railties (8.0.5.1) - actionpack (= 8.0.5.1) - activesupport (= 8.0.5.1) + railties (8.1.3.1) + actionpack (= 8.1.3.1) + activesupport (= 8.1.3.1) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) @@ -433,20 +434,15 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 4.0) websocket (~> 1.0) - sentry-rails (6.6.2) + sentry-rails (6.7.0) railties (>= 5.2.0) - sentry-ruby (~> 6.6.2) - sentry-ruby (6.6.2) + sentry-ruby (~> 6.7.0) + sentry-ruby (6.7.0) bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) logger - simplecov (0.22.0) - docile (~> 1.1) - simplecov-html (~> 0.11) - simplecov_json_formatter (~> 0.1) - simplecov-html (0.13.2) + simplecov (1.0.3) simplecov-lcov (0.9.0) - simplecov_json_formatter (0.1.4) sprockets (4.2.2) concurrent-ruby (~> 1.0) logger @@ -491,11 +487,10 @@ GEM vcr (6.4.0) warden (1.2.9) rack (>= 2.0.9) - web-console (4.2.1) - actionview (>= 6.0.0) - activemodel (>= 6.0.0) + web-console (4.3.0) + actionview (>= 8.0.0) bindex (>= 0.4.0) - railties (>= 6.0.0) + railties (>= 8.0.0) webfinger (2.1.3) activesupport faraday (~> 2.0) @@ -556,7 +551,7 @@ DEPENDENCIES pg puma (>= 5.0) rack-cors - rails (~> 8.0.0) + rails (~> 8.1.0) rubocop rubocop-capybara rubocop-graphql From bf29e644f099d980c56d32b5b0bdb52b8bac11bd Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Thu, 6 Aug 2026 13:17:33 -0400 Subject: [PATCH 08/14] accept app:update changes without modifications Running bin/rails app:update generated a number of changes that were accepted without any modification. Those include: - Updates to public/error pages - Files in bin/ - Adding config/ci.rb - Adding a comment block in CSP initializer --- bin/ci | 6 ++++ bin/rubocop | 2 +- bin/setup | 1 + config/ci.rb | 22 +++++++++++++ .../initializers/content_security_policy.rb | 4 +++ public/400.html | 31 ++++++++++++++--- public/404.html | 33 +++++++++++++++---- public/406-unsupported-browser.html | 29 +++++++++++++--- public/422.html | 31 ++++++++++++++--- public/500.html | 33 +++++++++++++++---- 10 files changed, 165 insertions(+), 27 deletions(-) create mode 100755 bin/ci create mode 100644 config/ci.rb diff --git a/bin/ci b/bin/ci new file mode 100755 index 00000000..4137ad5b --- /dev/null +++ b/bin/ci @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "active_support/continuous_integration" + +CI = ActiveSupport::ContinuousIntegration +require_relative "../config/ci.rb" diff --git a/bin/rubocop b/bin/rubocop index 40330c0f..5a205047 100755 --- a/bin/rubocop +++ b/bin/rubocop @@ -2,7 +2,7 @@ require "rubygems" require "bundler/setup" -# explicit rubocop config increases performance slightly while avoiding config confusion. +# 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") diff --git a/bin/setup b/bin/setup index be3db3c0..81be011e 100755 --- a/bin/setup +++ b/bin/setup @@ -22,6 +22,7 @@ FileUtils.chdir APP_ROOT do puts "\n== Preparing database ==" system! "bin/rails db:prepare" + system! "bin/rails db:reset" if ARGV.include?("--reset") puts "\n== Removing old logs and tempfiles ==" system! "bin/rails log:clear tmp:clear" diff --git a/config/ci.rb b/config/ci.rb new file mode 100644 index 00000000..7e3f04c4 --- /dev/null +++ b/config/ci.rb @@ -0,0 +1,22 @@ +# Run using bin/ci + +CI.run do + step "Setup", "bin/setup --skip-server" + + step "Style: Ruby", "bin/rubocop" + + step "Security: Importmap vulnerability audit", "bin/importmap audit" + step "Tests: Rails", "bin/rails test" + step "Tests: Seeds", "env RAILS_ENV=test bin/rails db:seed:replant" + + # Optional: Run system tests + # step "Tests: System", "bin/rails test:system" + + # Optional: set a green GitHub commit status to unblock PR merge. + # Requires the `gh` CLI and `gh extension install basecamp/gh-signoff`. + # if success? + # step "Signoff: All systems go. Ready for merge and deploy.", "gh signoff" + # else + # failure "Signoff: CI failed. Do not merge or deploy.", "Fix the issues and try again." + # end +end diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index b3076b38..d51d7139 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -20,6 +20,10 @@ # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } # config.content_security_policy_nonce_directives = %w(script-src style-src) # +# # Automatically add `nonce` to `javascript_tag`, `javascript_include_tag`, and `stylesheet_link_tag` +# # if the corresponding directives are specified in `content_security_policy_nonce_directives`. +# # config.content_security_policy_nonce_auto = true +# # # Report violations without enforcing the policy. # # config.content_security_policy_report_only = true # end diff --git a/public/400.html b/public/400.html index 282dbc8c..640de033 100644 --- a/public/400.html +++ b/public/400.html @@ -35,12 +35,35 @@ font-weight: 400; letter-spacing: -0.0025em; line-height: 1.4; - min-height: 100vh; + min-height: 100dvh; place-items: center; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; } + #error-description { + fill: #d30001; + } + + #error-id { + fill: #f0eff0; + } + + @media (prefers-color-scheme: dark) { + body { + background: #101010; + color: #e0e0e0; + } + + #error-description { + fill: #FF6161; + } + + #error-id { + fill: #2c2c2c; + } + } + a { color: inherit; font-weight: 700; @@ -83,13 +106,11 @@ } main article br { - display: none; @media(min-width: 48em) { display: inline; } - } @@ -102,10 +123,10 @@
- +
-

The server cannot process the request due to a client error. Please check the request and try again. If you’re the application owner check the logs for more information.

+

The server cannot process the request due to a client error. Please check the request and try again. If you're the application owner check the logs for more information.

diff --git a/public/404.html b/public/404.html index c0670bc8..d7f0f142 100644 --- a/public/404.html +++ b/public/404.html @@ -4,7 +4,7 @@ - The page you were looking for doesn’t exist (404 Not found) + The page you were looking for doesn't exist (404 Not found) @@ -35,12 +35,35 @@ font-weight: 400; letter-spacing: -0.0025em; line-height: 1.4; - min-height: 100vh; + min-height: 100dvh; place-items: center; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; } + #error-description { + fill: #d30001; + } + + #error-id { + fill: #f0eff0; + } + + @media (prefers-color-scheme: dark) { + body { + background: #101010; + color: #e0e0e0; + } + + #error-description { + fill: #FF6161; + } + + #error-id { + fill: #2c2c2c; + } + } + a { color: inherit; font-weight: 700; @@ -83,13 +106,11 @@ } main article br { - display: none; @media(min-width: 48em) { display: inline; } - } @@ -102,10 +123,10 @@
- +
-

The page you were looking for doesn’t exist. You may have mistyped the address or the page may have moved. If you’re the application owner check the logs for more information.

+

The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved. If you're the application owner check the logs for more information.

diff --git a/public/406-unsupported-browser.html b/public/406-unsupported-browser.html index 9532a9cc..43d2811e 100644 --- a/public/406-unsupported-browser.html +++ b/public/406-unsupported-browser.html @@ -35,12 +35,35 @@ font-weight: 400; letter-spacing: -0.0025em; line-height: 1.4; - min-height: 100vh; + min-height: 100dvh; place-items: center; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; } + #error-description { + fill: #d30001; + } + + #error-id { + fill: #f0eff0; + } + + @media (prefers-color-scheme: dark) { + body { + background: #101010; + color: #e0e0e0; + } + + #error-description { + fill: #FF6161; + } + + #error-id { + fill: #2c2c2c; + } + } + a { color: inherit; font-weight: 700; @@ -83,13 +106,11 @@ } main article br { - display: none; @media(min-width: 48em) { display: inline; } - } @@ -102,7 +123,7 @@
- +

Your browser is not supported.
Please upgrade your browser to continue.

diff --git a/public/422.html b/public/422.html index 8bcf0601..f12fb4aa 100644 --- a/public/422.html +++ b/public/422.html @@ -35,12 +35,35 @@ font-weight: 400; letter-spacing: -0.0025em; line-height: 1.4; - min-height: 100vh; + min-height: 100dvh; place-items: center; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; } + #error-description { + fill: #d30001; + } + + #error-id { + fill: #f0eff0; + } + + @media (prefers-color-scheme: dark) { + body { + background: #101010; + color: #e0e0e0; + } + + #error-description { + fill: #FF6161; + } + + #error-id { + fill: #2c2c2c; + } + } + a { color: inherit; font-weight: 700; @@ -83,13 +106,11 @@ } main article br { - display: none; @media(min-width: 48em) { display: inline; } - } @@ -102,10 +123,10 @@
- +
-

The change you wanted was rejected. Maybe you tried to change something you didn’t have access to. If you’re the application owner check the logs for more information.

+

The change you wanted was rejected. Maybe you tried to change something you didn't have access to. If you're the application owner check the logs for more information.

diff --git a/public/500.html b/public/500.html index d77718c3..e4eb18a7 100644 --- a/public/500.html +++ b/public/500.html @@ -4,7 +4,7 @@ - We’re sorry, but something went wrong (500 Internal Server Error) + We're sorry, but something went wrong (500 Internal Server Error) @@ -35,12 +35,35 @@ font-weight: 400; letter-spacing: -0.0025em; line-height: 1.4; - min-height: 100vh; + min-height: 100dvh; place-items: center; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; } + #error-description { + fill: #d30001; + } + + #error-id { + fill: #f0eff0; + } + + @media (prefers-color-scheme: dark) { + body { + background: #101010; + color: #e0e0e0; + } + + #error-description { + fill: #FF6161; + } + + #error-id { + fill: #2c2c2c; + } + } + a { color: inherit; font-weight: 700; @@ -83,13 +106,11 @@ } main article br { - display: none; @media(min-width: 48em) { display: inline; } - } @@ -102,10 +123,10 @@
- +
-

We’re sorry, but something went wrong.
If you’re the application owner check the logs for more information.

+

We're sorry, but something went wrong.
If you're the application owner check the logs for more information.

From 4c6c230f3d9f0615624c18fde8d3f6b4ecc1babb Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Thu, 6 Aug 2026 13:27:28 -0400 Subject: [PATCH 09/14] accept app:update changes with some modifications After running bin/rails app:update, a few files were changed in a way that needed some modifications before committing. Those modifications are in this commit, and include: 1. config/environments/development.rb - Kept local logging overrides in place 2. config/environments/production.rb - kept config.public_file_server.enabled, but behind an env var - kept config.assets.compile = false - kept config.assume_ssl and config.force_ssl in place - kept the config.logger block intact, which adds a formatter prior to tagging TODO: Check order of config.logger block against config.log_tags directive 2. config/initializers/cors.rb - rejected the suggested removal of the block we're actually using (this results in no change being made to this file) 2. config/puma.rb - kept the barnes gem in place for additional reporting in Heroku https://mitlibraries.atlassian.net/browse/TCO-78 https://github.com/heroku/barnes - Comment out an unimplemented plugin that relies on an env var (SOLID_QUEUE_IN_PUMA) we have never adopted --- config/environments/development.rb | 3 +++ config/environments/production.rb | 4 ++-- config/puma.rb | 7 ++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index caaf8a3d..09ebac9a 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -55,6 +55,9 @@ # Highlight code that enqueued background job in logs. config.active_job.verbose_enqueue_logs = true + # Highlight code that triggered redirect in logs. + config.action_dispatch.verbose_redirect_logs = true + # Raises error for missing translations. # config.i18n.raise_on_missing_translations = true diff --git a/config/environments/production.rb b/config/environments/production.rb index a8c2151f..873da259 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -47,7 +47,7 @@ # Log to STDOUT with the current request id as a default log tag. config.log_tags = [ :request_id ] - # Change to "debug" to log everything (including potentially personally-identifiable information!) + # Change to "debug" to log everything (including potentially personally-identifiable information!). config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") # Prevent health checks from clogging up the logs. @@ -69,7 +69,7 @@ # Set host to be used by links generated in mailer templates. config.action_mailer.default_url_options = { host: "example.com" } - # Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit. + # Specify outgoing SMTP server. Remember to add smtp/* credentials via bin/rails credentials:edit. # config.action_mailer.smtp_settings = { # user_name: Rails.application.credentials.dig(:smtp, :user_name), # password: Rails.application.credentials.dig(:smtp, :password), diff --git a/config/puma.rb b/config/puma.rb index a3e70a02..486ac178 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -7,7 +7,8 @@ # # You can control the number of workers using ENV["WEB_CONCURRENCY"]. You # should only set this value when you want to run 2 or more workers. The -# default is already 1. +# default is already 1. You can set it to `auto` to automatically start a worker +# for each available processor. # # The ideal number of threads per worker depends both on how much time the # application spends waiting for IO operations and on how much you wish to @@ -41,8 +42,8 @@ Barnes.start # Must have enabled worker mode for this to block to be called end -# Run the Solid Queue supervisor inside of Puma for single-server deployments -plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"] +# Run the Solid Queue supervisor inside of Puma for single-server deployments. +# plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"] # Specify the PID file. Defaults to tmp/pids/server.pid in development. # In other environments, only set the PID file if requested. From 3f9ae6f9ac54b2da95691316130bfa3200c4753e Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Thu, 6 Aug 2026 19:59:56 +0000 Subject: [PATCH 10/14] Enable rails 8.1 configuration defaults --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index 4e2b9ab1..8428ab02 100644 --- a/config/application.rb +++ b/config/application.rb @@ -9,7 +9,7 @@ module Tacos class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 8.0 + config.load_defaults 8.1 # 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. From 889526164af6b6ced90f893bfc607934049fccba Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Thu, 6 Aug 2026 20:01:29 +0000 Subject: [PATCH 11/14] Update renovate integration --- renovate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index 7409904d..59012a68 100644 --- a/renovate.json +++ b/renovate.json @@ -14,7 +14,7 @@ "matchPackageNames": [ "rails" ], - "allowedVersions": "<8.1" + "allowedVersions": "<8.2" } ] } From 980377d1ef3c0729bf3ef152f1020d57fb9779a4 Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Fri, 7 Aug 2026 10:30:16 -0400 Subject: [PATCH 12/14] Update readme to trigger new actions run --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ad561170..f751e8bf 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,9 @@ apps; it should never be manually set or overridden in any environment. ### Annotations -`make annotate` when making changes to models will update their internal documentation. +`make annotate` will ensure that models have current internal documentation. This uses the [annotaterb](https://rubygems.org/gems/annotaterb) gem. + +Other options provided by this gem can be explored via `bundle exec annotaterb help`. ### Reference From 3e4f10942d10bb77764868bd8c35808c9b9b494c Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Fri, 7 Aug 2026 11:52:22 -0400 Subject: [PATCH 13/14] Respond to code review feedback Gating the public file server behind an env var was flagged during automated review - which was made more relevant by seeing that this env isn't defined in the live tier at the moment. This walks back from that gating choice, and commits to always keeping the public file server enabled in environments that use the production config. --- config/environments/production.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 873da259..b84de475 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -16,7 +16,7 @@ config.action_controller.perform_caching = true # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. - config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + config.public_file_server.enabled = true # Cache assets for far-future expiry since they are all digest stamped. config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" } From 4a84e782b88d4df49d0d719e2bba6413bb6244e2 Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Mon, 10 Aug 2026 10:39:18 -0400 Subject: [PATCH 14/14] Respond to code review feedback - Comment out importmap audit from config/ci because we don't use them - Uncomment the solid_queue_in_puma config to maintain pairity with other apps - Move the health check route to the top of config/routes, along with one other documentation comment --- config/ci.rb | 2 +- config/puma.rb | 2 +- config/routes.rb | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/ci.rb b/config/ci.rb index 7e3f04c4..9014db21 100644 --- a/config/ci.rb +++ b/config/ci.rb @@ -5,7 +5,7 @@ step "Style: Ruby", "bin/rubocop" - step "Security: Importmap vulnerability audit", "bin/importmap audit" + # step "Security: Importmap vulnerability audit", "bin/importmap audit" step "Tests: Rails", "bin/rails test" step "Tests: Seeds", "env RAILS_ENV=test bin/rails db:seed:replant" diff --git a/config/puma.rb b/config/puma.rb index 486ac178..e3dcaf8b 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -43,7 +43,7 @@ end # Run the Solid Queue supervisor inside of Puma for single-server deployments. -# plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"] +plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"] # Specify the PID file. Defaults to tmp/pids/server.pid in development. # In other environments, only set the PID file if requested. diff --git a/config/routes.rb b/config/routes.rb index 55adb25c..d5f7b3d2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,10 @@ Rails.application.routes.draw do + # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html + + # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. + # Can be used by load balancers and uptime monitors to verify that the app is live. + get 'up' => 'rails/health#show', as: :rails_health_check + devise_for :users, controllers: { omniauth_callbacks: 'users/omniauth_callbacks' }, only: [:omniauth_callbacks] devise_scope :user do delete '/users/sign_out', to: 'devise/sessions#destroy', as: :destroy_user_session @@ -25,12 +31,6 @@ post '/graphql', to: 'graphql#execute' - # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html - - # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. - # Can be used by load balancers and uptime monitors to verify that the app is live. - get 'up' => 'rails/health#show', as: :rails_health_check - get 'playground', to: 'static#playground' get '/report', to: 'report#index' get '/report/algorithm_metrics', to: 'report#algorithm_metrics'