From 48f934a05e6e7e0b87ed3f71a7f6fad73999dcb8 Mon Sep 17 00:00:00 2001 From: mdorf Date: Wed, 10 Sep 2025 13:21:27 -0700 Subject: [PATCH 01/24] modified http delete API to allow for more flexible input (multiple ids) and output --- lib/ontologies_api_client/http.rb | 48 +++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/lib/ontologies_api_client/http.rb b/lib/ontologies_api_client/http.rb index 7e1622c..65c0781 100644 --- a/lib/ontologies_api_client/http.rb +++ b/lib/ontologies_api_client/http.rb @@ -144,18 +144,50 @@ def self.patch(path, obj) response end - def self.delete(id) - puts "Deleting #{id}" if $DEBUG_API_CLIENT - response = conn.delete id - raise StandardError, response.body if response.status >= 500 - - response - end - def self.object_from_json(json) recursive_struct(load_json(json)) end + def self.delete(path, params = {}, options = {}) + headers = options[:headers] || {} + raw = options[:raw] || false # return response.body (string) + parse = options[:parse] || false # return parsed object (similar to 'get') + + params = (params || {}).dup + params = params.delete_if { |k, v| v.nil? || v.to_s.empty? } + + begin + puts "Deleting #{path} with #{params}" if $DEBUG_API_CLIENT + response = conn.delete do |req| + req.url path + req.params = params.dup + req.options[:timeout] = 60 + req.headers.merge(headers) + end + rescue StandardError => e + query = Faraday::Utils.build_query(params) + pretty = path.dup + pretty += '?' unless query.empty? || pretty.include?('?') + raise e, "Problem deleting:\n#{pretty}#{query}\n\nError: #{e.message}\n#{e.backtrace.join("\n\t")}" + end + + raise StandardError, response.body if response.status >= 500 + + if raw + response.body + elsif parse + if response.respond_to?(:parsed_body) && response.parsed_body + obj = response.parsed_body + obj = obj.dup if obj.frozen? + else + obj = recursive_struct(load_json(response.body)) + end + obj + else + response # backward compatibility preserved + end + end + private def self.custom_req(obj, file, file_attribute, req) From c2123d51df79b056e0cf3f385fc77ecc7bf2a4e8 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Mon, 13 Oct 2025 13:39:07 -0700 Subject: [PATCH 02/24] Add Ruby 3.2 to the test matrix --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 0650cf0..921f463 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: ['3.1'] + ruby-version: ['3.1', '3.2'] steps: - uses: actions/checkout@v3 - name: Set up Ruby From 2d06fdce32ce4a2b66a45055ceeb4d318dc20211 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Mon, 13 Oct 2025 13:51:29 -0700 Subject: [PATCH 03/24] Bump minitest from 5.25.4 to 5.26.0 --- Gemfile.lock | 4 ++-- ontologies_api_client.gemspec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 94cafd0..733e76a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -58,7 +58,7 @@ GEM logger (1.6.5) lz4-ruby (0.3.3) method_source (1.1.0) - minitest (5.25.4) + minitest (5.26.0) minitest-hooks (1.5.2) minitest (> 5.3) multi_json (1.15.0) @@ -111,7 +111,7 @@ PLATFORMS DEPENDENCIES faraday-follow_redirects (~> 0.3) - minitest (~> 5.25) + minitest (~> 5.26) minitest-hooks (~> 1.5) ontologies_api_client! pry diff --git a/ontologies_api_client.gemspec b/ontologies_api_client.gemspec index a95da6c..ad1060c 100644 --- a/ontologies_api_client.gemspec +++ b/ontologies_api_client.gemspec @@ -29,6 +29,6 @@ Gem::Specification.new do |gem| gem.add_dependency('oj') gem.add_development_dependency('faraday-follow_redirects', '~> 0.3') - gem.add_development_dependency('minitest', '~> 5.25') + gem.add_development_dependency('minitest', '~> 5.26') gem.add_development_dependency('minitest-hooks', '~> 1.5') end From 78e7fbf5a332636206598cbe90e76f1dc774e7c2 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Mon, 13 Oct 2025 13:57:26 -0700 Subject: [PATCH 04/24] Bump rubocop from 1.71.2 to 1.81.1 --- Gemfile | 2 +- Gemfile.lock | 32 ++++++++++++++++++-------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/Gemfile b/Gemfile index cd1e8ba..0512327 100644 --- a/Gemfile +++ b/Gemfile @@ -6,4 +6,4 @@ gemspec gem 'pry' gem 'rake' -gem 'rubocop', '~> 1.43' +gem 'rubocop', '~> 1.81' diff --git a/Gemfile.lock b/Gemfile.lock index 733e76a..63e6e66 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -29,7 +29,7 @@ GEM tzinfo (~> 2.0, >= 2.0.5) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) - ast (2.4.2) + ast (2.4.3) base64 (0.2.0) benchmark (0.4.0) bigdecimal (3.1.9) @@ -54,7 +54,8 @@ GEM i18n (1.14.7) concurrent-ruby (~> 1.0) json (2.9.1) - language_server-protocol (3.17.0.4) + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) logger (1.6.5) lz4-ruby (0.3.3) method_source (1.1.0) @@ -69,10 +70,11 @@ GEM bigdecimal (>= 3.0) ostruct (>= 0.2) ostruct (0.6.1) - parallel (1.26.3) - parser (3.3.7.1) + parallel (1.27.0) + parser (3.3.9.0) ast (~> 2.4.1) racc + prism (1.5.2) pry (0.15.2) coderay (~> 1.1) method_source (~> 1.0) @@ -80,26 +82,28 @@ GEM racc (1.8.1) rainbow (3.1.1) rake (13.2.1) - regexp_parser (2.10.0) - rubocop (1.71.2) + regexp_parser (2.11.3) + rubocop (1.81.1) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.38.0, < 2.0) + rubocop-ast (>= 1.47.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.38.0) - parser (>= 3.3.1.0) + rubocop-ast (1.47.1) + parser (>= 3.3.7.2) + prism (~> 1.4) ruby-progressbar (1.13.0) securerandom (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (3.1.4) - unicode-emoji (~> 4.0, >= 4.0.4) - unicode-emoji (4.0.4) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.1.0) uri (1.0.3) PLATFORMS @@ -116,7 +120,7 @@ DEPENDENCIES ontologies_api_client! pry rake - rubocop (~> 1.43) + rubocop (~> 1.81) BUNDLED WITH 2.5.11 From ce2f9d17c796d987d03641a1a0c3166709cba319 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Mon, 13 Oct 2025 13:59:59 -0700 Subject: [PATCH 05/24] Bump rake from 13.2.1 to 13.3.0 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 63e6e66..57d042b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -81,7 +81,7 @@ GEM public_suffix (6.0.1) racc (1.8.1) rainbow (3.1.1) - rake (13.2.1) + rake (13.3.0) regexp_parser (2.11.3) rubocop (1.81.1) json (~> 2.3) From 36db6a468d7aa43ad0edff548c63b58becc40957 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Wed, 15 Oct 2025 17:06:09 -0700 Subject: [PATCH 06/24] Bump activesupport from 7.2.2.1 to 8.0.3 --- Gemfile.lock | 5 +++-- ontologies_api_client.gemspec | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 57d042b..0e9014c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: ontologies_api_client (2.5.3) - activesupport (= 7.2.2.1) + activesupport (= 8.0.3) addressable (~> 2.8) excon faraday @@ -15,7 +15,7 @@ PATH GEM remote: https://rubygems.org/ specs: - activesupport (7.2.2.1) + activesupport (8.0.3) base64 benchmark (>= 0.3) bigdecimal @@ -27,6 +27,7 @@ GEM minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ast (2.4.3) diff --git a/ontologies_api_client.gemspec b/ontologies_api_client.gemspec index ad1060c..0bb5ebf 100644 --- a/ontologies_api_client.gemspec +++ b/ontologies_api_client.gemspec @@ -18,7 +18,7 @@ Gem::Specification.new do |gem| gem.require_paths = ['lib'] gem.version = LinkedData::Client::VERSION - gem.add_dependency('activesupport', '7.2.2.1') + gem.add_dependency('activesupport', '8.0.3') gem.add_dependency('addressable', '~> 2.8') gem.add_dependency('excon') gem.add_dependency('faraday') From 2229d3a8ce3ddcd4b8a53e505eb824bd923ca1db Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Wed, 15 Oct 2025 17:09:49 -0700 Subject: [PATCH 07/24] Use latest version of bundler Fixes "method redefined; discarding old encode_with" warnings --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0e9014c..a05fb6e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -124,4 +124,4 @@ DEPENDENCIES rubocop (~> 1.81) BUNDLED WITH - 2.5.11 + 2.7.2 From 50489f09a76cac6463d225daef75784d5afdd209 Mon Sep 17 00:00:00 2001 From: mdorf Date: Wed, 5 Nov 2025 13:54:59 -0800 Subject: [PATCH 08/24] critical bug fix to the bulk delete method --- lib/ontologies_api_client/http.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ontologies_api_client/http.rb b/lib/ontologies_api_client/http.rb index 65c0781..9c7181f 100644 --- a/lib/ontologies_api_client/http.rb +++ b/lib/ontologies_api_client/http.rb @@ -161,8 +161,8 @@ def self.delete(path, params = {}, options = {}) response = conn.delete do |req| req.url path req.params = params.dup - req.options[:timeout] = 60 - req.headers.merge(headers) + req.options[:timeout] = options[:timeout] || 60 + req.headers.merge!(headers) end rescue StandardError => e query = Faraday::Utils.build_query(params) From af06fc6620a2ed83f5d53b479d56e2761a81c88b Mon Sep 17 00:00:00 2001 From: mdorf Date: Thu, 6 Nov 2025 08:59:32 -0800 Subject: [PATCH 09/24] improved URL comparison handling in test_purl_obo --- Gemfile.lock | 80 ++++++++++++++++++++------------------- test/models/test_class.rb | 7 +++- test/test_case.rb | 3 +- 3 files changed, 48 insertions(+), 42 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 94cafd0..27d816e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -29,85 +29,87 @@ GEM tzinfo (~> 2.0, >= 2.0.5) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) - ast (2.4.2) - base64 (0.2.0) - benchmark (0.4.0) - bigdecimal (3.1.9) + ast (2.4.3) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (3.3.1) coderay (1.1.3) concurrent-ruby (1.3.5) - connection_pool (2.5.0) - drb (2.2.1) - excon (1.2.3) - faraday (2.12.2) + connection_pool (2.5.4) + drb (2.2.3) + excon (1.3.1) + logger + faraday (2.14.0) faraday-net_http (>= 2.0, < 3.5) json logger - faraday-excon (2.3.0) + faraday-excon (2.4.0) excon (>= 1.0.0) faraday (>= 2.11.0, < 3) - faraday-follow_redirects (0.3.0) + faraday-follow_redirects (0.4.0) faraday (>= 1, < 3) - faraday-multipart (1.1.0) + faraday-multipart (1.1.1) multipart-post (~> 2.0) - faraday-net_http (3.4.0) + faraday-net_http (3.4.1) net-http (>= 0.5.0) i18n (1.14.7) concurrent-ruby (~> 1.0) - json (2.9.1) - language_server-protocol (3.17.0.4) - logger (1.6.5) + json (2.15.2) + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) + logger (1.7.0) lz4-ruby (0.3.3) method_source (1.1.0) - minitest (5.25.4) + minitest (5.26.0) minitest-hooks (1.5.2) minitest (> 5.3) - multi_json (1.15.0) + multi_json (1.17.0) multipart-post (2.4.1) - net-http (0.6.0) + net-http (0.7.0) uri - oj (3.16.9) + oj (3.16.12) bigdecimal (>= 3.0) ostruct (>= 0.2) - ostruct (0.6.1) - parallel (1.26.3) - parser (3.3.7.1) + ostruct (0.6.3) + parallel (1.27.0) + parser (3.3.10.0) ast (~> 2.4.1) racc + prism (1.6.0) pry (0.15.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (6.0.1) + public_suffix (6.0.2) racc (1.8.1) rainbow (3.1.1) - rake (13.2.1) - regexp_parser (2.10.0) - rubocop (1.71.2) + rake (13.3.1) + regexp_parser (2.11.3) + rubocop (1.81.7) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.38.0, < 2.0) + rubocop-ast (>= 1.47.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.38.0) - parser (>= 3.3.1.0) + rubocop-ast (1.47.1) + parser (>= 3.3.7.2) + prism (~> 1.4) ruby-progressbar (1.13.0) securerandom (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (3.1.4) - unicode-emoji (~> 4.0, >= 4.0.4) - unicode-emoji (4.0.4) - uri (1.0.3) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.1.0) + uri (1.1.1) PLATFORMS - arm64-darwin-24 + arm64-darwin-23 ruby - x86_64-darwin-16 - x86_64-darwin-17 - x86_64-linux DEPENDENCIES faraday-follow_redirects (~> 0.3) @@ -119,4 +121,4 @@ DEPENDENCIES rubocop (~> 1.43) BUNDLED WITH - 2.5.11 + 2.6.9 diff --git a/test/models/test_class.rb b/test/models/test_class.rb index c0d6942..c0eba57 100644 --- a/test/models/test_class.rb +++ b/test/models/test_class.rb @@ -64,8 +64,11 @@ def test_purl_obo res = fetch_response(cls.purl) assert_equal 302, res.status - assert_equal 'https://bioportal.bioontology.org/ontologies/DOID/classes?conceptid=http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FDOID_4', - res.headers['location'] + + expected_location = 'https://bioportal.bioontology.org/ontologies/DOID/classes?conceptid=http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FDOID_4' + actual_location = res.headers['location'] + normalize = ->(url) { url&.sub(%r{/(\?)}, '\1') } + assert_equal normalize.call(expected_location), normalize.call(actual_location) end private diff --git a/test/test_case.rb b/test/test_case.rb index 3e5a855..cc9e209 100644 --- a/test/test_case.rb +++ b/test/test_case.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true - +require 'bundler/setup' +require 'pry' require 'minitest/autorun' require 'minitest/hooks/test' require_relative '../lib/ontologies_api_client' From 346a5561b68ba782d62c5d850d67c2499b3a17eb Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Fri, 7 Nov 2025 13:07:54 -0800 Subject: [PATCH 10/24] chore: bump version to 2.7.0 --- lib/ontologies_api_client/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ontologies_api_client/version.rb b/lib/ontologies_api_client/version.rb index c1f37f1..cb6e423 100644 --- a/lib/ontologies_api_client/version.rb +++ b/lib/ontologies_api_client/version.rb @@ -2,6 +2,6 @@ module LinkedData module Client - VERSION = '2.5.3' + VERSION = '2.7.0' end end From 08f4ff435b4b10ea5dab7b043bdda5858c3f3007 Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Fri, 7 Nov 2025 13:27:42 -0800 Subject: [PATCH 11/24] Gemfile.lock update --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 27d816e..be3816e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - ontologies_api_client (2.5.3) + ontologies_api_client (2.7.0) activesupport (= 7.2.2.1) addressable (~> 2.8) excon From ec35613a8dec7c557e85e163993faada231bd5d3 Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Fri, 7 Nov 2025 17:44:47 -0800 Subject: [PATCH 12/24] Add code coverage --- .github/workflows/ruby.yml | 16 ++++++++++++---- .gitignore | 7 +++++-- Gemfile | 2 ++ Gemfile.lock | 19 ++++++++++++++++--- test/test_case.rb | 16 ++++++++++++++++ 5 files changed, 51 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 0650cf0..56eb6ed 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -9,19 +9,22 @@ name: Ruby on: push: + branches: + - '**' # run on all branches + tags-ignore: + - '**' # skip all tags pull_request_target: - types: [opened, reopened] + types: [opened, reopened, synchronize] jobs: test: - runs-on: ubuntu-latest strategy: fail-fast: false matrix: ruby-version: ['3.1'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 - name: Set up Ruby # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, # change this to (see https://github.com/ruby/setup-ruby#versioning): @@ -30,8 +33,13 @@ jobs: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true # runs 'bundle install' and caches installed gems automatically - name: set up config file - run: cp config/config.test.rb config/config.rb + run: cp config/config.test.rb config/config.rb - name: Run tests env: UT_APIKEY: ${{ secrets.UT_APIKEY }} run: bundle exec rake test TESTOPTS="-v" + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + flags: ${{ matrix.ruby-version }} + verbose: true diff --git a/.gitignore b/.gitignore index 9c6de78..446fd6d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,12 @@ *.gem .DS_Store -config/config.rb +/config/config.rb # Specific to IntelliJ .idea/ # Specific to rbenv -.ruby-version \ No newline at end of file +.ruby-version + +# Codecov local cache +/coverage/ diff --git a/Gemfile b/Gemfile index cd1e8ba..3d9f833 100644 --- a/Gemfile +++ b/Gemfile @@ -7,3 +7,5 @@ gemspec gem 'pry' gem 'rake' gem 'rubocop', '~> 1.43' +gem "simplecov", require: false +gem "simplecov-cobertura", require: false diff --git a/Gemfile.lock b/Gemfile.lock index be3816e..7b27f71 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -36,6 +36,7 @@ GEM coderay (1.1.3) concurrent-ruby (1.3.5) connection_pool (2.5.4) + docile (1.4.1) drb (2.2.3) excon (1.3.1) logger @@ -50,11 +51,11 @@ GEM faraday (>= 1, < 3) faraday-multipart (1.1.1) multipart-post (~> 2.0) - faraday-net_http (3.4.1) - net-http (>= 0.5.0) + faraday-net_http (3.4.2) + net-http (~> 0.5) i18n (1.14.7) concurrent-ruby (~> 1.0) - json (2.15.2) + json (2.16.0) language_server-protocol (3.17.0.5) lint_roller (1.1.0) logger (1.7.0) @@ -84,6 +85,7 @@ GEM rainbow (3.1.1) rake (13.3.1) regexp_parser (2.11.3) + rexml (3.4.4) rubocop (1.81.7) json (~> 2.3) language_server-protocol (~> 3.17.0.2) @@ -100,6 +102,15 @@ GEM prism (~> 1.4) ruby-progressbar (1.13.0) securerandom (0.4.1) + simplecov (0.22.0) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-cobertura (3.1.0) + rexml + simplecov (~> 0.19) + simplecov-html (0.13.2) + simplecov_json_formatter (0.1.4) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (3.2.0) @@ -119,6 +130,8 @@ DEPENDENCIES pry rake rubocop (~> 1.43) + simplecov + simplecov-cobertura BUNDLED WITH 2.6.9 diff --git a/test/test_case.rb b/test/test_case.rb index cc9e209..b4bc8a4 100644 --- a/test/test_case.rb +++ b/test/test_case.rb @@ -1,4 +1,20 @@ # frozen_string_literal: true +# Start simplecov if this is a coverage task or if it is run in the CI pipeline +if ENV['COVERAGE'] || ENV['CI'] + require 'simplecov' + require 'simplecov-cobertura' + + SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([ + SimpleCov::Formatter::HTMLFormatter, + SimpleCov::Formatter::CoberturaFormatter, # writes coverage/cobertura.xml + ]) + + SimpleCov.start do + enable_coverage :branch + add_filter %w[/test/ /config/] + end +end + require 'bundler/setup' require 'pry' require 'minitest/autorun' From 4e5c0d88a2f66abdd69989560f8cf8b1bd95baeb Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Fri, 7 Nov 2025 17:48:50 -0800 Subject: [PATCH 13/24] add codecov token --- .github/workflows/ruby.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 56eb6ed..7564131 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -41,5 +41,6 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: + token: ${{ secrets.CODECOV_TOKEN }} flags: ${{ matrix.ruby-version }} verbose: true From e1d9a93684f6726eedf5d81df52194bcbb2d4e33 Mon Sep 17 00:00:00 2001 From: mdorf Date: Mon, 10 Nov 2025 14:46:49 -0800 Subject: [PATCH 14/24] fixed merge of headers for http.get --- lib/ontologies_api_client/http.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ontologies_api_client/http.rb b/lib/ontologies_api_client/http.rb index 9c7181f..6ec4d73 100644 --- a/lib/ontologies_api_client/http.rb +++ b/lib/ontologies_api_client/http.rb @@ -69,7 +69,7 @@ def self.get(path, params = {}, options = {}) req.url path req.params = params.dup req.options[:timeout] = 60 - req.headers.merge(headers) + req.headers.merge!(headers) req.headers[:invalidate_cache] = invalidate_cache end rescue StandardError => e From 371520fa8fd6b1f36422fe79717b3e0cdf12ee11 Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Mon, 10 Nov 2025 15:18:43 -0800 Subject: [PATCH 15/24] chore: bump version to v2.7.1 --- lib/ontologies_api_client/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ontologies_api_client/version.rb b/lib/ontologies_api_client/version.rb index cb6e423..0029957 100644 --- a/lib/ontologies_api_client/version.rb +++ b/lib/ontologies_api_client/version.rb @@ -2,6 +2,6 @@ module LinkedData module Client - VERSION = '2.7.0' + VERSION = '2.7.1' end end From f992b18ecc3b58de4c2b318a214d84d0a493cbef Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Mon, 10 Nov 2025 15:26:08 -0800 Subject: [PATCH 16/24] Gemfile.lock update --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7b27f71..5c96a36 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - ontologies_api_client (2.7.0) + ontologies_api_client (2.7.1) activesupport (= 7.2.2.1) addressable (~> 2.8) excon From 81d75d6c1e8e77b3c635cdd3bc2d632487ade2b2 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Wed, 19 Nov 2025 09:03:13 -0800 Subject: [PATCH 17/24] Fix RuboCop warnings --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index df75acb..83b4947 100644 --- a/Gemfile +++ b/Gemfile @@ -7,5 +7,5 @@ gemspec gem 'pry' gem 'rake' gem 'rubocop', '~> 1.81' -gem "simplecov", require: false -gem "simplecov-cobertura", require: false +gem 'simplecov', require: false +gem 'simplecov-cobertura', require: false From 685bf52a3858e06e909ffa57e975a9536acfc871 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Fri, 9 Jan 2026 09:42:44 -0800 Subject: [PATCH 18/24] Remove Ruby 3.1 from the text matrix --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 0ebead5..3a1750d 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: ['3.1', '3.2'] + ruby-version: ['3.2'] steps: - uses: actions/checkout@v5 - name: Set up Ruby From fbc81062a57819e46cb76bafa5d7cccdea920ce0 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Fri, 9 Jan 2026 10:23:25 -0800 Subject: [PATCH 19/24] Skip some purl related tests (for now) --- test/models/test_class.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/models/test_class.rb b/test/models/test_class.rb index c0eba57..5b597df 100644 --- a/test/models/test_class.rb +++ b/test/models/test_class.rb @@ -36,6 +36,8 @@ def test_purl_owl # Test PURL generation for a class in a UMLS format ontology def test_purl_umls + skip 'Disable until #41 is fixed: https://github.com/ncbo/ontologies_api_ruby_client/issues/41' + cls = LinkedData::Client::Models::Class.find( 'http://purl.bioontology.org/ontology/SNOMEDCT/64572001', 'https://bioportal.bioontology.org/ontologies/SNOMEDCT' @@ -53,6 +55,8 @@ def test_purl_umls # Test PURL generation for a class in an OBO format ontology def test_purl_obo + skip 'Disable until #41 is fixed: https://github.com/ncbo/ontologies_api_ruby_client/issues/41' + cls = LinkedData::Client::Models::Class.find( 'http://purl.obolibrary.org/obo/DOID_4', 'https://bioportal.bioontology.org/ontologies/DOID' From 5cfe36397ce1d2feb2ee38ccfcae50bf4d438f30 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Fri, 9 Jan 2026 10:30:45 -0800 Subject: [PATCH 20/24] Update license copyright year --- LICENSE.txt | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 8b0d9e2..7edfb51 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2025, The Board of Trustees of Leland Stanford Junior University +Copyright (c) 2026, The Board of Trustees of Leland Stanford Junior University All rights reserved. Redistribution and use in source and binary forms, with or without modification, are diff --git a/README.md b/README.md index 4feda27..a9f7320 100644 --- a/README.md +++ b/README.md @@ -153,4 +153,4 @@ For questions please email [support@bioontology.org](support@bioontology.org.) ## License -This project is licensed under the [FreeBSD License](LICENSE.txt) © 2025 The Board of Trustees of Leland Stanford Junior University. \ No newline at end of file +This project is licensed under the [FreeBSD License](LICENSE.txt) © 2026 The Board of Trustees of Leland Stanford Junior University. \ No newline at end of file From 40c3a80a614e36c9df257cd42fe1e677a6890523 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Fri, 9 Jan 2026 14:52:38 -0800 Subject: [PATCH 21/24] Add contributor images --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index a9f7320..0846c51 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,11 @@ Resources that should have save, update, and delete methods will need to include For questions please email [support@bioontology.org](support@bioontology.org.) +## Contributors + + + + ## License This project is licensed under the [FreeBSD License](LICENSE.txt) © 2026 The Board of Trustees of Leland Stanford Junior University. \ No newline at end of file From fbb53c7cc7f2e8ddae733f070d43bf58f059aa4a Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Fri, 9 Jan 2026 15:01:48 -0800 Subject: [PATCH 22/24] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 0846c51..bb9a762 100644 --- a/README.md +++ b/README.md @@ -157,5 +157,4 @@ For questions please email [support@bioontology.org](support@bioontology.org.) ## License - -This project is licensed under the [FreeBSD License](LICENSE.txt) © 2026 The Board of Trustees of Leland Stanford Junior University. \ No newline at end of file +The 2-Clause BSD License. See [LICENSE.txt](LICENSE.txt) for more information. From dde38625b006fe969332aa46ae19682b696f9442 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Fri, 9 Jan 2026 15:04:27 -0800 Subject: [PATCH 23/24] Increase version to 2.8.0 --- Gemfile.lock | 2 +- lib/ontologies_api_client/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c3a9460..c165d83 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - ontologies_api_client (2.7.1) + ontologies_api_client (2.8.0) activesupport (= 8.0.3) addressable (~> 2.8) excon diff --git a/lib/ontologies_api_client/version.rb b/lib/ontologies_api_client/version.rb index 0029957..b4ad266 100644 --- a/lib/ontologies_api_client/version.rb +++ b/lib/ontologies_api_client/version.rb @@ -2,6 +2,6 @@ module LinkedData module Client - VERSION = '2.7.1' + VERSION = '2.8.0' end end From 02c9d610a064d3cb3920e0effbb251b54d037215 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Tue, 14 Apr 2026 18:01:55 -0700 Subject: [PATCH 24/24] Fix nil error in Analytics.last_month when ontology data is missing Use Hash#dig for nil-safe nested hash access instead of chained bracket lookups, which raised NoMethodError when analytics[ont] was nil. Defaults to 0 views and logs a debug message when data is missing. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/ontologies_api_client/analytics.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ontologies_api_client/analytics.rb b/lib/ontologies_api_client/analytics.rb index cbb85ac..93c2f04 100644 --- a/lib/ontologies_api_client/analytics.rb +++ b/lib/ontologies_api_client/analytics.rb @@ -1,6 +1,7 @@ module LinkedData::Client class Analytics HTTP = LinkedData::Client::HTTP + LOGGER = Logger.new($stdout) attr_accessor :onts, :date @@ -18,7 +19,11 @@ def self.last_month analytics.delete(:context) onts = [] analytics.keys.each do |ont| - views = analytics[ont][:"#{year_num}"][:"#{month_num}"] + views = analytics.dig(ont, :"#{year_num}", :"#{month_num}") + if views.nil? + LOGGER.debug("Analytics data missing for ontology: #{ont}, year: #{year_num}, month: #{month_num}") + views = 0 + end onts << {ont: ont, views: views} end data.onts = onts