[arvados] created: 2.7.0-5105-g88e18b7b98
git repository hosting
git at public.arvados.org
Fri Oct 27 20:15:51 UTC 2023
at 88e18b7b9826b05e8485a6a99593ecda850969d7 (commit)
commit 88e18b7b9826b05e8485a6a99593ecda850969d7
Author: Tom Clegg <tom at curii.com>
Date: Tue Oct 24 11:42:38 2023 -0400
20846: Update kwargs usage for ruby 3.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/services/api/app/models/container.rb b/services/api/app/models/container.rb
index ca43fde5a9..ee338b81ff 100644
--- a/services/api/app/models/container.rb
+++ b/services/api/app/models/container.rb
@@ -319,7 +319,7 @@ class Container < ArvadosModel
resolved_runtime_constraints.delete('cuda')
].uniq
end
- reusable_runtime_constraints = hash_product(runtime_constraint_variations)
+ reusable_runtime_constraints = hash_product(**runtime_constraint_variations)
.map { |v| resolved_runtime_constraints.merge(v) }
candidates = candidates.where_serialized(:runtime_constraints, reusable_runtime_constraints, md5: true, multivalue: true)
diff --git a/services/api/test/test_helper.rb b/services/api/test/test_helper.rb
index 08696a9983..e907367446 100644
--- a/services/api/test/test_helper.rb
+++ b/services/api/test/test_helper.rb
@@ -179,21 +179,21 @@ class ActionController::TestCase
end
[:get, :post, :put, :patch, :delete].each do |method|
- define_method method do |action, *args|
+ define_method method do |action, **args|
check_counter action
# After Rails 5.0 upgrade, some params don't get properly serialized.
# One case are filters: [['attr', 'op', 'val']] become [['attr'], ['op'], ['val']]
# if not passed upstream as a JSON string.
- if args[0].is_a?(Hash) && args[0][:params].is_a?(Hash)
- args[0][:params].each do |key, _|
+ if args[:params].is_a?(Hash)
+ args[:params].each do |key, _|
next if key == :exclude_script_versions # Job Reuse tests
# Keys could be: :filters, :where, etc
- if [Array, Hash].include?(args[0][:params][key].class)
- args[0][:params][key] = SafeJSON.dump(args[0][:params][key])
+ if [Array, Hash].include?(args[:params][key].class)
+ args[:params][key] = SafeJSON.dump(args[:params][key])
end
end
end
- super action, *args
+ super action, **args
end
end
commit 7435f58364e90b8bf75db21602592ff0e7559b48
Author: Tom Clegg <tom at curii.com>
Date: Mon Oct 23 17:39:41 2023 -0400
20846: Remove deprecated Random::DEFAULT usage.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 3e4502545b..e7441df4be 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -588,7 +588,7 @@ class ApplicationController < ActionController::Base
def set_current_request_id
response.headers['X-Request-Id'] =
Thread.current[:request_id] =
- "req-" + Random::DEFAULT.rand(2**128).to_s(36)[0..19]
+ "req-" + Random.new.rand(2**128).to_s(36)[0..19]
yield
Thread.current[:request_id] = nil
end
diff --git a/sdk/ruby/lib/arvados.rb b/sdk/ruby/lib/arvados.rb
index 7b99ba5788..73a0d0d2f7 100644
--- a/sdk/ruby/lib/arvados.rb
+++ b/sdk/ruby/lib/arvados.rb
@@ -21,7 +21,7 @@ class Arvados
attr_reader :request_id
def execute(*args)
- @request_id = "req-" + Random::DEFAULT.rand(2**128).to_s(36)[0..19]
+ @request_id = "req-" + Random.new.rand(2**128).to_s(36)[0..19]
if args.last.is_a? Hash
args.last[:headers] ||= {}
args.last[:headers]['X-Request-Id'] = @request_id
diff --git a/services/api/config/initializers/request_id_middleware.rb b/services/api/config/initializers/request_id_middleware.rb
index e2158801e7..cfb018ca97 100644
--- a/services/api/config/initializers/request_id_middleware.rb
+++ b/services/api/config/initializers/request_id_middleware.rb
@@ -14,7 +14,7 @@ module CustomRequestId
end
def internal_request_id
- "req-" + Random::DEFAULT.rand(2**128).to_s(36)[0..19]
+ "req-" + Random.new.rand(2**128).to_s(36)[0..19]
end
end
@@ -22,4 +22,4 @@ class ActionDispatch::RequestId
# Instead of using the default UUID-like format for X-Request-Id headers,
# use our own.
prepend CustomRequestId
-end
\ No newline at end of file
+end
commit 9f40073eab9f4368bfb215c27edf4fcf52ef80b8
Author: Tom Clegg <tom at curii.com>
Date: Mon Oct 23 17:38:29 2023 -0400
20846: Add explicit webrick dependency.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/services/api/Gemfile b/services/api/Gemfile
index 1a722d1374..9cc5f1b7bc 100644
--- a/services/api/Gemfile
+++ b/services/api/Gemfile
@@ -54,6 +54,8 @@ gem 'rails-observers'
gem 'rails-perftest'
gem 'rails-controller-testing'
+gem 'webrick'
+
gem 'mini_portile2', '~> 2.8', '>= 2.8.1'
# Install any plugin gems
diff --git a/services/api/Gemfile.lock b/services/api/Gemfile.lock
index bacc0952af..cfab90127c 100644
--- a/services/api/Gemfile.lock
+++ b/services/api/Gemfile.lock
@@ -273,6 +273,7 @@ GEM
timeout (0.4.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
+ webrick (1.8.1)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
@@ -313,6 +314,7 @@ DEPENDENCIES
sprockets-rails
test-unit
themes_for_rails!
+ webrick
BUNDLED WITH
2.4.19
commit 788884922ce53e8884ff55f0fb11cb967629b72f
Author: Tom Clegg <tom at curii.com>
Date: Mon Oct 23 17:30:47 2023 -0400
20846: Update ruby-prof, test-unit gems.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/services/api/Gemfile b/services/api/Gemfile
index cee70d6c34..1a722d1374 100644
--- a/services/api/Gemfile
+++ b/services/api/Gemfile
@@ -11,15 +11,11 @@ gem 'sprockets-rails'
group :test, :development do
gem 'factory_bot_rails'
-
- # As of now (2019-03-27) There's an open issue about incompatibilities with
- # newer versions of this gem: https://github.com/rails/rails-perftest/issues/38
- gem 'ruby-prof', '~> 0.15.0'
-
+ gem 'ruby-prof'
# Note: "require: false" here tells bunder not to automatically
# 'require' the packages during application startup. Installation is
# still mandatory.
- gem 'test-unit', '~> 3.0', require: false
+ gem 'test-unit', require: false
gem 'simplecov', require: false
gem 'simplecov-rcov', require: false
gem 'mocha', require: false
diff --git a/services/api/Gemfile.lock b/services/api/Gemfile.lock
index c21ac630f7..bacc0952af 100644
--- a/services/api/Gemfile.lock
+++ b/services/api/Gemfile.lock
@@ -245,7 +245,7 @@ GEM
actionpack (>= 5.2)
railties (>= 5.2)
retriable (1.4.1)
- ruby-prof (0.15.9)
+ ruby-prof (1.6.3)
ruby2_keywords (0.0.5)
signet (0.16.1)
addressable (~> 2.8)
@@ -307,11 +307,11 @@ DEPENDENCIES
rails-observers
rails-perftest
responders
- ruby-prof (~> 0.15.0)
+ ruby-prof
simplecov
simplecov-rcov
sprockets-rails
- test-unit (~> 3.0)
+ test-unit
themes_for_rails!
BUNDLED WITH
commit be13306c210c458dfd74f9a1aab8377534f8760f
Author: Tom Clegg <tom at curii.com>
Date: Mon Oct 23 17:22:46 2023 -0400
20846: Update associations syntax for ruby 3.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/services/api/app/models/authorized_key.rb b/services/api/app/models/authorized_key.rb
index cf4a1d55de..8aefa8db81 100644
--- a/services/api/app/models/authorized_key.rb
+++ b/services/api/app/models/authorized_key.rb
@@ -9,12 +9,11 @@ class AuthorizedKey < ArvadosModel
before_create :permission_to_set_authorized_user_uuid
before_update :permission_to_set_authorized_user_uuid
- belongs_to :authorized_user, {
- foreign_key: 'authorized_user_uuid',
- class_name: 'User',
- primary_key: 'uuid',
- optional: true,
- }
+ belongs_to :authorized_user,
+ foreign_key: 'authorized_user_uuid',
+ class_name: 'User',
+ primary_key: 'uuid',
+ optional: true
validate :public_key_must_be_unique
diff --git a/services/api/app/models/container.rb b/services/api/app/models/container.rb
index 97f8dfa279..ca43fde5a9 100644
--- a/services/api/app/models/container.rb
+++ b/services/api/app/models/container.rb
@@ -51,17 +51,15 @@ class Container < ArvadosModel
after_save :update_cr_logs
after_save :handle_completed
- has_many :container_requests, {
- class_name: 'ContainerRequest',
- foreign_key: 'container_uuid',
+ has_many :container_requests,
+ class_name: 'ContainerRequest',
+ foreign_key: 'container_uuid',
+ primary_key: 'uuid'
+ belongs_to :auth,
+ class_name: 'ApiClientAuthorization',
+ foreign_key: 'auth_uuid',
primary_key: 'uuid',
- }
- belongs_to :auth, {
- class_name: 'ApiClientAuthorization',
- foreign_key: 'auth_uuid',
- primary_key: 'uuid',
- optional: true,
- }
+ optional: true
api_accessible :user, extend: :common do |t|
t.add :command
diff --git a/services/api/app/models/container_request.rb b/services/api/app/models/container_request.rb
index 374859f2c1..0a8e33d05f 100644
--- a/services/api/app/models/container_request.rb
+++ b/services/api/app/models/container_request.rb
@@ -12,17 +12,15 @@ class ContainerRequest < ArvadosModel
include CommonApiTemplate
include WhitelistUpdate
- belongs_to :container, {
- foreign_key: 'container_uuid',
- primary_key: 'uuid',
- optional: true,
- }
- belongs_to :requesting_container, {
- class_name: 'Container',
- foreign_key: 'requesting_container_uuid',
- primary_key: 'uuid',
- optional: true,
- }
+ belongs_to :container,
+ foreign_key: 'container_uuid',
+ primary_key: 'uuid',
+ optional: true
+ belongs_to :requesting_container,
+ class_name: 'Container',
+ foreign_key: 'requesting_container_uuid',
+ primary_key: 'uuid',
+ optional: true
# Posgresql JSONB columns should NOT be declared as serialized, Rails 5
# already know how to properly treat them.
diff --git a/services/api/app/models/node.rb b/services/api/app/models/node.rb
index 3f0e0b5616..f384ba582b 100644
--- a/services/api/app/models/node.rb
+++ b/services/api/app/models/node.rb
@@ -20,11 +20,10 @@ class Node < ArvadosModel
# Only a controller can figure out whether or not the current API tokens
# have access to the associated Job. They're expected to set
# job_readable=true if the Job UUID can be included in the API response.
- belongs_to :job, {
- foreign_key: 'job_uuid',
- primary_key: 'uuid',
- optional: true,
- }
+ belongs_to :job,
+ foreign_key: 'job_uuid',
+ primary_key: 'uuid',
+ optional: true
attr_accessor :job_readable
UNUSED_NODE_IP = '127.40.4.0'
diff --git a/services/api/app/models/pipeline_instance.rb b/services/api/app/models/pipeline_instance.rb
index 23a08051ca..0b0af8b87d 100644
--- a/services/api/app/models/pipeline_instance.rb
+++ b/services/api/app/models/pipeline_instance.rb
@@ -9,11 +9,10 @@ class PipelineInstance < ArvadosModel
serialize :components, Hash
serialize :properties, Hash
serialize :components_summary, Hash
- belongs_to :pipeline_template, {
- foreign_key: 'pipeline_template_uuid',
- primary_key: 'uuid',
- optional: true,
- }
+ belongs_to :pipeline_template,
+ foreign_key: 'pipeline_template_uuid',
+ primary_key: 'uuid',
+ optional: true
before_validation :bootstrap_components
before_validation :update_state
commit 5b15a8ec15e1afb4eb5e61af59bf237dd346ff8e
Author: Tom Clegg <tom at curii.com>
Date: Mon Oct 23 17:22:32 2023 -0400
20846: Update simplecov for ruby 3 compatibility.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/services/api/Gemfile b/services/api/Gemfile
index dafb0d3801..cee70d6c34 100644
--- a/services/api/Gemfile
+++ b/services/api/Gemfile
@@ -20,7 +20,7 @@ group :test, :development do
# 'require' the packages during application startup. Installation is
# still mandatory.
gem 'test-unit', '~> 3.0', require: false
- gem 'simplecov', '~> 0.7.1', require: false
+ gem 'simplecov', require: false
gem 'simplecov-rcov', require: false
gem 'mocha', require: false
gem 'byebug'
diff --git a/services/api/Gemfile.lock b/services/api/Gemfile.lock
index d18fc8b07a..c21ac630f7 100644
--- a/services/api/Gemfile.lock
+++ b/services/api/Gemfile.lock
@@ -109,6 +109,7 @@ GEM
concurrent-ruby (1.2.2)
crass (1.0.6)
date (3.3.3)
+ docile (1.4.0)
erubi (1.12.0)
extlib (0.9.16)
factory_bot (6.2.1)
@@ -251,12 +252,14 @@ GEM
faraday (>= 0.17.5, < 3.0)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
- simplecov (0.7.1)
- multi_json (~> 1.0)
- simplecov-html (~> 0.7.1)
- simplecov-html (0.7.1)
+ simplecov (0.22.0)
+ docile (~> 1.1)
+ simplecov-html (~> 0.11)
+ simplecov_json_formatter (~> 0.1)
+ simplecov-html (0.12.3)
simplecov-rcov (0.3.1)
simplecov (>= 0.4.1)
+ simplecov_json_formatter (0.1.4)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
@@ -305,7 +308,7 @@ DEPENDENCIES
rails-perftest
responders
ruby-prof (~> 0.15.0)
- simplecov (~> 0.7.1)
+ simplecov
simplecov-rcov
sprockets-rails
test-unit (~> 3.0)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list