Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
5da0737
initial commit, work-in-progress: sinatra 4.2.1 compatibiity
mdorf Jan 23, 2026
c8919ec
initial commit, work-in-progress: sinatra 4.2.1 compatibiity
mdorf Jan 23, 2026
9937e86
progress commit; sinatra 4.2.1 upgrade
mdorf Jan 23, 2026
e91f1b2
added solr admin endpoints
mdorf Jan 28, 2026
a15ccfd
synchronized test ontology files with AgroPortal
mdorf Jan 28, 2026
9649a3a
Gemfile.lock update
mdorf Jan 28, 2026
a162678
added code to disable security for test after_all calls
mdorf Jan 28, 2026
8638245
added a safeguard to disable security if test that uses it fails
mdorf Jan 28, 2026
8768093
updated test_rack_attack to Rackup
mdorf Jan 28, 2026
fad1d19
search_helper improved language handling; metadata search options
mdorf Jan 28, 2026
f711f82
Gemfile.lock udpate
mdorf Jan 28, 2026
daf7063
added endpoints for ontologies and content searches
mdorf Jan 28, 2026
96c7e1d
added ability to filter and paginate submission endpoint
mdorf Jan 28, 2026
355e868
refactored test_submissions_includes tests
mdorf Jan 28, 2026
7eaf9cd
added test_mappings_slices test to test_slices_helper
mdorf Jan 29, 2026
4a9ffbd
ruby 3.2 compatibility updates
mdorf Jan 29, 2026
5671104
re-added cube but will remove it again
mdorf Jan 29, 2026
65d1c3f
removed cube integration as it's not being used
mdorf Jan 29, 2026
cc92729
removed the newrelic integration for now; it needs to be re-integrated
mdorf Jan 29, 2026
697af25
fixed oboId and notation searches
mdorf Jan 29, 2026
7ce9188
fixed the unit test test_language_attribute_filter
mdorf Jan 29, 2026
e6971cb
resoved an issue with setting filenames in create_ontology
mdorf Jan 29, 2026
1601744
removed double-quoting around the test_search_security query based on…
mdorf Jan 30, 2026
a8fb6e0
disabled test_search_custom_onts in test_users_helper due to its inco…
mdorf Jan 30, 2026
8624e26
fixed test_default_multilingual test because language :none changed t…
mdorf Jan 30, 2026
546e92a
Gemfile.lock update
mdorf Feb 1, 2026
08b0ed0
updated test_default_multilingual unit test to correctly test for fre…
mdorf Feb 2, 2026
72e2f1e
Gemfile.lock update
mdorf Feb 3, 2026
3f720c3
fixed a failing unit test, test_default_multilingual
mdorf Feb 3, 2026
a9508b9
removed minitest-fail-fast gem, as minitest 6 already includes --fail…
mdorf Feb 3, 2026
092df33
Gemfile.lock update
mdorf Feb 3, 2026
6d58a85
Gemfile.lock update
mdorf Feb 3, 2026
88a8aa1
Gemfile.lock update
mdorf Feb 3, 2026
bea5b8f
Gemfile.lock update
mdorf Feb 5, 2026
ea570ed
fixed the warning: detected duplicate key creator in JSON object. Thi…
mdorf Feb 5, 2026
0ae6948
re-enabled the test test_search_models_controller/test_search_data. I…
mdorf Feb 5, 2026
ab55e41
fixed a missing require
mdorf Feb 5, 2026
71e1367
fixed docker-compose vars
mdorf Feb 5, 2026
7b81f9a
added ability to return unmapped attributes for properties
mdorf Feb 6, 2026
721ea06
fixed the unit test test_show_all_collection to allow for two optiona…
mdorf Feb 6, 2026
3044788
added resource dereference controller and tests
mdorf Feb 8, 2026
651cd58
moved redis_goo and redis_http to application_helper
mdorf Feb 11, 2026
b217034
Gemfile.lock update
mdorf Feb 11, 2026
f96728a
added user OAuth authentication capability
mdorf Feb 11, 2026
ca1d1a8
use ruby 3.2.9
alexskr Feb 25, 2026
175b077
prune platforms
alexskr Feb 25, 2026
748eb4c
re-enable capistrano/rbenv
alexskr Feb 25, 2026
5e9cd8d
Gemfile.lock update
mdorf Feb 26, 2026
decafc6
removed the use of shotgun server. Now use: bundle exec rackup -E dev…
mdorf Feb 26, 2026
334131a
Gemfile.lock update
mdorf Feb 26, 2026
223cae3
fixed routes for Sinatra 4, which changed from objects to arrays
mdorf Feb 27, 2026
2209513
added home controller tests to validate the routes
mdorf Feb 27, 2026
0b36528
update ncbo_cron gem
alexskr Feb 28, 2026
7b122a3
remove .second for compatiblty reasons
alexskr Feb 28, 2026
9a95846
Gemfile.lock update
alexskr Feb 28, 2026
1f8c695
fixed the @context not showing in home API service call
mdorf Mar 3, 2026
d6d17cf
Gemfile.lock update
mdorf Mar 3, 2026
480a6bf
Gemfile.lock update
mdorf Mar 3, 2026
3b9db9b
Gemfile.lock update
alexskr Mar 4, 2026
829513d
Gemfile.lock update
alexskr Mar 4, 2026
60ae1ff
Gemfile.lock update
alexskr Mar 4, 2026
041553b
re-added the use of shotgun, pointed to the updated version from syph…
mdorf Mar 5, 2026
cbf73be
Gemfile.lock
mdorf Mar 6, 2026
2a04c02
Gemfile.lock update
mdorf Mar 6, 2026
b987bbd
integrate ontoportal testkit
alexskr Mar 7, 2026
e55492c
update test config file
alexskr Mar 7, 2026
6521ffe
remove TESTOPTS env var
alexskr Mar 7, 2026
12cdeec
Merge branch 'chore/ontoportal-lirmm-goo-compat' into infra/ontoporta…
alexskr Mar 9, 2026
a7f3a9d
Merge pull request #204 from ncbo/infra/ontoportal-testkit-integration
alexskr Mar 9, 2026
5e702a5
Gemfile.lock update
alexskr Mar 9, 2026
93aa0c2
Gemfile.lock update
alexskr Mar 9, 2026
388d1bd
converted acronyms filter from Boolean to Term syntax to prevent 'too…
mdorf Mar 9, 2026
440de76
Gemfile.lock update
mdorf Mar 9, 2026
09dab09
Gemfile.lock update
alexskr Mar 10, 2026
00a3dce
Gemfile.lock update
mdorf Mar 10, 2026
6cbcea5
replaced another search boolean query with a term query
mdorf Mar 10, 2026
eba9bd1
Merge branch 'chore/ontoportal-lirmm-goo-compat' of github.com:ncbo/o…
mdorf Mar 10, 2026
52b9437
Gemfile.lock update
mdorf Mar 19, 2026
f36af73
Gemfile.lock update
alexskr Mar 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .github/workflows/ruby-unit-tests.yml

This file was deleted.

87 changes: 87 additions & 0 deletions .github/workflows/testkit-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Docker Unit Tests

on:
push:
branches:
- '**'
tags-ignore:
- '**'
pull_request:

env:
# CI execution mode for backend tests:
# - container: run `test:docker:<backend>:container` (default)
# - native: run `test:docker:<backend>` on host Ruby
OPTK_CI_RUN_MODE: ${{ vars.OPTK_CI_RUN_MODE || 'container' }}
# Example override to force native mode in this workflow file:
# OPTK_CI_RUN_MODE: native

jobs:
prepare:
runs-on: ubuntu-latest
outputs:
backends: ${{ steps.cfg.outputs.backends }}
steps:
- uses: actions/checkout@v4

- id: cfg
name: Read backend matrix from .ontoportal-testkit.yml
run: |
BACKENDS=$(ruby -ryaml -rjson -e 'c=YAML.safe_load_file(".ontoportal-testkit.yml") || {}; b=c["backends"] || %w[fs ag vo gd]; puts JSON.generate(b)')
echo "backends=$BACKENDS" >> "$GITHUB_OUTPUT"

test:
needs: prepare
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
backend: ${{ fromJson(needs.prepare.outputs.backends) }}

steps:
- uses: actions/checkout@v4

- name: Set up Ruby from .ruby-version
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true

- name: Set up Java 11 (native mode)
if: env.OPTK_CI_RUN_MODE == 'native'
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '11'

- name: Install native system dependencies
if: env.OPTK_CI_RUN_MODE == 'native'
run: |
sudo apt-get update
sudo apt-get install -y raptor2-utils

- name: Run unit tests
env:
CI: "true"
TESTOPTS: "--verbose"
BACKEND: ${{ matrix.backend }}
run: |
MODE="${OPTK_CI_RUN_MODE:-container}"
TASK="test:docker:${BACKEND}"
if [ "$MODE" = "container" ]; then
TASK="${TASK}:container"
elif [ "$MODE" != "native" ]; then
echo "Invalid OPTK_CI_RUN_MODE=$MODE (expected container or native)"
exit 1
fi

bundle exec rake "$TASK"

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests,${{ matrix.backend }}
verbose: true
fail_ci_if_error: false
9 changes: 9 additions & 0 deletions .ontoportal-testkit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
component_name: ontologies_api
app_service: test-container
backends:
- fs
- ag
- vo
- gd
dependency_services:
- mgrep
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.6
3.2.10
1 change: 0 additions & 1 deletion Capfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ require 'capistrano/bundler'
# require 'capistrano/rails/assets'
# require 'capistrano/rails/migrations'
require 'capistrano/locally'
require 'new_relic/recipes' # announce deployments in NewRelic
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
30 changes: 13 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
ARG RUBY_VERSION=3.1
ARG DISTRO_NAME=bullseye
ARG RUBY_VERSION=3.2
ARG DISTRO=bullseye
ARG TESTKIT_BASE_IMAGE=ontoportal/testkit-base:ruby${RUBY_VERSION}-${DISTRO}
FROM ${TESTKIT_BASE_IMAGE}

FROM ruby:$RUBY_VERSION-$DISTRO_NAME
WORKDIR /app

RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \
openjdk-11-jre-headless \
raptor2-utils \
&& rm -rf /var/lib/apt/lists/*
COPY Gemfile* *.gemspec ./

RUN mkdir -p /srv/ontoportal/ontologies_api
RUN mkdir -p /srv/ontoportal/bundle
COPY Gemfile* /srv/ontoportal/ontologies_api/
# Respect the project's Bundler lock when present.
RUN if [ -f Gemfile.lock ]; then \
BUNDLER_VERSION=$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1 | tr -d ' '); \
gem install bundler -v "$BUNDLER_VERSION"; \
fi

WORKDIR /srv/ontoportal/ontologies_api
RUN bundle install --jobs 4 --retry 3

ENV BUNDLE_PATH=/srv/ontoportal/bundle
RUN bundle install
COPY . ./

COPY . /srv/ontoportal/ontologies_api
RUN cp /srv/ontoportal/ontologies_api/config/environments/config.rb.sample /srv/ontoportal/ontologies_api/config/environments/development.rb

EXPOSE 9393
CMD ["bundle", "exec", "rackup", "-p", "9393", "--host", "0.0.0.0"]
64 changes: 34 additions & 30 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,58 +1,61 @@
source 'https://rubygems.org'

gem 'activesupport', '~> 5'
gem 'activesupport'
# see https://github.com/ncbo/ontologies_api/issues/69
gem 'bigdecimal'
# gem 'faraday', '~> 1.9'
gem 'json-schema', '~> 2.0'
gem 'json-schema'
gem 'multi_json'
gem 'oj'
gem 'parseconfig'
gem 'rack'
gem 'rake', '~> 10.0'
gem 'rake'
gem 'rexml' # Investigate why unicorn fails to start under ruby 3 without adding rexml gem to the Gemfile
gem 'sinatra', '~> 1.0'
gem 'sinatra-advanced-routes'
gem 'sinatra-contrib', '~> 1.0'
gem 'rackup'
gem 'sinatra'
gem 'sinatra-contrib'

gem 'request_store'
gem 'parallel'
gem 'google-protobuf', '3.25.3'
gem 'grpc', '1.70.1'
gem 'net-ftp'
gem 'json-ld', '~> 3.2.0'
gem 'rdf-raptor', github:'ruby-rdf/rdf-raptor', ref: '6392ceabf71c3233b0f7f0172f662bd4a22cd534' # use version 3.3.0 when available

# Rack middleware
gem 'ffi'
gem 'rack-accept', '~> 0.4'
gem 'rack-attack', '~> 6.6.1', require: 'rack/attack'
gem 'rack-cache', '~> 1.13.0' # see https://github.com/ncbo/ontologies_api/issues/118
gem 'rack-accept'
gem 'rack-attack', require: 'rack/attack'
gem 'rack-cache' # see https://github.com/ncbo/ontologies_api/issues/118
gem 'rack-cors', require: 'rack/cors'
# GitHub dependency can be removed when https://github.com/niko/rack-post-body-to-params/pull/6 is merged and released
gem 'rack-post-body-to-params', github: 'palexander/rack-post-body-to-params', branch: 'multipart_support'
gem 'rack-timeout'
gem 'redis-rack-cache', '~> 2.0'
gem 'redis-rack-cache'

# Data access (caching)
gem 'redis'
gem 'redis-store', '~>1.10'

# Monitoring
gem 'cube-ruby', require: 'cube'
gem 'newrelic_rpm', group: [:default, :deployment]
gem 'redis-store'

# HTTP server
gem 'unicorn'
gem 'unicorn-worker-killer'

# Templating
gem 'haml', '~> 5.2.2' # pin see https://github.com/ncbo/ontologies_api/pull/107
gem 'redcarpet'
gem 'rack-contrib'
gem 'pandoc-ruby'

# NCBO gems (can be from a local dev path or from rubygems/git)
gem 'goo', github: 'ncbo/goo', branch: 'develop'
gem 'ncbo_annotator', github: 'ncbo/ncbo_annotator', branch: 'develop'
gem 'ncbo_cron', github: 'ncbo/ncbo_cron', branch: 'develop'
gem 'ncbo_ontology_recommender', github: 'ncbo/ncbo_ontology_recommender', branch: 'develop'
gem 'ontologies_linked_data', github: 'ncbo/ontologies_linked_data', branch: 'develop'
gem 'sparql-client', github: 'ncbo/sparql-client', tag: 'v6.3.0'
gem 'goo', github: 'ncbo/goo', branch: 'main'
gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'main'
gem 'ncbo_annotator', github: 'ncbo/ncbo_annotator', branch: 'chore/ruby3.2-minitest6-compat'
gem 'ncbo_cron', github: 'ncbo/ncbo_cron', branch: 'chore/ontoportal-lirmm-goo-compat'
gem 'ncbo_ontology_recommender', github: 'ncbo/ncbo_ontology_recommender', branch: 'chore/ruby3.2-minitest6-compat'
gem 'ontologies_linked_data', github: 'ncbo/ontologies_linked_data', branch: 'chore/ontoportal-lirmm-goo-compat'

group :development do
# bcrypt_pbkdf and ed35519 is required for capistrano deployments when using ed25519 keys; see https://github.com/miloserdow/capistrano-deploy/issues/42
gem 'shotgun', github: 'palexander/shotgun', branch: 'ncbo'
gem 'shotgun', github: 'syphax-bouazzouni/shotgun', branch: 'master'
gem 'rubocop'
end

Expand All @@ -73,13 +76,14 @@ end
group :test do
gem 'byebug', '~> 12.0'
gem 'crack', '0.4.5'
gem 'minitest', '~> 5.0'
gem 'minitest-hooks', "~> 1.5"
gem 'minitest'
gem 'minitest-hooks'
gem 'minitest-reporters'
gem 'minitest-stub_any_instance'
gem 'ontoportal_testkit', github: 'alexskr/ontoportal_testkit', branch: 'main'
gem 'rack-test'
gem 'simplecov', require: false
gem 'simplecov-cobertura' # for codecov.io
gem 'webmock', '~> 3.19.1'
gem 'webmock'
gem 'webrick'
gem 'minitest-bisect'
end
end
Loading
Loading