Skip to content

Commit

Permalink
Merge branch 'development' into stage
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed May 20, 2024
2 parents 56cefc5 + 5230091 commit 36aec71
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 51 deletions.
9 changes: 4 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ gem 'rack-timeout'
gem 'redis-rack-cache', '~> 2.0'

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

# Monitoring
gem 'cube-ruby', require: 'cube'
Expand All @@ -48,10 +47,10 @@ gem 'redcarpet'

# NCBO gems (can be from a local dev path or from rubygems/git)
gem 'ncbo_annotator', git: 'https://github.com/ontoportal-lirmm/ncbo_annotator.git', branch: 'development'
gem 'ncbo_cron', git: 'https://github.com/ontoportal-lirmm/ncbo_cron.git', branch: 'master'
gem 'ncbo_cron', git: 'https://github.com/ontoportal-lirmm/ncbo_cron.git', branch: 'development'
gem 'ncbo_ontology_recommender', git: 'https://github.com/ncbo/ncbo_ontology_recommender.git', branch: 'master'
gem 'sparql-client', github: 'ontoportal-lirmm/sparql-client', branch: 'master'
gem 'goo', github: 'ontoportal-lirmm/goo', branch: 'development'
gem 'sparql-client', github: 'ontoportal-lirmm/sparql-client', branch: 'development'
gem 'ontologies_linked_data', git: 'https://github.com/ontoportal-lirmm/ontologies_linked_data.git', branch: 'development'

group :development do
Expand Down
75 changes: 41 additions & 34 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT

GIT
remote: https://github.com/ontoportal-lirmm/goo.git
revision: 0e554fce49713ce4d5a742a06c2fb59a547caf47
revision: b2a635fb1e8206e6e3010be4dbe033b47eb58481
branch: development
specs:
goo (0.0.2)
Expand Down Expand Up @@ -40,8 +40,8 @@ GIT

GIT
remote: https://github.com/ontoportal-lirmm/ncbo_cron.git
revision: 9ec0147203007cc368a5119ffe1a019fa8701c14
branch: master
revision: 865f00adf94a5bd471eb9b35adc90812a3b854a9
branch: development
specs:
ncbo_cron (0.0.1)
dante
Expand All @@ -57,7 +57,7 @@ GIT

GIT
remote: https://github.com/ontoportal-lirmm/ontologies_linked_data.git
revision: 135b0df0d6394f69162f496674c5b2f2a3dcba4c
revision: 1278507e6ae8224edca746c7c150775ec2210195
branch: development
specs:
ontologies_linked_data (0.0.1)
Expand All @@ -77,13 +77,12 @@ GIT

GIT
remote: https://github.com/ontoportal-lirmm/sparql-client.git
revision: 180c818f7715baac64b2699bb452ef5c756f62c5
branch: master
revision: 59251e59346c9a69a67c88552ba55a1244eec602
branch: development
specs:
sparql-client (1.0.1)
json_pure (>= 1.4)
net-http-persistent (= 2.9.4)
rdf (>= 1.0)
sparql-client (3.2.2)
net-http-persistent (~> 4.0, >= 4.0.2)
rdf (~> 3.2, >= 3.2.11)

GIT
remote: https://github.com/palexander/rack-post-body-to-params.git
Expand Down Expand Up @@ -114,7 +113,8 @@ GEM
backports (3.25.0)
base64 (0.2.0)
bcrypt (3.1.20)
bcrypt_pbkdf (1.1.0)
bcrypt_pbkdf (1.1.1)
bcrypt_pbkdf (1.1.1-x86_64-darwin)
bigdecimal (1.4.2)
builder (3.2.4)
capistrano (3.18.1)
Expand All @@ -131,6 +131,7 @@ GEM
sshkit (~> 1.3)
coderay (1.1.3)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
crack (1.0.0)
bigdecimal
rexml
Expand Down Expand Up @@ -181,9 +182,9 @@ GEM
google-analytics-data-v1beta (0.12.0)
gapic-common (>= 0.21.1, < 2.a)
google-cloud-errors (~> 1.0)
google-apis-analytics_v3 (0.15.0)
google-apis-core (>= 0.14.0, < 2.a)
google-apis-core (0.14.1)
google-apis-analytics_v3 (0.16.0)
google-apis-core (>= 0.15.0, < 2.a)
google-apis-core (0.15.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 1.9)
httpclient (>= 2.8.1, < 3.a)
Expand All @@ -197,6 +198,7 @@ GEM
google-cloud-env (2.1.1)
faraday (>= 1.0, < 3.a)
google-cloud-errors (1.4.0)
google-protobuf (3.25.3-x86_64-darwin)
google-protobuf (3.25.3-x86_64-linux)
googleapis-common-protos (1.5.0)
google-protobuf (~> 3.18)
Expand All @@ -211,7 +213,10 @@ GEM
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
grpc (1.62.0-x86_64-linux)
grpc (1.63.0-x86_64-darwin)
google-protobuf (~> 3.25)
googleapis-common-protos-types (~> 1.0)
grpc (1.63.0-x86_64-linux)
google-protobuf (~> 3.25)
googleapis-common-protos-types (~> 1.0)
haml (5.2.2)
Expand All @@ -231,7 +236,6 @@ GEM
rdf (>= 2.2.8, < 4.0)
json-schema (2.8.1)
addressable (>= 2.4)
json_pure (2.7.2)
jwt (2.8.1)
base64
kgio (2.11.4)
Expand All @@ -248,17 +252,18 @@ GEM
method_source (1.1.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0305)
mime-types-data (3.2024.0507)
mini_mime (1.1.5)
minitest (4.7.5)
minitest-stub_any_instance (1.0.3)
mlanett-redis-lock (0.2.7)
redis
multi_json (1.15.0)
multipart-post (2.4.0)
multipart-post (2.4.1)
mutex_m (0.2.0)
net-http-persistent (2.9.4)
net-imap (0.4.10)
net-http-persistent (4.0.2)
connection_pool (~> 2.2)
net-imap (0.4.11)
date
net-protocol
net-pop (0.1.2)
Expand Down Expand Up @@ -301,7 +306,7 @@ GEM
rack
rack-test (2.1.0)
rack (>= 1.3)
rack-timeout (0.6.3)
rack-timeout (0.7.0)
raindrops (0.20.1)
rake (10.5.0)
rdf (3.2.11)
Expand All @@ -320,28 +325,29 @@ GEM
rdf (~> 3.2)
rexml (~> 3.2)
redcarpet (3.6.0)
redis (4.8.1)
redis-activesupport (5.3.0)
activesupport (>= 3, < 8)
redis-store (>= 1.3, < 2)
redis (5.2.0)
redis-client (>= 0.22.0)
redis-client (0.22.1)
connection_pool
redis-rack-cache (2.2.1)
rack-cache (>= 1.10, < 2)
redis-store (>= 1.6, < 2)
redis-store (1.9.1)
redis (>= 4, < 5)
redis-store (1.10.0)
redis (>= 4, < 6)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
request_store (1.6.0)
request_store (1.7.0)
rack (>= 1.4)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
retriable (3.1.2)
rexml (3.2.6)
rexml (3.2.8)
strscan (>= 3.0.9)
rsolr (2.6.0)
builder (>= 2.1.2)
faraday (>= 0.9, < 3, != 2.0.0)
Expand Down Expand Up @@ -377,12 +383,13 @@ GEM
rack-test
sinatra (~> 1.4.0)
tilt (>= 1.3, < 3)
sshkit (1.22.1)
sshkit (1.22.2)
base64
mutex_m
net-scp (>= 1.1.2)
net-sftp (>= 2.1.2)
net-ssh (>= 2.8.0)
strscan (3.1.0)
systemu (2.6.5)
temple (0.10.3)
tilt (2.3.0)
Expand All @@ -405,6 +412,7 @@ GEM
hashdiff (>= 0.4.0, < 2.0.0)

PLATFORMS
x86_64-darwin-23
x86_64-linux

DEPENDENCIES
Expand Down Expand Up @@ -446,10 +454,9 @@ DEPENDENCIES
rack-timeout
rake (~> 10.0)
redcarpet
redis (~> 4.8.1)
redis-activesupport
redis
redis-rack-cache (~> 2.0)
redis-store (= 1.9.1)
redis-store (~> 1.10)
request_store
shotgun!
simplecov
Expand All @@ -463,4 +470,4 @@ DEPENDENCIES
webmock (~> 3.19.1)

BUNDLED WITH
2.3.15
2.4.22
7 changes: 3 additions & 4 deletions config/rack_attack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
puts "(API) >> Throttling enabled at #{LinkedData::OntologiesAPI.settings.req_per_second_per_ip} req/sec"

require 'rack/attack'
require 'redis-activesupport'
use Rack::Attack

attack_redis_host_port = {
host: LinkedData::OntologiesAPI.settings.http_redis_host,
port: LinkedData::OntologiesAPI.settings.http_redis_port
port: LinkedData::OntologiesAPI.settings.http_redis_port,
db: 1
}
attack_store = ActiveSupport::Cache::RedisStore.new(attack_redis_host_port)
Rack::Attack.cache.store = attack_store
Rack::Attack.cache.store = Redis.new(attack_redis_host_port)

safe_ips = LinkedData::OntologiesAPI.settings.safe_ips ||= Set.new
safe_ips.each do |safe_ip|
Expand Down
4 changes: 2 additions & 2 deletions controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ class UsersController < ApplicationController
private


def create_user
def create_user(send_notifications: true)
params ||= @params
user = User.find(params["username"]).first
error 409, "User with username `#{params["username"]}` already exists" unless user.nil?
params.delete("role") unless current_user.admin?
user = instance_from_params(User, params)
if user.valid?
user.save(send_notifications: false)
user.save(send_notifications: send_notifications)
else
error 422, user.errors
end
Expand Down
11 changes: 5 additions & 6 deletions test/controllers/test_search_models_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def test_show_all_collection
get '/admin/search/collections'
assert last_response.ok?
res = MultiJson.load(last_response.body)
assert_equal res["collections"].sort, Goo.search_connections.keys.map(&:to_s).sort
array = %w[agents_metadata ontology_data ontology_metadata prop_search_core1 term_search_core1]
assert_equal res["collections"].sort , array.sort
end

def test_collection_schema
Expand Down Expand Up @@ -81,7 +82,7 @@ def test_search_security
subs = LinkedData::Models::OntologySubmission.all
subs.each do |s|
s.bring_remaining
s.index_all_data(Logger.new($stdout))
s.index_all(Logger.new($stdout))
end


Expand Down Expand Up @@ -416,7 +417,7 @@ def test_agents_search
def test_search_data
count, acronyms, bro = LinkedData::SampleData::Ontology.create_ontologies_and_submissions({
process_submission: true,
process_options: { process_rdf: true, extract_metadata: false, generate_missing_labels: false},
process_options: { process_rdf: true, extract_metadata: false, index_all_data: true, generate_missing_labels: false},
acronym: "BROSEARCHTEST",
name: "BRO Search Test",
file_path: "./test/data/ontology_files/BRO_v3.2.owl",
Expand All @@ -427,7 +428,7 @@ def test_search_data

count, acronyms, mccl = LinkedData::SampleData::Ontology.create_ontologies_and_submissions({
process_submission: true,
process_options: { process_rdf: true, extract_metadata: false, generate_missing_labels: false},
process_options: { process_rdf: true, extract_metadata: false, index_all_data: true, generate_missing_labels: false},
acronym: "MCCLSEARCHTEST",
name: "MCCL Search Test",
file_path: "./test/data/ontology_files/CellLine_OWL_BioPortal_v1.0.owl",
Expand All @@ -439,8 +440,6 @@ def test_search_data
subs = LinkedData::Models::OntologySubmission.all
count = []
subs.each do |s|
s.bring_remaining
s.index_all_data(Logger.new($stdout))
count << Goo.sparql_query_client.query("SELECT (COUNT( DISTINCT ?id) as ?c) FROM <#{s.id}> WHERE {?id ?p ?v}")
.first[:c]
.to_i
Expand Down

0 comments on commit 36aec71

Please sign in to comment.