diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 4db6786..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: CI -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - test: - name: Run Tests - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v2 - - uses: ruby/setup-ruby@v1 - - uses: actions/cache@v1 - with: - path: vendor/bundle - key: bundle-use-ruby-ubuntu-22.04-${{ hashFiles('.ruby-version') }}-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - bundle-use-ruby-ubuntu-22.04-${{ hashFiles('.ruby-version') }}- - - name: bundle install - run: | - bundle config path vendor/bundle - bundle install --jobs 4 --retry 3 - - name: run tests - run: | - bundle exec rails test - - name: Coveralls - uses: coverallsapp/github-action@v1.0.1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: ./coverage/lcov/timdex.lcov diff --git a/.github/workflows/mit-libraries-ruby-ci.yml b/.github/workflows/mit-libraries-ruby-ci.yml new file mode 100644 index 0000000..64996bc --- /dev/null +++ b/.github/workflows/mit-libraries-ruby-ci.yml @@ -0,0 +1,10 @@ +name: CI +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + shared: + uses: mitlibraries/.github/.github/workflows/ruby-shared-ci.yml@main diff --git a/Gemfile.lock b/Gemfile.lock index e8532b5..b9bdd71 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,72 +10,72 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.0.5.1) - actionpack (= 7.0.5.1) - activesupport (= 7.0.5.1) + actioncable (7.0.7) + actionpack (= 7.0.7) + activesupport (= 7.0.7) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.5.1) - actionpack (= 7.0.5.1) - activejob (= 7.0.5.1) - activerecord (= 7.0.5.1) - activestorage (= 7.0.5.1) - activesupport (= 7.0.5.1) + actionmailbox (7.0.7) + actionpack (= 7.0.7) + activejob (= 7.0.7) + activerecord (= 7.0.7) + activestorage (= 7.0.7) + activesupport (= 7.0.7) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.5.1) - actionpack (= 7.0.5.1) - actionview (= 7.0.5.1) - activejob (= 7.0.5.1) - activesupport (= 7.0.5.1) + actionmailer (7.0.7) + actionpack (= 7.0.7) + actionview (= 7.0.7) + activejob (= 7.0.7) + activesupport (= 7.0.7) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.5.1) - actionview (= 7.0.5.1) - activesupport (= 7.0.5.1) + actionpack (7.0.7) + actionview (= 7.0.7) + activesupport (= 7.0.7) rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.5.1) - actionpack (= 7.0.5.1) - activerecord (= 7.0.5.1) - activestorage (= 7.0.5.1) - activesupport (= 7.0.5.1) + actiontext (7.0.7) + actionpack (= 7.0.7) + activerecord (= 7.0.7) + activestorage (= 7.0.7) + activesupport (= 7.0.7) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.5.1) - activesupport (= 7.0.5.1) + actionview (7.0.7) + activesupport (= 7.0.7) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.5.1) - activesupport (= 7.0.5.1) + activejob (7.0.7) + activesupport (= 7.0.7) globalid (>= 0.3.6) - activemodel (7.0.5.1) - activesupport (= 7.0.5.1) - activerecord (7.0.5.1) - activemodel (= 7.0.5.1) - activesupport (= 7.0.5.1) - activestorage (7.0.5.1) - actionpack (= 7.0.5.1) - activejob (= 7.0.5.1) - activerecord (= 7.0.5.1) - activesupport (= 7.0.5.1) + activemodel (7.0.7) + activesupport (= 7.0.7) + activerecord (7.0.7) + activemodel (= 7.0.7) + activesupport (= 7.0.7) + activestorage (7.0.7) + actionpack (= 7.0.7) + activejob (= 7.0.7) + activerecord (= 7.0.7) + activesupport (= 7.0.7) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.5.1) + activesupport (7.0.7) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - addressable (2.8.4) + addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) annotate (3.2.0) activerecord (>= 3.2, < 8.0) @@ -84,6 +84,7 @@ GEM aws-eventstream (1.2.0) aws-sigv4 (1.5.2) aws-eventstream (~> 1, >= 1.0.2) + base64 (0.1.1) bcrypt (3.1.19) bindex (0.8.1) bootsnap (1.16.0) @@ -139,7 +140,7 @@ GEM globalid (1.1.0) activesupport (>= 5.0) google-protobuf (3.23.3) - graphql (2.0.24) + graphql (2.0.26) hashdiff (1.0.1) http_parser.rb (0.8.0) i18n (1.14.1) @@ -182,7 +183,7 @@ GEM listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - lograge (0.12.0) + lograge (0.13.0) actionpack (>= 4) activesupport (>= 4) railties (>= 4) @@ -199,12 +200,12 @@ GEM matrix (0.4.2) mercenary (0.4.0) method_source (1.0.0) - mini_mime (1.1.2) - mini_portile2 (2.8.2) - minitest (5.18.1) + mini_mime (1.1.5) + mini_portile2 (2.8.4) + minitest (5.19.0) msgpack (1.7.1) multi_json (1.15.0) - net-imap (0.3.6) + net-imap (0.3.7) date net-protocol net-pop (0.1.2) @@ -214,7 +215,7 @@ GEM net-smtp (0.3.3) net-protocol nio4r (2.5.9) - nokogiri (1.15.2) + nokogiri (1.15.4) mini_portile2 (~> 2.8.2) racc (~> 1.4) opensearch-api (2.2.0) @@ -233,40 +234,41 @@ GEM pathutil (0.16.2) forwardable-extended (~> 2.6) pg (1.5.3) - public_suffix (5.0.1) - puma (6.3.0) + public_suffix (5.0.3) + puma (6.3.1) nio4r (~> 2.0) racc (1.7.1) - rack (2.2.7) - rack-attack (6.6.1) - rack (>= 1.0, < 3) + rack (2.2.8) + rack-attack (6.7.0) + rack (>= 1.0, < 4) rack-cors (2.0.1) rack (>= 2.0.0) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.5.1) - actioncable (= 7.0.5.1) - actionmailbox (= 7.0.5.1) - actionmailer (= 7.0.5.1) - actionpack (= 7.0.5.1) - actiontext (= 7.0.5.1) - actionview (= 7.0.5.1) - activejob (= 7.0.5.1) - activemodel (= 7.0.5.1) - activerecord (= 7.0.5.1) - activestorage (= 7.0.5.1) - activesupport (= 7.0.5.1) + rails (7.0.7) + actioncable (= 7.0.7) + actionmailbox (= 7.0.7) + actionmailer (= 7.0.7) + actionpack (= 7.0.7) + actiontext (= 7.0.7) + actionview (= 7.0.7) + activejob (= 7.0.7) + activemodel (= 7.0.7) + activerecord (= 7.0.7) + activestorage (= 7.0.7) + activesupport (= 7.0.7) bundler (>= 1.15.0) - railties (= 7.0.5.1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + railties (= 7.0.7) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.0.5.1) - actionpack (= 7.0.5.1) - activesupport (= 7.0.5.1) + railties (7.0.7) + actionpack (= 7.0.7) + activesupport (= 7.0.7) method_source rake (>= 12.2) thor (~> 1.0) @@ -286,9 +288,10 @@ GEM responders (3.1.0) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.2.5) + rexml (3.2.6) rouge (4.1.2) - rubocop (1.53.1) + rubocop (1.56.0) + base64 (~> 0.1.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -296,7 +299,7 @@ GEM rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.29.0) @@ -322,14 +325,14 @@ GEM sprockets (> 3.0) sprockets-rails tilt - selenium-webdriver (4.10.0) + selenium-webdriver (4.11.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sentry-rails (5.9.0) + sentry-rails (5.10.0) railties (>= 5.0) - sentry-ruby (~> 5.9.0) - sentry-ruby (5.9.0) + sentry-ruby (~> 5.10.0) + sentry-ruby (5.10.0) concurrent-ruby (~> 1.0, >= 1.0.2) simplecov (0.22.0) docile (~> 1.1) @@ -351,7 +354,7 @@ GEM unicode-display_width (>= 1.1.1, < 3) thor (1.2.2) tilt (2.2.0) - timecop (0.9.6) + timecop (0.9.8) timeout (0.4.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) @@ -372,12 +375,12 @@ GEM hashdiff (>= 0.4.0, < 2.0.0) webrick (1.8.1) websocket (1.2.9) - websocket-driver (0.7.5) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.8) + zeitwerk (2.6.11) PLATFORMS ruby diff --git a/README.md b/README.md index f9c8a5d..fcdade0 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,52 @@ additional records with a standardized template. - don't commit your .env or .env.development, but do commit .env.test after confirming your test values are not actual secrets that need protecting +## Confirming functionality after updating dependencies + +This application has good code coverage, so most issues are detected by just running tests normally: + +```shell +bin/rails test +``` + +The following additional manual testing should be performed in the PR build on Heroku. + +- Use the PR builds GraphiQL playground to run a keyword search such as: + +```graphql +{ + search(searchterm: "thesis") { + hits + records { + title + source + summary + identifiers { + kind + value + } + } + } +} +``` + +- Use the PR builds GraphiQL playground to retrieve a single record + +```graphql +{ + recordId(id: "alma:990000959610106761") { + title + timdexRecordId + source + } +} +``` + +The following additional manual check should be performed after the application is deployed to production. + +- confirm the [main documentation site](https://mitlibraries.github.io/timdex/) is working by loading one or two pages +- confirm the [technical documentation site](https://mitlibraries.github.io/timdex/reference/) is working by loading it + ## Publishing User Facing Documentation ### Running jekyll documentation locally diff --git a/docs/_config.yml b/docs/_config.yml index 0fe9654..afa5eca 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,7 +1,7 @@ title: TIMDEX API Documentation description: MIT Libraries TIMDEX API Documentation -remote_theme: just-the-docs/just-the-docs@v0.4.1 +remote_theme: just-the-docs/just-the-docs@v0.5.4 plugins: - "jekyll-remote-theme" - "jekyll-seo-tag" @@ -11,10 +11,41 @@ color_scheme: dark exclude: - architecture-decisions +baseurl: "" +# Enable or disable the site search +# Supports true (default) or false +search_enabled: true +search: + # Split pages into sections that can be searched individually + # Supports 1 - 6, default: 2 + heading_level: 2 + # Maximum amount of previews per search result + # Default: 3 + previews: 3 + # Maximum amount of words to display before a matched word in the preview + # Default: 5 + preview_words_before: 5 + # Maximum amount of words to display after a matched word in the preview + # Default: 10 + preview_words_after: 10 + # Set the search token separator + # Default: /[\s\-/]+/ + # Example: enable support for hyphenated search words + tokenizer_separator: /[\s/]+/ + # Display the relative url in search results + # Supports true (default) or false + rel_url: true + # Enable or disable the search button that appears in the bottom right corner of every page + # Supports true or false (default) + button: false + +# For copy button on code +enable_copy_code_button: true + nav_external_links: - title: Reference url: ./reference hide_icon: false # set to true to hide the external link icon - defaults to false mermaid: - version: "9.3.0" + version: "10.3.1" diff --git a/docs/_sass/color_schemes/dark.scss b/docs/_sass/color_schemes/dark.scss index a970d27..9ea77c7 100644 --- a/docs/_sass/color_schemes/dark.scss +++ b/docs/_sass/color_schemes/dark.scss @@ -7,13 +7,16 @@ $body-heading-color: $gray-warm; $sidebar-color: $black; $border-color: $gray-d2; + $nav-child-link-color: $gray-warm; $nav-link-color: $gray-warm; -$search-result-preview-color: $grey-dk-000; $link-color: $blue-bright; $btn-primary-color: $blue; $base-button-color: $gray-d1; -$search-background-color: $gray-d1; + +$search-background-color: $gray-d2; +$search-result-preview-color: $grey-dk-000; + $table-background-color: $gray-d1; $feedback-color: darken($sidebar-color, 3%); diff --git a/docs/_sass/color_schemes/light.scss b/docs/_sass/color_schemes/light.scss index 11fedc6..292aa07 100644 --- a/docs/_sass/color_schemes/light.scss +++ b/docs/_sass/color_schemes/light.scss @@ -1,17 +1,22 @@ @import 'global/variables'; $body-background-color: $white; + $sidebar-color: $gray-l4; + $border-color: $grey-dk-200; $body-text-color: $black; $body-heading-color: $black; + $nav-child-link-color: $blue; $nav-link-color: $blue; -$search-result-preview-color: $grey-dk-000; $link-color: $blue; $btn-primary-color: $blue-200; $base-button-color: $grey-dk-250; -$search-background-color: $grey-dk-250; + +$search-background-color: $gray-l4; +$search-result-preview-color: $black; + $table-background-color: $grey-dk-250; $feedback-color: darken($sidebar-color, 3%); diff --git a/docs/_sass/custom/custom.scss b/docs/_sass/custom/custom.scss index 978942f..4aa27a8 100644 --- a/docs/_sass/custom/custom.scss +++ b/docs/_sass/custom/custom.scss @@ -63,7 +63,6 @@ body { .main { min-height: 100vh; - display: flex; flex-direction: column; margin-bottom: 5em; } diff --git a/test/test_helper.rb b/test/test_helper.rb index 31e4307..a6f3b25 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -3,6 +3,7 @@ require 'simplecov' require 'simplecov-lcov' SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true +SimpleCov::Formatter::LcovFormatter.config.lcov_file_name = 'coverage.lcov' SimpleCov.formatters = [ SimpleCov::Formatter::HTMLFormatter, SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter