[ARVADOS] updated: 1.3.0-2690-g7835d752b

Git user git at public.arvados.org
Wed Jun 17 23:28:00 UTC 2020


Summary of changes:
 services/api/lib/current_api_client.rb     | 18 ++++++++++--------
 services/api/test/fixtures/collections.yml | 14 --------------
 2 files changed, 10 insertions(+), 22 deletions(-)

       via  7835d752ba1d320153f32e4de9b96c20b20ed8c0 (commit)
      from  0c73874964316de30579968ed0ad8c17be065333 (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 7835d752ba1d320153f32e4de9b96c20b20ed8c0
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Wed Jun 17 19:27:18 2020 -0400

    16007: Hopefully fix empty-collection db seed confusion
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/services/api/lib/current_api_client.rb b/services/api/lib/current_api_client.rb
index 1abcffa43..347b72856 100644
--- a/services/api/lib/current_api_client.rb
+++ b/services/api/lib/current_api_client.rb
@@ -197,15 +197,17 @@ module CurrentApiClient
     $empty_collection = check_cache $empty_collection do
       act_as_system_user do
         ActiveRecord::Base.transaction do
-          c = Collection.
+          Collection.
             where(portable_data_hash: empty_collection_pdh).
-            first_or_create!(manifest_text: '', owner_uuid: anonymous_user.uuid)
-          Link.where(tail_uuid: anonymous_group.uuid,
-                     head_uuid: c.uuid,
-                     link_class: 'permission',
-                     name: 'can_read').
-            first_or_create!
-          c
+            first_or_create(manifest_text: '', owner_uuid: system_user.uuid) do |c|
+            c.save!
+            Link.where(tail_uuid: anonymous_group.uuid,
+                       head_uuid: c.uuid,
+                       link_class: 'permission',
+                       name: 'can_read').
+                  first_or_create!
+            c
+          end
         end
       end
     end
diff --git a/services/api/test/fixtures/collections.yml b/services/api/test/fixtures/collections.yml
index 1581039bb..64cb48c50 100644
--- a/services/api/test/fixtures/collections.yml
+++ b/services/api/test/fixtures/collections.yml
@@ -196,20 +196,6 @@ unlinked_docker_image:
   manifest_text: ". fca529cfe035e3e384563ee55eadbb2f+67108863 0:67108863:bcd02158b8fe2c81034ffc8a10c36460b77db7bc5e7b448c4e5b684f9d95a678.tar\n"
   name: unlinked_docker_image
 
-empty:
-  uuid: zzzzz-4zz18-gs9ooj1h9sd5mde
-  current_version_uuid: zzzzz-4zz18-gs9ooj1h9sd5mde
-  # Empty collection owned by anonymous_group is added with rake db:seed.
-  portable_data_hash: d41d8cd98f00b204e9800998ecf8427e+0
-  owner_uuid: zzzzz-tpzed-000000000000000
-  created_at: 2014-06-11T17:22:54Z
-  modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
-  modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f
-  modified_at: 2014-06-11T17:22:54Z
-  updated_at: 2014-06-11T17:22:54Z
-  manifest_text: ""
-  name: empty_collection
-
 foo_collection_in_aproject:
   uuid: zzzzz-4zz18-fy296fx3hot09f7
   current_version_uuid: zzzzz-4zz18-fy296fx3hot09f7

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list