diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 00813603f2..c7b4c3911c 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -19,7 +19,7 @@ jobs: - name: 💎 Setup Ruby and install RubyGems uses: ruby/setup-ruby@v1 with: - ruby-version: 2.4.4 + ruby-version: 2.7 bundler-cache: true - name: 👮 Run Rubocop code analyzer and Formatter diff --git a/.github/workflows/specs.yml b/.github/workflows/specs.yml index 782fadba65..b4c5509ca4 100644 --- a/.github/workflows/specs.yml +++ b/.github/workflows/specs.yml @@ -6,7 +6,6 @@ jobs: specs: name: 📋 Run Specs runs-on: ubuntu-latest - steps: - name: 📰 Checkout code uses: actions/checkout@v3 @@ -19,11 +18,13 @@ jobs: - name: 💎 Setup Ruby and install RubyGems uses: ruby/setup-ruby@v1 with: - ruby-version: 2.4.4 + ruby-version: 2.7 bundler-cache: true - name: 🛤️ Start Rails run: nohup bundle exec rails server & - name: ✔️ Run Rspec specs using CI config - run: bundle exec rake ci_specs + run: | + bundle exec rake db:migrate RAILS_ENV=test + bundle exec rake ci_specs diff --git a/Dockerfile b/Dockerfile index e5c3f8ff47..d202888b12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,13 @@ -FROM ruby:2.4.4 +FROM ruby:2.7 WORKDIR /usr/src/app -RUN apt update && apt install -y nodejs curl libcurl3 libcurl3-openssl-dev openjdk-8-jdk && apt-get clean - +RUN apt update && apt install -y nodejs curl libcurl4 libcurl4-openssl-dev default-jdk +RUN gem install bundler -v '~> 1.17.3' +RUN rm /usr/local/lib/ruby/gems/2.7.0/specifications/default/bundler-2.1.4.gemspec COPY Gemfile Gemfile.lock ./ RUN bundle install +RUN gem update --system EXPOSE 3000 diff --git a/Gemfile b/Gemfile index 2b8bcc65f7..7a82de4743 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,10 @@ source 'https://rubygems.org' # Specify specific version of ruby with which the app is compatible. -ruby '2.4.4' +ruby '~> 2.7.0' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '4.2.8' +gem 'rails', '~> 4.2.8' # Use sqlite3 as the database for Active Record gem 'sqlite3', '~> 1.3.13' # gem 'mysql2', :group => :production @@ -47,14 +47,15 @@ gem 'cmless', git: 'https://github.com/WGBH-MLA/cmless.git' gem 'htmlentities', '~> 4.3.2' gem 'curb' # curl -gem 'blacklight', '5.19.2' +gem 'blacklight', '~> 6.0' gem 'blacklight-gallery', '0.4.1' +gem 'blacklight-marc' gem 'solrizer' gem 'rsolr' gem 'jettywrapper' -gem 'blacklight_range_limit', '5.2.0' +gem 'blacklight_range_limit', '~> 6.0.0' gem 'actionpack-page_caching' gem 'srt' @@ -85,7 +86,7 @@ gem 'pry-nav', :group => :development gem 'passenger', :group => :production -gem 'nokogiri', '~> 1.10.4' +gem 'nokogiri', '~> 1.13.10' # its back gem 'bigdecimal', '1.4.4' diff --git a/Gemfile.lock b/Gemfile.lock index cb72e2ac77..948fa5a27d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -19,51 +19,51 @@ GIT GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.8) - actionpack (= 4.2.8) - actionview (= 4.2.8) - activejob (= 4.2.8) + actionmailer (4.2.11.3) + actionpack (= 4.2.11.3) + actionview (= 4.2.11.3) + activejob (= 4.2.11.3) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.8) - actionview (= 4.2.8) - activesupport (= 4.2.8) + actionpack (4.2.11.3) + actionview (= 4.2.11.3) + activesupport (= 4.2.11.3) rack (~> 1.6) rack-test (~> 0.6.2) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) actionpack-page_caching (1.2.4) actionpack (>= 4.0.0) - actionview (4.2.8) - activesupport (= 4.2.8) + actionview (4.2.11.3) + activesupport (= 4.2.11.3) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (4.2.8) - activesupport (= 4.2.8) + activejob (4.2.11.3) + activesupport (= 4.2.11.3) globalid (>= 0.3.0) - activemodel (4.2.8) - activesupport (= 4.2.8) + activemodel (4.2.11.3) + activesupport (= 4.2.11.3) builder (~> 3.1) - activerecord (4.2.8) - activemodel (= 4.2.8) - activesupport (= 4.2.8) + activerecord (4.2.11.3) + activemodel (= 4.2.11.3) + activesupport (= 4.2.11.3) arel (~> 6.0) - activesupport (4.2.8) + activesupport (4.2.11.3) i18n (~> 0.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - airbrussh (1.4.0) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) + airbrussh (1.4.1) sshkit (>= 1.6.1, != 1.7.0) arel (6.0.4) ast (2.4.2) - autoprefixer-rails (10.2.5.1) - execjs (> 0) - aws-eventstream (1.1.1) + autoprefixer-rails (10.4.7.0) + execjs (~> 2) + aws-eventstream (1.2.0) aws-sdk (2.11.632) aws-sdk-resources (= 2.11.632) aws-sdk-core (2.11.632) @@ -71,23 +71,33 @@ GEM jmespath (~> 1.0) aws-sdk-resources (2.11.632) aws-sdk-core (= 2.11.632) - aws-sigv4 (1.2.3) + aws-sigv4 (1.5.2) aws-eventstream (~> 1, >= 1.0.2) bigdecimal (1.4.4) - blacklight (5.19.2) + blacklight (6.25.0) bootstrap-sass (~> 3.2) deprecation + globalid + jbuilder (~> 2.7) kaminari (>= 0.15) nokogiri (~> 1.6) - rails (>= 3.2.6, < 5) - rsolr (~> 1.0, >= 1.0.11) + rails (>= 4.2, < 6) + rsolr (>= 1.0.6, < 3) + twitter-typeahead-rails (= 0.11.1.pre.corejavascript) blacklight-gallery (0.4.1) blacklight (>= 5.12, < 7) bootstrap-sass (~> 3.0) openseadragon (>= 0.2.0) rails - blacklight_range_limit (5.2.0) - blacklight (~> 5.15) + blacklight-marc (6.3.0) + blacklight (> 6.1, < 8.a) + library_stdnums + marc (>= 0.4.3, < 2.0) + marc-fastxmlwriter + rails + traject (>= 2.1, < 4) + blacklight_range_limit (6.0.0) + blacklight (>= 6.0.0.pre2, < 7) jquery-rails rails (>= 3.0, < 5.0) bootstrap-sass (3.4.1) @@ -95,27 +105,28 @@ GEM sassc (>= 2.0.0) builder (3.2.4) cancan (1.6.10) - capistrano (3.16.0) + capistrano (3.17.1) airbrussh (>= 1.0.0) i18n rake (>= 10.0.0) sshkit (>= 1.9.0) - capistrano-bundler (2.0.1) + capistrano-bundler (2.1.0) capistrano (~> 3.1) capistrano-passenger (0.2.1) capistrano (~> 3.0) - capistrano-rails (1.6.1) + capistrano-rails (1.6.2) capistrano (~> 3.1) capistrano-bundler (>= 1.1, < 3) - capybara (3.32.2) + capybara (3.38.0) addressable + matrix mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) - regexp_parser (~> 1.5) + regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - childprocess (4.0.0) + childprocess (4.1.0) coderay (1.1.3) coffee-rails (4.0.1) coffee-script (>= 2.2.0) @@ -124,14 +135,18 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.8) + concurrent-ruby (1.1.10) crack (0.4.5) rexml crass (1.0.6) - curb (0.9.11) + curb (1.0.3) + date (3.3.3) deprecation (1.1.0) activesupport - diff-lcs (1.4.4) + diff-lcs (1.5.0) + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) + dot-properties (0.1.3) erubis (2.7.0) execjs (2.8.1) factory_bot (4.11.1) @@ -145,15 +160,28 @@ GEM faraday-net_http (1.0.1) faraday_middleware (1.2.0) faraday (~> 1.0) - fastimage (2.2.3) - ffi (1.15.1) + fastimage (2.2.6) + ffi (1.15.5) + ffi-compiler (1.0.1) + ffi (>= 1.0.0) + rake globalid (0.4.2) activesupport (>= 4.2.0) hashdiff (1.0.1) + hashie (5.0.0) htmlentities (4.3.4) - httparty (0.18.1) + http (5.1.1) + addressable (~> 2.8) + http-cookie (~> 1.0) + http-form_data (~> 2.2) + llhttp-ffi (~> 0.4.0) + http-cookie (1.0.5) + domain_name (~> 0.5) + http-form_data (2.3.0) + httparty (0.20.0) mime-types (~> 3.0) multi_xml (>= 0.5.2) + httpclient (2.8.3) i18n (0.9.5) concurrent-ruby (~> 1.0) jbuilder (2.9.1) @@ -163,54 +191,78 @@ GEM childprocess i18n rubyzip (~> 1.0) - jmespath (1.6.1) - jquery-rails (4.4.0) + jmespath (1.6.2) + jquery-rails (4.5.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) jquery-ui-rails (6.0.1) railties (>= 3.2.16) json (1.8.6) - kaminari (1.2.1) + kaminari (1.2.2) activesupport (>= 4.1.0) - kaminari-actionview (= 1.2.1) - kaminari-activerecord (= 1.2.1) - kaminari-core (= 1.2.1) - kaminari-actionview (1.2.1) + kaminari-actionview (= 1.2.2) + kaminari-activerecord (= 1.2.2) + kaminari-core (= 1.2.2) + kaminari-actionview (1.2.2) actionview - kaminari-core (= 1.2.1) - kaminari-activerecord (1.2.1) + kaminari-core (= 1.2.2) + kaminari-activerecord (1.2.2) activerecord - kaminari-core (= 1.2.1) - kaminari-core (1.2.1) - launchy (2.5.0) - addressable (~> 2.7) + kaminari-core (= 1.2.2) + kaminari-core (1.2.2) + launchy (2.5.2) + addressable (~> 2.8) + library_stdnums (1.6.0) libv8 (3.16.14.19) - loofah (2.18.0) + llhttp-ffi (0.4.0) + ffi-compiler (~> 1.0) + rake (~> 13.0) + loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.7.1) + mail (2.8.0) mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marc (1.2.0) + rexml + scrub_rb (>= 1.0.1, < 2) + unf + marc-fastxmlwriter (1.1.0) + marc (~> 1.0) + matrix (0.4.2) maxminddb (0.1.22) - method_source (0.9.2) - mime-types (3.3.1) + method_source (1.0.0) + mime-types (3.4.1) mime-types-data (~> 3.2015) - mime-types-data (3.2021.0225) - mini_mime (1.1.0) - mini_portile2 (2.4.0) - minitest (5.14.4) + mime-types-data (3.2022.0105) + mini_mime (1.1.2) + mini_portile2 (2.8.1) + minitest (5.16.3) multi_xml (0.6.0) - multipart-post (2.1.1) - net-scp (3.0.0) - net-ssh (>= 2.6.5, < 7.0.0) - net-ssh (6.1.0) - nokogiri (1.10.10) - mini_portile2 (~> 2.4.0) + multipart-post (2.2.3) + net-imap (0.3.4) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.1) + timeout + net-scp (4.0.0) + net-ssh (>= 2.6.5, < 8.0.0) + net-smtp (0.3.3) + net-protocol + net-ssh (7.0.1) + nokogiri (1.13.10) + mini_portile2 (~> 2.8.0) + racc (~> 1.4) openseadragon (0.6.0) rails (> 3.2.0) parser (2.7.2.0) ast (~> 2.4.1) - passenger (6.0.8) + passenger (6.0.16) rack rake (>= 0.8.1) pbcore (0.2.0) @@ -219,27 +271,28 @@ GEM nokogiri (~> 1.10) sax-machine (~> 1.3) powerpack (0.1.3) - pry (0.12.2) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - pry-nav (0.3.0) - pry (>= 0.9.10, < 0.13.0) - public_suffix (4.0.6) + pry (0.14.1) + coderay (~> 1.1) + method_source (~> 1.0) + pry-nav (1.0.0) + pry (>= 0.9.10, < 0.15) + public_suffix (5.0.1) + racc (1.6.2) rack (1.6.13) rack-cors (1.0.6) rack (>= 1.6.0) rack-test (0.6.3) rack (>= 1.0) - rails (4.2.8) - actionmailer (= 4.2.8) - actionpack (= 4.2.8) - actionview (= 4.2.8) - activejob (= 4.2.8) - activemodel (= 4.2.8) - activerecord (= 4.2.8) - activesupport (= 4.2.8) + rails (4.2.11.3) + actionmailer (= 4.2.11.3) + actionpack (= 4.2.11.3) + actionview (= 4.2.11.3) + activejob (= 4.2.11.3) + activemodel (= 4.2.11.3) + activerecord (= 4.2.11.3) + activesupport (= 4.2.11.3) bundler (>= 1.3.0, < 2.0) - railties (= 4.2.8) + railties (= 4.2.11.3) sprockets-rails rails-deprecated_sanitizer (1.0.4) activesupport (>= 4.2.0.alpha) @@ -247,38 +300,39 @@ GEM activesupport (>= 4.2.0, < 5.0) nokogiri (~> 1.6) rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.4.3) - loofah (~> 2.3) - railties (4.2.8) - actionpack (= 4.2.8) - activesupport (= 4.2.8) + rails-html-sanitizer (1.4.4) + loofah (~> 2.19, >= 2.19.1) + railties (4.2.11.3) + actionpack (= 4.2.11.3) + activesupport (= 4.2.11.3) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rainbow (2.2.2) rake - rake (13.0.3) - rb-fsevent (0.11.0) + rake (13.0.6) + rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) rdoc (4.3.0) redcarpet (3.5.1) ref (2.0.0) - regexp_parser (1.8.2) + regexp_parser (2.6.1) rexml (3.2.5) - rsolr (1.1.2) + rsolr (2.5.0) builder (>= 2.1.2) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) + faraday (>= 0.9, < 3, != 2.0.0) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.0) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.2) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) + rspec-support (~> 3.12.0) rspec-rails (4.1.2) actionpack (>= 4.2) activesupport (>= 4.2) @@ -287,7 +341,7 @@ GEM rspec-expectations (~> 3.10) rspec-mocks (~> 3.10) rspec-support (~> 3.10) - rspec-support (3.10.2) + rspec-support (3.12.0) rubocop (0.39.0) parser (>= 2.3.0.7, < 3.0) powerpack (~> 0.1) @@ -311,14 +365,16 @@ GEM sassc (2.4.0) ffi (~> 1.9) sax-machine (1.3.2) + scrub_rb (1.0.1) sdoc (0.4.2) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) + slop (4.9.3) solrizer (4.1.0) activesupport nokogiri xml-simple - spring (2.1.1) + spring (4.1.0) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -328,27 +384,48 @@ GEM sprockets (>= 3.0.0) sqlite3 (1.3.13) srt (0.1.5) - sshkit (1.21.2) + sshkit (1.21.3) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) therubyracer (0.12.3) libv8 (~> 3.16.14.15) ref - thor (1.1.0) + thor (1.2.1) thread_safe (0.3.6) - tilt (2.0.10) + tilt (2.0.11) + timeout (0.3.1) + traject (3.8.1) + concurrent-ruby (>= 0.8.0) + dot-properties (>= 0.1.1) + hashie (>= 3.1, < 6) + http (>= 3.0, < 6) + httpclient (~> 2.5) + marc (~> 1.0) + marc-fastxmlwriter (~> 1.0) + nokogiri (~> 1.9) + slop (~> 4.0) + yell + twitter-typeahead-rails (0.11.1.pre.corejavascript) + actionpack (>= 3.1) + jquery-rails + railties (>= 3.1) tzinfo (1.2.10) thread_safe (~> 0.1) uglifier (4.2.0) execjs (>= 0.3.0, < 3) - unicode-display_width (1.7.0) - webmock (3.13.0) - addressable (>= 2.3.6) + unf (0.1.4) + unf_ext + unf_ext (0.0.8.2) + unicode-display_width (1.8.0) + webmock (3.18.1) + addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - xml-simple (1.1.8) + xml-simple (1.1.9) + rexml xpath (3.2.0) nokogiri (~> 1.8) + yell (2.2.2) PLATFORMS ruby @@ -357,9 +434,10 @@ DEPENDENCIES actionpack-page_caching aws-sdk (~> 2) bigdecimal (= 1.4.4) - blacklight (= 5.19.2) + blacklight (~> 6.0) blacklight-gallery (= 0.4.1) - blacklight_range_limit (= 5.2.0) + blacklight-marc + blacklight_range_limit (~> 6.0.0) cancan capistrano-passenger capistrano-rails @@ -377,13 +455,13 @@ DEPENDENCIES launchy libv8 (~> 3.16.14.13) maxminddb - nokogiri (~> 1.10.4) + nokogiri (~> 1.13.10) passenger pbcore (~> 0.2.0) pry pry-nav rack-cors (~> 1.0.5) - rails (= 4.2.8) + rails (~> 4.2.8) rsolr rspec rspec-rails @@ -401,7 +479,7 @@ DEPENDENCIES webmock RUBY VERSION - ruby 2.4.4p296 + ruby 2.7.7p221 BUNDLED WITH 1.17.3 diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index f8f1b6b574..9a1411d431 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -7,7 +7,7 @@ class CatalogController < ApplicationController # allows usage of default_processor_chain v # self.search_params_logic = true - self.search_params_logic += [:apply_quote_handler, :apply_date_filter] + self.search_state_class = [:apply_quote_handler, :apply_date_filter] configure_blacklight do |config| # 'list' is the name of blacklight's default search result view style diff --git a/config/initializers/blacklight_initializer.rb b/config/initializers/blacklight_initializer.rb index 79c12a4827..5bd8970b08 100644 --- a/config/initializers/blacklight_initializer.rb +++ b/config/initializers/blacklight_initializer.rb @@ -12,5 +12,3 @@ def method_missing(method, *args, &block) SolrDocument.use_extension(LoadXML) { true } # TODO: should we just be able to redefine SolrDocument the normal way? - -Blacklight.secret_key = ENV['BLACKLIGHT_SECRET_KEY'] || 'not a secure key, please change' diff --git a/config/routes.rb b/config/routes.rb index 18fc7952cf..fb0aa5b8ed 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,7 @@ Rails.application.routes.draw do root to: 'home#show' - blacklight_for :catalog + # blacklight_for :catalog resources 'terms', only: [:show, :create]