[ARVADOS] created: 1.2.0-86-gf0af3b122

Git user git at public.curoverse.com
Wed Sep 19 16:44:41 EDT 2018


        at  f0af3b1225e5617b0c2635ff8466d6d8b89e50ca (commit)


commit f0af3b1225e5617b0c2635ff8466d6d8b89e50ca
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Wed Sep 19 16:43:47 2018 -0400

    14236: Don't omit empty manifest_text in update requests.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/sdk/go/arvados/collection.go b/sdk/go/arvados/collection.go
index 79be2f3f1..5b6130060 100644
--- a/sdk/go/arvados/collection.go
+++ b/sdk/go/arvados/collection.go
@@ -18,7 +18,7 @@ type Collection struct {
 	UUID                      string     `json:"uuid,omitempty"`
 	OwnerUUID                 string     `json:"owner_uuid,omitempty"`
 	TrashAt                   *time.Time `json:"trash_at,omitempty"`
-	ManifestText              string     `json:"manifest_text,omitempty"`
+	ManifestText              string     `json:"manifest_text"`
 	UnsignedManifestText      string     `json:"unsigned_manifest_text,omitempty"`
 	Name                      string     `json:"name,omitempty"`
 	CreatedAt                 *time.Time `json:"created_at,omitempty"`

commit 092275584e84c39f03ddff1b32271d97274bc09e
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Wed Sep 19 16:22:58 2018 -0400

    14236: Test deleting the last file in a collection.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/services/keep-web/handler_test.go b/services/keep-web/handler_test.go
index bced67ed2..34a2fbd5d 100644
--- a/services/keep-web/handler_test.go
+++ b/services/keep-web/handler_test.go
@@ -736,6 +736,43 @@ func (s *IntegrationSuite) TestDirectoryListing(c *check.C) {
 	}
 }
 
+func (s *IntegrationSuite) TestDeleteLastFile(c *check.C) {
+	arv := arvados.NewClientFromEnv()
+	var newCollection arvados.Collection
+	err := arv.RequestAndDecode(&newCollection, "POST", "arvados/v1/collections", arv.UpdateBody(&arvados.Collection{
+		OwnerUUID:    arvadostest.ActiveUserUUID,
+		ManifestText: ". acbd18db4cc2f85cedef654fccc4a4d8+3 0:3:foo.txt 0:3:bar.txt\n",
+		Name:         "keep-web test collection",
+	}), map[string]bool{"ensure_unique_name": true})
+	c.Assert(err, check.IsNil)
+	defer arv.RequestAndDecode(&newCollection, "DELETE", "arvados/v1/collections/"+newCollection.UUID, nil, nil)
+
+	var updated arvados.Collection
+	for _, fnm := range []string{"foo.txt", "bar.txt"} {
+		s.testServer.Config.AttachmentOnlyHost = "example.com"
+		u, _ := url.Parse("http://example.com/c=" + newCollection.UUID + "/" + fnm)
+		req := &http.Request{
+			Method:     "DELETE",
+			Host:       u.Host,
+			URL:        u,
+			RequestURI: u.RequestURI(),
+			Header: http.Header{
+				"Authorization": {"Bearer " + arvadostest.ActiveToken},
+			},
+		}
+		resp := httptest.NewRecorder()
+		s.testServer.Handler.ServeHTTP(resp, req)
+		c.Check(resp.Code, check.Equals, http.StatusNoContent)
+
+		updated = arvados.Collection{}
+		err = arv.RequestAndDecode(&updated, "GET", "arvados/v1/collections/"+newCollection.UUID, nil, nil)
+		c.Check(err, check.IsNil)
+		c.Check(updated.ManifestText, check.Not(check.Matches), ".*"+fnm+".*")
+		c.Logf("updated manifest_text %q", updated.ManifestText)
+	}
+	c.Check(updated.ManifestText, check.Equals, "")
+}
+
 func (s *IntegrationSuite) TestHealthCheckPing(c *check.C) {
 	s.testServer.Config.ManagementToken = arvadostest.ManagementToken
 	authHeader := http.Header{

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list