Skip to content

Commit

Permalink
Merge branch 'release/5.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ewlarson committed Nov 10, 2023
2 parents 177b0de + 3b0846a commit df9ebb0
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 27 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,13 @@ jobs:
bin/rails db:migrate RAILS_ENV=test
- name: Rails - Run tests
run: bundle exec rake ci
env:
RAILS_ENV: test
rails_version: 6.1.5
ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test'
SOLR_URL: http://solr:SolrRocks@localhost:8983/solr/blacklight-core
FARADAY_VERSION: ${{ matrix.faraday_version }}
run: bundle exec rake geoportal:ci --trace

- name: Artifacts - Upload coverage
uses: actions/upload-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ Visit the [project wiki](https://github.com/BTAA-Geospatial-Data-Project/geoport

#### Release Version

B1G Geoportal Version v5.0.2 / GeoBlacklight v4.1.0 / GeoBlacklight Admin v0.3.0
B1G Geoportal Version v5.1.0 / GeoBlacklight v4.1.0 / GeoBlacklight Admin v0.3.2
2 changes: 1 addition & 1 deletion app/assets/javascripts/geoportal/modules/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Blacklight.onLoad(function() {
// Oboe - SAX steam JSON results from Solr /export
// oboe('http://localhost:8983/solr/geoportal/export?fl=uuid_sdv,dc_title_sdv,centroid_sdv&indent=on&q=*:*&wt=json&sort=dc_title_sdv%20asc&rows=10000')

oboe('/centroids.json')
oboe('./centroids.json')
.node('*', function( doc ){
if(typeof doc.c != 'undefined'){
var latlng = doc.c.split(",")
Expand Down
1 change: 0 additions & 1 deletion app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ class CatalogController < ApplicationController
# Custom tools for GeoBlacklight
config.add_show_tools_partial :more_details, partial: 'more_details', if: proc { |_context, _config, options| options[:document] && (!options[:document].references.nil? & !options[:document].references.url.nil?)}
config.add_show_tools_partial :metadata, if: proc { |_context, _config, options| options[:document] && (Settings.METADATA_SHOWN & options[:document].references.refs.map(&:type).map(&:to_s)).any? }
config.add_show_tools_partial :carto, partial: 'carto', if: proc { |_context, _config, options| options[:document] && options[:document].carto_reference.present? }
config.add_show_tools_partial :arcgis, partial: 'arcgis', if: proc { |_context, _config, options| options[:document] && options[:document].arcgis_urls.present? }
config.add_show_tools_partial :data_dictionary, partial: 'data_dictionary', if: proc { |_context, _config, options| options[:document] && options[:document].data_dictionary_download.present? }
config.add_show_tools_partial(:citation, if: proc { |_context, _config, options| options[:document] && (options[:document].resource_class != 'Collections')})
Expand Down
1 change: 1 addition & 0 deletions app/views/shared/_javascript_behaviors.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
Blacklight.onLoad(function() {
$('.gbl-display-note').linkify({ target: "_blank" });
$('.truncate-abstract').linkify({ target: "_blank" });
$('.blacklight-dct_rights_sm.col-md-9').linkify({ target: "_blank" });
$('.blacklight-dct_license_sm.col-md-9').linkify({ target: "_blank" });
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/item_viewer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def viewer_preference
oembed,
index_map,
wms,
iiif,
iiif_manifest,
iiif,
b1g_image,
download,
tiled_map_layer,
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
get 'about', :to => redirect('https://sites.google.com/umn.edu/btaa-gdp/about')
get 'help', :to => redirect('https://sites.google.com/umn.edu/btaa-gdp/help')
get 'robots.:format' => 'robots#robots'
get '/centroids.json', :to => redirect('/centroids.json')

# Feedback
mount PointlessFeedback::Engine, :at => '/feedback'
Expand Down
11 changes: 7 additions & 4 deletions config/schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
end
# Harvest thumbnail images for search results
every :day, at: '12:05am', roles: [:app] do
rake 'gblsci:images:harvest_retry'
rake 'geoportal:queue_incomplete_states'
end
every :day, at: '12:30am', roles: [:app] do
rake 'sitemap:refresh'
Expand All @@ -24,10 +24,13 @@
every :day, at: '2:30am', roles: [:app] do
rake 'blacklight:delete_old_searches[7]'
end

# No longer required - EWL 11/10/23
# Exports SOLR data to public/data.json
every '30 3 1 * *', roles: [:app] do
rake 'geoportal:export_data'
end
# every '30 3 1 * *', roles: [:app] do
# rake 'geoportal:export_data'
# end

# Clean Carrierwave tmp file directory
every :day, at: '4:30 am', roles: [:app] do
runner "CarrierWave.clean_cached_files!"
Expand Down
26 changes: 9 additions & 17 deletions lib/tasks/geoportal.rake
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
# frozen_string_literal: true

desc 'Run test suite'
task :ci do
shared_solr_opts = { managed: true, verbose: true, persist: false, download_dir: 'tmp' }
shared_solr_opts[:version] = ENV['SOLR_VERSION'] if ENV['SOLR_VERSION']

success = true
SolrWrapper.wrap(shared_solr_opts.merge(port: 8985, instance_dir: 'tmp/geoportal-core-test')) do |solr|
solr.with_collection(name: "geoportal-core-test", dir: Rails.root.join("solr", "conf").to_s) do
system 'RAILS_ENV=test bundle exec rake geoportal:index:seed'
namespace :geoportal do
task :ci do
if Rails.env.test?
success = true
Rake::Task['geoportal:index:seed'].invoke
system('RAILS_ENV=test bundle exec rails test:system test') || success = false
exit!(1) unless success
end
end

exit!(1) unless success
end

namespace :geoportal do
desc 'Run Solr and GeoBlacklight for interactive development'
task :server, [:rails_server_args] do
require 'solr_wrapper'

shared_solr_opts = { managed: true, verbose: true, persist: false, download_dir: 'tmp' }
shared_solr_opts[:version] = ENV['SOLR_VERSION'] if ENV['SOLR_VERSION']

SolrWrapper.wrap(shared_solr_opts.merge(port: 8983, instance_dir: 'tmp/geoportal-core-development')) do |solr|
solr.with_collection(name: "geoportal-core-development", dir: Rails.root.join("solr", "conf").to_s) do
puts "Solr running at http://localhost:8983/solr/geoportal-core-development/, ^C to exit"
SolrWrapper.wrap(shared_solr_opts.merge(port: 8983, instance_dir: 'tmp/blacklight-core')) do |solr|
solr.with_collection(name: "blacklight-core", dir: Rails.root.join("solr", "conf").to_s) do
puts "Solr running at http://localhost:8983/solr/blacklight-core/, ^C to exit"
puts ' '
begin
Rake::Task['geoportal:index:seed'].invoke
Expand Down
20 changes: 19 additions & 1 deletion lib/tasks/geoportal/geoportal_images.rake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,25 @@ namespace :geoportal do

desc 'Harvest images - Queue incomplete states for reprocessing'
task queue_incomplete_states: :environment do
puts "Deprecated / Instead try: bundle exec rake gblsci:images:harvest_retry"
# Skipping :failed, :placeheld
states = [
:initialized,
:queued,
:processing
]

states.each do |state|
sidecars = SolrDocumentSidecar.in_state(state)

puts "#{state} - #{sidecars.size}"

sidecars.each do |sc|
document = Geoblacklight::SolrDocument.find(sc.document_id)
GeoblacklightSidecarImages::StoreImageJob.perform_later(document.id)
rescue
puts "orphaned / #{sc.document_id}"
end
end
end

desc 'Failed State - Inspect metadata'
Expand Down

0 comments on commit df9ebb0

Please sign in to comment.