[ARVADOS] created: 1.3.0-341-g31ba3b53a

Git user git at public.curoverse.com
Tue Feb 19 13:46:43 EST 2019


        at  31ba3b53a2bad9452517347ad4432b9c1eeb1071 (commit)


commit 31ba3b53a2bad9452517347ad4432b9c1eeb1071
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Tue Feb 19 15:45:39 2019 -0300

    14860: Fixes PermissionDenied bug by assigning the signed manifest text.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/services/api/app/models/collection.rb b/services/api/app/models/collection.rb
index 33cc686d4..11c138eae 100644
--- a/services/api/app/models/collection.rb
+++ b/services/api/app/models/collection.rb
@@ -262,6 +262,7 @@ class Collection < ArvadosModel
       sync_past_versions if syncable_updates.any?
       if snapshot
         snapshot.attributes = self.syncable_updates
+        snapshot.attributes['manifest_text'] = snapshot.signed_manifest_text
         snapshot.save
       end
     end

commit 8be73cb77f5f32d99f8448a66601e802714225da
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Tue Feb 19 15:24:46 2019 -0300

    14860: Exposes the bug with a new test.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/services/api/test/functional/arvados/v1/collections_controller_test.rb b/services/api/test/functional/arvados/v1/collections_controller_test.rb
index 26b8290e6..997d89d5c 100644
--- a/services/api/test/functional/arvados/v1/collections_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/collections_controller_test.rb
@@ -1279,7 +1279,6 @@ EOS
         version: 42,
         current_version_uuid: collections(:collection_owned_by_active).uuid,
         manifest_text: manifest_text,
-        # portable_data_hash: "d30fe8ae534397864cb96c544f4cf102+47"
       }
     }
     assert_response :success
@@ -1287,4 +1286,28 @@ EOS
     assert_equal 1, resp['version']
     assert_equal resp['uuid'], resp['current_version_uuid']
   end
+
+  test "update collection with versioning enabled" do
+    Rails.configuration.collection_versioning = true
+    Rails.configuration.preserve_version_if_idle = 1 # 1 second
+
+    col = collections(:collection_owned_by_active)
+    assert_equal 2, col.version
+    assert col.modified_at < Time.now - 1.second
+
+    token = api_client_authorizations(:active).v2token
+    signed = Blob.sign_locator(
+      'acbd18db4cc2f85cedef654fccc4a4d8+3',
+      key: Rails.configuration.blob_signing_key,
+      api_token: token)
+    authorize_with_token token
+    put :update, {
+          id: col.uuid,
+          collection: {
+            manifest_text: ". #{signed} 0:3:foo.txt\n",
+          },
+        }
+    assert_response :success
+    assert_equal 3, json_response['version']
+  end
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list