diff --git a/Gemfile b/Gemfile index 80ef0656..5d5d60a4 100644 --- a/Gemfile +++ b/Gemfile @@ -40,7 +40,7 @@ group :development, :test do gem 'rspec-rails' gem 'capybara' gem 'selenium-webdriver', '!= 3.13.0' - + # Pinned until https://github.com/thoughtbot/factory_bot_rails/issues/433 is resolved gem 'factory_bot_rails', '~> 6.2.0' gem 'database_cleaner' @@ -77,7 +77,9 @@ gem 'newrelic_rpm' gem 'twitter-typeahead-rails' gem 'blacklight_range_limit', '~> 7.0' gem 'redis', '~> 5.0' -gem 'geo_monitor', '~> 0.7', github: 'geoblacklight/geo_monitor' +# Not compatible with GeoBlacklight 4.x +# https://github.com/geoblacklight/geo_monitor/issues/12 +# gem 'geo_monitor', '~> 0.7', github: 'geoblacklight/geo_monitor' gem 'geo_combine', '>= 0.9' # For OpenGeoMetadata indexing gem 'sidekiq', '~> 7.0' gem 'whenever', require: false diff --git a/Gemfile.lock b/Gemfile.lock index fe8e95a7..b167c487 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,11 +1,3 @@ -GIT - remote: https://github.com/geoblacklight/geo_monitor.git - revision: b4cad62d8bdd43c42e5f31f56fe62e666c5f03d2 - specs: - geo_monitor (0.8.0) - faraday - rails (>= 5.2, < 7.2) - GEM remote: https://rubygems.org/ specs: @@ -566,7 +558,6 @@ DEPENDENCIES factory_bot_rails (~> 6.2.0) faraday (~> 2.0) geo_combine (>= 0.9) - geo_monitor (~> 0.7)! geoblacklight (~> 4.3) honeybadger http diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index fe81b52f..188e972a 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -1,7 +1,6 @@ require 'blacklight/catalog' require 'legacy_id_map' -# rubocop:disable Metrics/ClassLength class CatalogController < ApplicationController include BlacklightRangeLimit::ControllerOverride include Blacklight::Catalog @@ -100,19 +99,21 @@ class CatalogController < ApplicationController config.add_facet_field Settings.FIELDS.INDEX_YEAR, label: 'Year', limit: 10 config.add_facet_field Settings.FIELDS.ACCESS_RIGHTS, label: 'Access', limit: 8, item_component: Geoblacklight::IconFacetItemComponent - config.add_facet_field 'availability', - label: 'Availability', - query: { - available: { - label: 'Available', - fq: "(layer_availability_score_f:[#{Settings.GEOMONITOR_TOLERANCE} TO 1])" - }, - unavailable: { - label: 'Unavailable', - fq: "layer_availability_score_f:[0 TO #{Settings.GEOMONITOR_TOLERANCE}]" - } - }, - item_component: Geoblacklight::IconFacetItemComponent + # Disabled until GeoMonitor is updated for v4.x compatibility + # https://github.com/geoblacklight/geo_monitor/issues/12 + # config.add_facet_field 'availability', + # label: 'Availability', + # query: { + # available: { + # label: 'Available', + # fq: "(layer_availability_score_f:[#{Settings.GEOMONITOR_TOLERANCE} TO 1])" + # }, + # unavailable: { + # label: 'Unavailable', + # fq: "layer_availability_score_f:[0 TO #{Settings.GEOMONITOR_TOLERANCE}]" + # } + # }, + # item_component: Geoblacklight::IconFacetItemComponent config.add_facet_field Settings.FIELDS.RESOURCE_CLASS, label: 'Resource Class', limit: 8 config.add_facet_field Settings.FIELDS.RESOURCE_TYPE, label: 'Resource Type', limit: 8 config.add_facet_field Settings.FIELDS.FORMAT, label: 'Format', limit: 8 @@ -354,4 +355,3 @@ def redirect_from_legacy_id end end end -# rubocop:enable Metrics/ClassLength diff --git a/app/jobs/check_layer_job.rb b/app/jobs/check_layer_job.rb index a209006d..d7c140f9 100644 --- a/app/jobs/check_layer_job.rb +++ b/app/jobs/check_layer_job.rb @@ -3,6 +3,7 @@ class CheckLayerJob < ApplicationJob ## # @param [GeoMonitor::Layer] layer + # TODO: migrate this to the geo_monitor gem itself? def perform(layer) # See if in Solr first, if not, deactivate and exit num_found = Blacklight.default_index.connection.get( diff --git a/app/models/solr_document.rb b/app/models/solr_document.rb index 505637e0..fb3fa8ef 100644 --- a/app/models/solr_document.rb +++ b/app/models/solr_document.rb @@ -1,7 +1,8 @@ class SolrDocument include Blacklight::Solr::Document include Geoblacklight::SolrDocument - include GeomonitorConcern + # include GeomonitorConcern + # https://github.com/geoblacklight/geo_monitor/issues/12 include RightsMetadataConcern include WmsRewriteConcern diff --git a/config/application.rb b/config/application.rb index cda0c86a..9417c3a5 100644 --- a/config/application.rb +++ b/config/application.rb @@ -18,9 +18,11 @@ class Application < Rails::Application require 'rights_metadata' # Inject our StatusExtension concern to add behavior # (index updates) to the GeoMonitor::Status class - config.to_prepare do - GeoMonitor::Status.include StatusExtension - end + # Disabled until v4.x compatibility is resolved + # https://github.com/geoblacklight/geo_monitor/issues/12 + # config.to_prepare do + # GeoMonitor::Status.include StatusExtension + # end # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. diff --git a/config/schedule.rb b/config/schedule.rb index 34f2f41c..f65e3865 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -21,17 +21,19 @@ set :output, 'log/cron.log' -every 1.day, at: '9:34pm', roles: %i[whenevs] do - rake 'earthworks:geomonitor:update' -end +# Disable GeoMonitor jobs until v4.x compatibility is resolved +# https://github.com/geoblacklight/geo_monitor/issues/12 +# every 1.day, at: '9:34pm', roles: %i[whenevs] do +# rake 'earthworks:geomonitor:update' +# end -every 1.day, at: ['1:13 am', '7:42 am', '1:13 pm', '7:42 pm'], roles: %i[whenevs] do - rake 'earthworks:geomonitor:check_stanford' -end +# every 1.day, at: ['1:13 am', '7:42 am', '1:13 pm', '7:42 pm'], roles: %i[whenevs] do +# rake 'earthworks:geomonitor:check_stanford' +# end -every 2.days, at: ['2:21 am'], roles: %i[whenevs] do - rake 'earthworks:geomonitor:check_public' -end +# every 2.days, at: ['2:21 am'], roles: %i[whenevs] do +# rake 'earthworks:geomonitor:check_public' +# end every '0 3 * * *', roles: %i[app] do # daily at 3 am rake 'earthworks:clear_rack_attack_cache' diff --git a/spec/factories/layer.rb b/spec/factories/layer.rb index 475f2910..9b452431 100644 --- a/spec/factories/layer.rb +++ b/spec/factories/layer.rb @@ -1,3 +1,4 @@ -FactoryBot.define do - factory :layer, class: 'GeoMonitor::Layer' -end +# https://github.com/geoblacklight/geo_monitor/issues/12 +# FactoryBot.define do +# factory :layer, class: 'GeoMonitor::Layer' +# end diff --git a/spec/features/unavailable_layer_spec.rb b/spec/features/unavailable_layer_spec.rb index 0df85877..a41c8fa2 100644 --- a/spec/features/unavailable_layer_spec.rb +++ b/spec/features/unavailable_layer_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe 'Unavailable layer' do +describe 'Unavailable layer', skip: 'needs GBLv4 compatibility' do it 'hides and shows appropriate messages for geomonitored unavailable' do visit solr_document_path 'harvard-ntadcd106' within '.unavailable-warning' do diff --git a/spec/jobs/check_layer_job_spec.rb b/spec/jobs/check_layer_job_spec.rb index c4e34ba2..e6595a69 100644 --- a/spec/jobs/check_layer_job_spec.rb +++ b/spec/jobs/check_layer_job_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe CheckLayerJob do +RSpec.describe CheckLayerJob, skip: 'needs GBLv4 compatibility' do context 'when in Solr index' do let(:layer) { create(:layer, slug: 'tufts-cambridgegrid100-04', checktype: 'WMS') } diff --git a/spec/models/concerns/geomonitor_concern_spec.rb b/spec/models/concerns/geomonitor_concern_spec.rb index beefe9dc..55fd8985 100644 --- a/spec/models/concerns/geomonitor_concern_spec.rb +++ b/spec/models/concerns/geomonitor_concern_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe GeomonitorConcern do +RSpec.describe GeomonitorConcern, skip: 'needs GBLv4 compatibility' do let(:document) { SolrDocument.new(document_attributes) } describe 'available?' do @@ -13,7 +13,7 @@ end it 'calls super logic' do - expect(document.available?).to be_truthy + expect(document.available?).to be true end end @@ -27,7 +27,7 @@ end it 'is not avilable' do - expect(document.available?).to be_falsey + expect(document.available?).to be false end end end @@ -36,7 +36,7 @@ let(:document_attributes) { {} } it 'no score present' do - expect(document.score_meets_threshold?).to be_truthy + expect(document.score_meets_threshold?).to be true end end end