[ARVADOS-WORKBENCH2] created: 2.1.0-126-g84dd7a88

Git user git at public.arvados.org
Fri Dec 4 21:46:46 UTC 2020


        at  84dd7a887671e3fb01afcdb832942c22dc48cf82 (commit)


commit 84dd7a887671e3fb01afcdb832942c22dc48cf82
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Fri Dec 4 18:41:11 2020 -0300

    17152: Adjusts cypress integration tests.
    
    * Changes arvados' config disabling the collection idle versioning feature.
    * Fixes one test that required versioning when updating via API calls.
    
    The rest of the versioning tests continue to work because of the updates made
    on workbench2.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/cypress/integration/collection-panel.spec.js b/cypress/integration/collection-panel.spec.js
index 980c5505..bbf32f84 100644
--- a/cypress/integration/collection-panel.spec.js
+++ b/cypress/integration/collection-panel.spec.js
@@ -269,6 +269,7 @@ describe('Collection panel tests', function() {
         cy.createCollection(adminUser.token, {
             name: colName,
             owner_uuid: activeUser.user.uuid,
+            preserve_version: true,
             manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"})
         .as('originalVersion').then(function() {
             // Change the file name to create a new version.
diff --git a/tools/arvados_config.yml b/tools/arvados_config.yml
index b533156d..d93ec7ae 100644
--- a/tools/arvados_config.yml
+++ b/tools/arvados_config.yml
@@ -8,7 +8,7 @@ Clusters:
       Insecure: true
     Collections:
       CollectionVersioning: true
-      PreserveVersionIfIdle: 0s
+      PreserveVersionIfIdle: -1s
       BlobSigningKey: zfhgfenhffzltr9dixws36j1yhksjoll2grmku38mi7yxd66h5j4q9w4jzanezacp8s6q0ro3hxakfye02152hncy6zml2ed0uc
       TrustAllContent: true
       ForwardSlashNameSubstitution: /

commit a118de08b4032775405baf0024eff41056bcb66c
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Thu Dec 3 18:58:22 2020 -0300

    17152: Adjusts the collection service methods to preserve versions.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/services/collection-service/collection-service.ts b/src/services/collection-service/collection-service.ts
index 0aa0aa84..73e0a667 100644
--- a/src/services/collection-service/collection-service.ts
+++ b/src/services/collection-service/collection-service.ts
@@ -27,6 +27,18 @@ export class CollectionService extends TrashableResourceService<CollectionResour
         ]);
     }
 
+    create(data?: Partial<CollectionResource>) {
+        return super.create({ ...data, preserveVersion: true });
+    }
+
+    async update(uuid: string, data: Partial<CollectionResource>) {
+        // First set head version to be preserved
+        const collection = await super.update(uuid, { preserveVersion: true });
+        if (data === { preserveVersion: true }) { return collection; }
+        // Then make changes
+        return await super.update(uuid, data);
+    }
+
     async files(uuid: string) {
         const request = await this.webdavClient.propfind(`c=${uuid}`);
         if (request.responseXML != null) {
@@ -36,6 +48,9 @@ export class CollectionService extends TrashableResourceService<CollectionResour
     }
 
     async deleteFiles(collectionUuid: string, filePaths: string[]) {
+        if (collectionUuid !== "" && filePaths.length > 0) {
+            await this.update(collectionUuid, { preserveVersion: true });
+        }
         for (const path of filePaths) {
             const splittedPath = path.split('/');
             if (collectionUuid) {
@@ -47,13 +62,19 @@ export class CollectionService extends TrashableResourceService<CollectionResour
     }
 
     async uploadFiles(collectionUuid: string, files: File[], onProgress?: UploadProgress) {
+        if (collectionUuid !== "" && files.length > 0) {
+            await this.update(collectionUuid, { preserveVersion: true });
+        }
         // files have to be uploaded sequentially
         for (let idx = 0; idx < files.length; idx++) {
             await this.uploadFile(collectionUuid, files[idx], idx, onProgress);
         }
     }
 
-    moveFile(collectionUuid: string, oldPath: string, newPath: string) {
+    async moveFile(collectionUuid: string, oldPath: string, newPath: string) {
+        if (collectionUuid !== "") {
+            await this.update(collectionUuid, { preserveVersion: true });
+        }
         return this.webdavClient.move(
             `c=${collectionUuid}${oldPath}`,
             `c=${collectionUuid}${encodeURI(newPath)}`

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list