Skip to content

Commit

Permalink
Merge branch 'main' into upgrade-to-gbl-4.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
spilth authored Aug 5, 2024
2 parents 5c9da6c + a573b8a commit 1e8ca30
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .bundler-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
ignore:
- CVE-2015-9284 # Temporarily ignore Omniauth vulnerability
- CVE-2024-6531 # No fix for this yet
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
bundle exec rake db:schema:load
bundle exec rake ci
- name: Audit gems
run: bundle exec bundle-audit check --ignore CVE-2015-9284 # tempoarily ignore omniauth vulnerability
run: bundle exec bundle-audit check
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ AllCops:
- 'vendor/**/*'
- 'Vagrantfile'
- 'app/helpers/geoblacklight_helper.rb'
- 'coverage/**/*'
- 'log/**/*'
- 'tmp/**/*'
NewCops: enable

Style/Documentation:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ GEM
actionpack (>= 5.2)
railties (>= 5.2)
retriable (3.1.2)
rexml (3.3.2)
rexml (3.3.4)
strscan
rgeo (3.0.1)
rgeo-geojson (2.2.0)
Expand Down
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,47 @@ If the `mysql2` gem fails to install and complains about not finding `zstd` you
```bash
gem install mysql2 -v '0.5.6' -- --with-opt-dir=$(brew --prefix openssl) --with-ldflags=-L/opt/homebrew/opt/zstd/lib
```

### Running the Test Suite

To run the full test suite use the following command:

```bash
$ bundle exec rake ci
```

This command will start up Solr with a `sdr-core-test` core and then run the full test suite.

#### Running Individual Specs

Some specs (like feature specs) require a `sdr-core-test` core set up in Solr. This is automatically done when running the full test suite using the command above, but for running individual specs you'll need to start it up manually. You can do that using the following command:

```bash
$ bundle exec rake sdr:test
```

Then, in another terminal window (or your IDE), run the individual spec.

Note: You'll know this step is necessary if an individual spec fails with an error like the following:

```plaintext
Blacklight::Exceptions::ECONNREFUSED: Connection refused - Unable to connect to Solr instance using #<RSolr::Client:0x0000000117d5e1a8 @uri=#<URI::HTTP http://127.0.0.1:8983/solr/sdr-core-test/>
```

### Loading NYU Data Locally

First, start up the Rails app if it's not already running:

```bash
$ bundle exec rake sdr:server
```

This will ensure Solr is up and running.

Then in another terminal run the following Rake task:

```bash
$ bundle exec rake sdr:load_nyu_data
```

Once completed, head to <http://localhost:3000/?search_field=all_fields> and you should have a lot more data to work with.
20 changes: 20 additions & 0 deletions lib/tasks/sdr.rake
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,24 @@ namespace :sdr do
end
end
end

desc 'Clone and index NYU data for local development'
task load_nyu_data: :environment do
exit unless Rails.env.development?

puts 'Removing existing edu.nyu repo...'
FileUtils.rm_rf('tmp/opengeometadata/edu.nyu')

puts 'Cloning edu.nyu repository...'
system 'bundle exec sdr-cli clone --repo=edu.nyu'

puts 'Deleting Solr index...'
Blacklight.default_index.connection.delete_by_query '*:*'
Blacklight.default_index.connection.commit

puts 'Indexing edu.nyu Aardvark files...'
system "bundle exec sdr-cli index --directory=\"tmp/opengeometadata/edu.nyu/metadata-aardvark/**/*.json\" --solr_url=\"#{Settings.SOLR_URL}\""

puts 'Done!'
end
end

0 comments on commit 1e8ca30

Please sign in to comment.