[ARVADOS] updated: af0ece600054c97aae9661ed06731af47873a7ff

Git user git at public.curoverse.com
Mon Sep 5 11:15:24 EDT 2016


Summary of changes:
 apps/workbench/test/integration/websockets_test.rb | 2 +-
 apps/workbench/test/test_helper.rb                 | 2 +-
 services/api/app/models/arvados_model.rb           | 1 +
 services/api/app/models/container.rb               | 3 ++-
 services/api/app/models/log.rb                     | 3 ++-
 services/api/test/unit/permission_test.rb          | 2 +-
 6 files changed, 8 insertions(+), 5 deletions(-)

       via  af0ece600054c97aae9661ed06731af47873a7ff (commit)
       via  16e1811a346d7ed20999a6f6420c7a57937dbd09 (commit)
      from  dcf7f7d492830f11b58e691d127849c6781c8244 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit af0ece600054c97aae9661ed06731af47873a7ff
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Sep 5 11:15:10 2016 -0400

    9799: Remove duplicate uuids from db queries.

diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb
index 8ae3e43..7b8f12b 100644
--- a/services/api/app/models/arvados_model.rb
+++ b/services/api/app/models/arvados_model.rb
@@ -199,6 +199,7 @@ class ArvadosModel < ActiveRecord::Base
     # authorized users themselves) is an object's owner_uuid, that
     # object is readable.
     owner_uuids = user_uuids + users_list.flat_map { |u| u.groups_i_can(:read) }
+    owner_uuids.uniq!
 
     sql_conds = []
     sql_table = kwargs.fetch(:table_name, table_name)
diff --git a/services/api/app/models/container.rb b/services/api/app/models/container.rb
index 5ab1145..1e645e4 100644
--- a/services/api/app/models/container.rb
+++ b/services/api/app/models/container.rb
@@ -82,6 +82,7 @@ class Container < ArvadosModel
     end
     user_uuids = users_list.map { |u| u.uuid }
     uuid_list = user_uuids + users_list.flat_map { |u| u.groups_i_can(:read) }
+    uuid_list.uniq!
     permitted = "(SELECT head_uuid FROM links WHERE link_class='permission' AND tail_uuid IN (:uuids))"
     joins(:container_requests).
       where("container_requests.uuid IN #{permitted} OR "+
diff --git a/services/api/app/models/log.rb b/services/api/app/models/log.rb
index ee75ec3..f8d624a 100644
--- a/services/api/app/models/log.rb
+++ b/services/api/app/models/log.rb
@@ -59,6 +59,7 @@ class Log < ArvadosModel
     end
     user_uuids = users_list.map { |u| u.uuid }
     uuid_list = user_uuids + users_list.flat_map { |u| u.groups_i_can(:read) }
+    uuid_list.uniq!
     permitted = "(SELECT head_uuid FROM links WHERE link_class='permission' AND tail_uuid IN (:uuids))"
     joins("LEFT JOIN container_requests ON container_requests.container_uuid=logs.object_uuid").
       where("logs.object_uuid IN #{permitted} OR "+

commit 16e1811a346d7ed20999a6f6420c7a57937dbd09
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Sep 5 10:45:39 2016 -0400

    9799: Fix method def style

diff --git a/apps/workbench/test/integration/websockets_test.rb b/apps/workbench/test/integration/websockets_test.rb
index 54712d3..38917f0 100644
--- a/apps/workbench/test/integration/websockets_test.rb
+++ b/apps/workbench/test/integration/websockets_test.rb
@@ -6,7 +6,7 @@ class WebsocketTest < ActionDispatch::IntegrationTest
     @dispatch_client = ArvadosApiClient.new
   end
 
-  def dispatch_log body
+  def dispatch_log(body)
     use_token :dispatch1 do
       @dispatch_client.api('logs', '', log: body)
     end
diff --git a/apps/workbench/test/test_helper.rb b/apps/workbench/test/test_helper.rb
index 73bfda6..b8aa82e 100644
--- a/apps/workbench/test/test_helper.rb
+++ b/apps/workbench/test/test_helper.rb
@@ -31,7 +31,7 @@ class ActiveSupport::TestCase
   # Note: You'll currently still have to declare fixtures explicitly
   # in integration tests -- they do not yet inherit this setting
   fixtures :all
-  def use_token token_name
+  def use_token(token_name)
     user_was = Thread.current[:user]
     token_was = Thread.current[:arvados_api_token]
     auth = api_fixture('api_client_authorizations')[token_name.to_s]
diff --git a/services/api/app/models/container.rb b/services/api/app/models/container.rb
index f73c8b7..5ab1145 100644
--- a/services/api/app/models/container.rb
+++ b/services/api/app/models/container.rb
@@ -76,7 +76,7 @@ class Container < ArvadosModel
     end
   end
 
-  def self.readable_by *users_list
+  def self.readable_by(*users_list)
     if users_list.select { |u| u.is_admin }.any?
       return self
     end
diff --git a/services/api/app/models/log.rb b/services/api/app/models/log.rb
index 5b3f544..ee75ec3 100644
--- a/services/api/app/models/log.rb
+++ b/services/api/app/models/log.rb
@@ -53,7 +53,7 @@ class Log < ArvadosModel
     self
   end
 
-  def self.readable_by *users_list
+  def self.readable_by(*users_list)
     if users_list.select { |u| u.is_admin }.any?
       return self
     end
diff --git a/services/api/test/unit/permission_test.rb b/services/api/test/unit/permission_test.rb
index 5bc296a..79fc1f2 100644
--- a/services/api/test/unit/permission_test.rb
+++ b/services/api/test/unit/permission_test.rb
@@ -354,7 +354,7 @@ class PermissionTest < ActiveSupport::TestCase
     end
   end
 
-  def container_logs container, user
+  def container_logs(container, user)
     Log.readable_by(users(user)).
       where(object_uuid: containers(container).uuid, event_type: "test")
   end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list