source 'https://rubygems.org'
gem 'rails', '~> 5.0.0'
-gem 'arvados', '>= 0.1.20150511150219'
+gem 'arvados', git: 'https://github.com/curoverse/arvados.git', glob: 'sdk/ruby/arvados.gemspec'
gem 'activerecord-nulldb-adapter', git: 'https://github.com/curoverse/nulldb'
gem 'multi_json'
+GIT
+ remote: https://github.com/curoverse/arvados.git
+ revision: dd9f2403f43bcb93da5908ddde57d8c0491bb4c2
+ glob: sdk/ruby/arvados.gemspec
+ specs:
+ arvados (1.4.1.20191019025325)
+ activesupport (>= 3)
+ andand (~> 1.3, >= 1.3.3)
+ arvados-google-api-client (>= 0.7, < 0.8.9)
+ faraday (< 0.16)
+ i18n (~> 0)
+ json (>= 1.7.7, < 3)
+ jwt (>= 0.1.5, < 2)
+
GIT
remote: https://github.com/curoverse/nulldb
revision: d8e0073b665acdd2537c5eb15178a60f02f4b413
andand (1.3.3)
angularjs-rails (1.3.15)
arel (7.1.4)
- arvados (1.3.3.20190320201707)
- activesupport (>= 3)
- andand (~> 1.3, >= 1.3.3)
- arvados-google-api-client (>= 0.7, < 0.8.9)
- i18n (~> 0)
- json (>= 1.7.7, < 3)
- jwt (>= 0.1.5, < 2)
- arvados-google-api-client (0.8.7.2)
+ arvados-google-api-client (0.8.7.3)
activesupport (>= 3.2, < 5.1)
addressable (~> 2.3)
autoparse (~> 0.3)
flamegraph (0.9.5)
globalid (0.4.2)
activesupport (>= 4.2.0)
- googleauth (0.9.0)
+ googleauth (0.10.0)
faraday (~> 0.12)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
- signet (~> 0.7)
+ signet (~> 0.12)
headless (1.0.2)
highline (2.0.2)
httpclient (2.8.3)
actionpack (>= 4)
less (~> 2.6.0)
sprockets (>= 2)
- libv8 (3.16.14.19-x86_64-linux)
+ libv8 (3.16.14.19)
lograge (0.10.0)
actionpack (>= 4)
activesupport (>= 4)
metaclass (~> 0.0.1)
morrisjs-rails (0.5.1.2)
railties (> 3.1, < 6)
- multi_json (1.13.1)
+ multi_json (1.14.1)
multipart-post (2.1.1)
net-scp (2.0.0)
net-ssh (>= 2.6.5, < 6.0.0)
selenium-webdriver (3.141.0)
childprocess (~> 0.5)
rubyzip (~> 1.2, >= 1.2.2)
- signet (0.11.0)
+ signet (0.12.0)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (>= 1.5, < 3.0)
activerecord-nulldb-adapter!
andand
angularjs-rails (~> 1.3.8)
- arvados (>= 0.1.20150511150219)
+ arvados!
bootstrap-sass (~> 3.4.1)
bootstrap-tab-history-rails
bootstrap-x-editable-rails
sessionKey: key,
loadFunc: function(filters) {
// Apply additional type dependant filters
- filters = filters.concat(obj_type.filters)
- var tsquery = to_tsquery(q)
- if (tsquery) {
- filters.push(['any', '@@', tsquery])
- }
+ filters = filters.concat(obj_type.filters).concat(ilike_filters(q))
return vnode.state.sessionDB.request(session, obj_type.api_path, {
data: {
filters: JSON.stringify(filters),
function updateFilterableQueryNow($target) {
var newquery = $target.data('filterable-query-new');
var params = $target.data('infinite-content-params-filterable') || {};
- var tsquery = to_tsquery(newquery);
- if (tsquery == null) {
- params.filters = [];
- } else {
- params.filters = [['any', '@@', tsquery]];
- }
+ params.filters = ilike_filters(newquery);
$(".modal-dialog-preview-pane").html("");
$target.data('infinite-content-params-filterable', params);
$target.data('filterable-query', newquery);
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+// ilike_filters() converts a user-entered search query to a list of
+// filters using the newly added (as of Arvados 1.5) trigram indexes. It returns
+// [] (empty list) if it can't come up with anything valid (e.g., q consists
+// entirely of punctuation).
+//
+// Examples:
+//
+// "foo" => [["any", "ilike", "%foo%"]]
+// "foo.bar" => [["any", "ilike", "%foo.bar%"]] // "." is a word char in ilike queries
+// "foo/b-r" => [["any", "ilike", "%foo/b-r%"]] // "/" and "-", too
+// "foo_bar" => [["any", "ilike", "%foo\\_bar%"] // "_" should be escaped so it can be used as a literal
+// "foo bar" => [["any", "ilike", "%foo%"], ["any", "ilike", "%bar%"]]
+// "foo|bar" => [["any", "ilike", "%foo%"], ["any", "ilike", "%bar%"]]
+// " oo|bar" => [["any", "ilike", "%oo%"], ["any", "ilike", "%bar%"]]
+// "" => []
+// " " => []
+// null => []
+window.ilike_filters = function(q) {
+ q = (q || '').replace(/[^-\w\.\/]+/g, ' ').trim().replace(/_/g, '\\_')
+ if (q == '')
+ return []
+ return q.split(" ").map(function(term) {
+ return ["any", "ilike", "%"+term+"%"]
+ })
+}
\ No newline at end of file
+++ /dev/null
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-// to_tsquery() converts a user-entered search query to a useful
-// operand for the Arvados API "@@" filter. It returns null if it
-// can't come up with anything valid (e.g., q consists entirely of
-// punctuation).
-//
-// Examples:
-//
-// "foo" => "foo:*"
-// "foo_bar" => "foo:*&bar:*"
-// "foo.bar" => "foo.bar:*" // "." is a word char in FT queries
-// "foo/b-r" => "foo/b-r:*" // "/" and "-", too
-// "foo|bar" => "foo:*&bar:*"
-// " oo|ba " => "oo:*&ba:*"
-// "__ " => null
-// "" => null
-// null => null
-window.to_tsquery = function(q) {
- q = (q || '').replace(/[^-\w\.\/]+/g, ' ').trim().replace(/ /g, ':*&')
- if (q == '')
- return null
- return q + ':*'
-}
defer svcListCacheMtx.Unlock()
for _, ent := range svcListCache {
wg.Add(1)
+ clear := ent.clear
go func() {
- ent.clear <- struct{}{}
+ clear <- struct{}{}
wg.Done()
}()
}
loop do
ii = (lo + hi) / 2
range = @ranges[ii]
- if range.include?(target) && (target < range.end || ii == hi)
+ if range.include?(target) && (target < range.end || ii == hi-1)
return ii
elsif ii == lo
raise RangeError.new("%i not in segment" % target)
end
end
+ def test_range_edge_cases
+ [
+ ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:file1\n",
+ ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:file1 0:0:file2\n",
+ ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:file1 0:0:file1\n",
+ ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:file1 0:0:file2 0:0:file1\n",
+ ". 0cc175b9c0f1b6a831c399e269772661+1 0:0:file1 1:0:file2 1:0:file1\n",
+ ].each do |txt|
+ coll = Arv::Collection.new(txt)
+ coll.normalize
+ assert_match(/ 0:0:file1/, coll.manifest_text)
+ end
+ [
+ ". d41d8cd98f00b204e9800998ecf8427e+0 1:0:file1\n",
+ ". 0cc175b9c0f1b6a831c399e269772661+1 0:0:file1 2:0:file2 1:0:file1\n",
+ ].each do |txt|
+ assert_raises(RangeError) do
+ coll = Arv::Collection.new(txt)
+ coll.normalize
+ end
+ end
+ end
+
def test_non_manifest_construction_error
["word", ". abc def", ". #{random_block} 0:", ". / !"].each do |m_text|
assert_raises(ArgumentError,
gem 'byebug'
end
-# We need this dependency because of crunchv1
-gem 'arvados-cli'
-
gem 'pg', '~> 1.0'
gem 'multi_json'
gem 'themes_for_rails', git: 'https://github.com/curoverse/themes_for_rails'
-gem 'arvados', '>= 1.3.1.20190301212059'
+# We need arvados-cli because of crunchv1. Note: bundler can't handle
+# two gems with the same "git" url but different "glob" values, hence
+# the use of a wildcard here instead of literal paths
+# (sdk/cli/arvados-cli.gem and sdk/ruby/arvados.gem).
+gem 'arvados-cli', git: 'https://github.com/curoverse/arvados.git', glob: 'sdk/*/*.gemspec'
+gem 'arvados', git: 'https://github.com/curoverse/arvados.git', glob: 'sdk/*/*.gemspec'
gem 'httpclient'
gem 'sshkey'
+GIT
+ remote: https://github.com/curoverse/arvados.git
+ revision: dd9f2403f43bcb93da5908ddde57d8c0491bb4c2
+ glob: sdk/*/*.gemspec
+ specs:
+ arvados (1.4.1.20191019025325)
+ activesupport (>= 3)
+ andand (~> 1.3, >= 1.3.3)
+ arvados-google-api-client (>= 0.7, < 0.8.9)
+ faraday (< 0.16)
+ i18n (~> 0)
+ json (>= 1.7.7, < 3)
+ jwt (>= 0.1.5, < 2)
+ arvados-cli (1.4.1.20191017145711)
+ activesupport (>= 3.2.13, < 5.1)
+ andand (~> 1.3, >= 1.3.3)
+ arvados (>= 1.4.1.20190320201707)
+ arvados-google-api-client (~> 0.6, >= 0.6.3, < 0.8.9)
+ curb (~> 0.8)
+ faraday (< 0.16)
+ json (>= 1.7.7, < 3)
+ oj (~> 3.0)
+ optimist (~> 3.0)
+
GIT
remote: https://github.com/curoverse/themes_for_rails
revision: ddf6e592b3b6493ea0c2de7b5d3faa120ed35be0
activemodel (>= 3.0.0)
activesupport (>= 3.0.0)
rack (>= 1.1.0)
- addressable (2.6.0)
- public_suffix (>= 2.0.2, < 4.0)
+ addressable (2.7.0)
+ public_suffix (>= 2.0.2, < 5.0)
andand (1.3.3)
arel (7.1.4)
- arvados (1.3.1.20190320201707)
- activesupport (>= 3)
- andand (~> 1.3, >= 1.3.3)
- arvados-google-api-client (>= 0.7, < 0.8.9)
- i18n (~> 0)
- json (>= 1.7.7, < 3)
- jwt (>= 0.1.5, < 2)
- arvados-cli (1.3.1.20190320201707)
- activesupport (>= 3.2.13, < 5.1)
- andand (~> 1.3, >= 1.3.3)
- arvados (~> 1.3.0, >= 1.3.0)
- arvados-google-api-client (~> 0.6, >= 0.6.3, < 0.8.9)
- curb (~> 0.8)
- json (>= 1.7.7, < 3)
- oj (~> 3.0)
- optimist (~> 3.0)
- arvados-google-api-client (0.8.7.2)
+ arvados-google-api-client (0.8.7.3)
activesupport (>= 3.2, < 5.1)
addressable (~> 2.3)
autoparse (~> 0.3)
net-ssh-gateway (>= 1.1.0)
concurrent-ruby (1.1.5)
crass (1.0.4)
- curb (0.9.9)
+ curb (0.9.10)
database_cleaner (1.7.0)
erubis (2.7.0)
eventmachine (1.2.7)
ffi (1.9.25)
globalid (0.4.2)
activesupport (>= 4.2.0)
- googleauth (0.8.0)
+ googleauth (0.10.0)
faraday (~> 0.12)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
- signet (~> 0.7)
+ signet (~> 0.12)
hashie (3.6.0)
highline (2.0.1)
httpclient (2.8.3)
minitest (5.10.3)
mocha (1.8.0)
metaclass (~> 0.0.1)
- multi_json (1.13.1)
+ multi_json (1.14.1)
multi_xml (0.6.0)
- multipart-post (2.0.0)
+ multipart-post (2.1.1)
net-scp (2.0.0)
net-ssh (>= 2.6.5, < 6.0.0)
net-sftp (2.1.2)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
- oj (3.7.11)
+ oj (3.9.2)
omniauth (1.4.3)
hashie (>= 1.2, < 4)
rack (>= 1.6.2, < 3)
oauth2 (~> 1.1)
omniauth (~> 1.2)
optimist (3.0.0)
- os (1.0.0)
+ os (1.0.1)
passenger (6.0.2)
rack
rake (>= 0.8.1)
pg (1.1.4)
power_assert (1.1.4)
- public_suffix (3.0.3)
+ public_suffix (4.0.1)
rack (2.0.7)
rack-test (0.6.3)
rack (>= 1.0)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
- signet (0.11.0)
+ signet (0.12.0)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (>= 1.5, < 3.0)
DEPENDENCIES
acts_as_api
andand
- arvados (>= 1.3.1.20190301212059)
- arvados-cli
+ arvados!
+ arvados-cli!
byebug
database_cleaner
factory_bot_rails
# SPDX-License-Identifier: AGPL-3.0
module CommitsHelper
+ extend CurrentApiClient
class GitError < RequestError
def http_status
include KindAndEtag
include CommonApiTemplate
extend DbCurrentTime
+ extend CurrentApiClient
SERVER_START_TIME = db_current_time
require 'current_api_client'
-include CurrentApiClient
+# This is needed instead of just including CurrentApiClient so that its
+# methods don't get imported as Object's class methods; this is a problem because
+# the methods would be imported only on test environment. See #15716 for more info.
+class CurrentApiClientHelper
+ extend CurrentApiClient
+end
def has_symbols? x
if x.is_a? Hash
Node, PipelineInstance, PipelineTemplate,
Repository, Specimen, Trait, User, VirtualMachine,
Workflow].each do |klass|
- act_as_system_user do
+ CurrentApiClientHelper.act_as_system_user do
klass.all.each do |c|
check_for_serialized_symbols c
end
Node, PipelineInstance, PipelineTemplate,
Repository, Specimen, Trait, User, VirtualMachine,
Workflow].each do |klass|
- act_as_system_user do
+ CurrentApiClientHelper.act_as_system_user do
klass.all.each do |c|
stringify_serialized_symbols c
end