[ARVADOS] updated: 1.2.0-317-g2820094af

Git user git at public.curoverse.com
Thu Nov 8 11:45:36 EST 2018


Summary of changes:
 sdk/python/arvados/collection.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

  discards  5e51e1a9cb0857cbedc34cf19f9765a7c4d245dc (commit)
  discards  31f59ce1da0c0ff8af39bbef3194b015443dfb7d (commit)
  discards  cfbea207ce0cd12ac1e91806bd33c59d4e39da8f (commit)
  discards  86a75e9e88f1642d9e8bdd3d4fbebcf3d8d2795c (commit)
       via  2820094afcf17920c751d693fa6c20bd8c58baaf (commit)
       via  d039d2aefaeee7dd373e5c8a788b67fcefb2b216 (commit)
       via  272355719fde430380f760f3c0d2e57b1929afec (commit)
       via  132e1313e78201c905aa692af82dd73a71030614 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (5e51e1a9cb0857cbedc34cf19f9765a7c4d245dc)
            \
             N -- N -- N (2820094afcf17920c751d693fa6c20bd8c58baaf)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

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 2820094afcf17920c751d693fa6c20bd8c58baaf
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Tue Nov 6 13:57:14 2018 -0500

    14345: Handle "MOVE foo/ bar/" requests.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/sdk/go/arvados/fs_collection_test.go b/sdk/go/arvados/fs_collection_test.go
index fee7feaef..a6d4ab1e5 100644
--- a/sdk/go/arvados/fs_collection_test.go
+++ b/sdk/go/arvados/fs_collection_test.go
@@ -692,6 +692,25 @@ func (s *CollectionFSSuite) TestRenameError(c *check.C) {
 	c.Check(data, check.DeepEquals, []byte{1, 2, 3, 4, 5})
 }
 
+func (s *CollectionFSSuite) TestRenameDirectory(c *check.C) {
+	fs, err := (&Collection{}).FileSystem(s.client, s.kc)
+	c.Assert(err, check.IsNil)
+	err = fs.Mkdir("foo", 0755)
+	c.Assert(err, check.IsNil)
+	err = fs.Mkdir("bar", 0755)
+	c.Assert(err, check.IsNil)
+	err = fs.Rename("bar", "baz")
+	c.Check(err, check.IsNil)
+	err = fs.Rename("foo", "baz")
+	c.Check(err, check.NotNil)
+	err = fs.Rename("foo", "baz/")
+	c.Check(err, check.IsNil)
+	err = fs.Rename("baz/foo", ".")
+	c.Check(err, check.Equals, ErrInvalidArgument)
+	err = fs.Rename("baz/foo/", ".")
+	c.Check(err, check.Equals, ErrInvalidArgument)
+}
+
 func (s *CollectionFSSuite) TestRename(c *check.C) {
 	fs, err := (&Collection{}).FileSystem(s.client, s.kc)
 	c.Assert(err, check.IsNil)
diff --git a/services/keep-web/cadaver_test.go b/services/keep-web/cadaver_test.go
index b89890956..44d0b0ffe 100644
--- a/services/keep-web/cadaver_test.go
+++ b/services/keep-web/cadaver_test.go
@@ -172,6 +172,16 @@ func (s *IntegrationSuite) testCadaver(c *check.C, password string, pathFunc fun
 		},
 		{
 			path:  writePath,
+			cmd:   "move newdir1/ newdir1x/\n",
+			match: `(?ms).*Moving .* succeeded.*`,
+		},
+		{
+			path:  writePath,
+			cmd:   "move newdir1x newdir1\n",
+			match: `(?ms).*Moving .* succeeded.*`,
+		},
+		{
+			path:  writePath,
 			cmd:   "move newdir0/testfile newdir1/\n",
 			match: `(?ms).*Moving .* succeeded.*`,
 		},
diff --git a/services/keep-web/webdav.go b/services/keep-web/webdav.go
index 5b23c9c5f..f9b753869 100644
--- a/services/keep-web/webdav.go
+++ b/services/keep-web/webdav.go
@@ -100,6 +100,11 @@ func (fs *webdavFS) Rename(ctx context.Context, oldName, newName string) error {
 	if !fs.writing {
 		return errReadOnly
 	}
+	if strings.HasSuffix(oldName, "/") {
+		// WebDAV "MOVE foo/ bar/" means rename foo to bar.
+		oldName = oldName[:len(oldName)-1]
+		newName = strings.TrimSuffix(newName, "/")
+	}
 	fs.makeparents(newName)
 	return fs.collfs.Rename(oldName, newName)
 }

commit d039d2aefaeee7dd373e5c8a788b67fcefb2b216
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Tue Nov 6 09:54:10 2018 -0500

    14345: Accept "." placeholder: create parent dir, but no fake file.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/sdk/python/arvados/collection.py b/sdk/python/arvados/collection.py
index f4502b7e6..6b33ea303 100644
--- a/sdk/python/arvados/collection.py
+++ b/sdk/python/arvados/collection.py
@@ -1717,12 +1717,17 @@ class Collection(RichCollectionBase):
                     pos = int(file_segment.group(1))
                     size = int(file_segment.group(2))
                     name = self._unescape_manifest_path(file_segment.group(3))
-                    filepath = os.path.join(stream_name, name)
-                    afile = self.find_or_create(filepath, FILE)
-                    if isinstance(afile, ArvadosFile):
-                        afile.add_segment(blocks, pos, size)
+                    if name.split('/')[-1] == '.':
+                        # placeholder for persisting an empty directory, not a real file
+                        if len(name) > 2:
+                            self.find_or_create(os.path.join(stream_name, name[:-2]), COLLECTION)
                     else:
-                        raise errors.SyntaxError("File %s conflicts with stream of the same name.", filepath)
+                        filepath = os.path.join(stream_name, name)
+                        afile = self.find_or_create(filepath, FILE)
+                        if isinstance(afile, ArvadosFile):
+                            afile.add_segment(blocks, pos, size)
+                        else:
+                            raise errors.SyntaxError("File %s conflicts with stream of the same name.", filepath)
                 else:
                     # error!
                     raise errors.SyntaxError("Invalid manifest format, expected file segment but did not match format: '%s'" % tok)

commit 272355719fde430380f760f3c0d2e57b1929afec
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Thu Oct 18 09:41:37 2018 -0400

    14345: Accept lock/unlock requests as no-ops.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/services/keep-web/cadaver_test.go b/services/keep-web/cadaver_test.go
index 0e2f17c35..b89890956 100644
--- a/services/keep-web/cadaver_test.go
+++ b/services/keep-web/cadaver_test.go
@@ -147,6 +147,16 @@ func (s *IntegrationSuite) testCadaver(c *check.C, password string, pathFunc fun
 		},
 		{
 			path:  writePath,
+			cmd:   "lock newdir0/testfile\n",
+			match: `(?ms).*Locking .* succeeded.*`,
+		},
+		{
+			path:  writePath,
+			cmd:   "unlock newdir0/testfile\nasdf\n",
+			match: `(?ms).*Unlocking .* succeeded.*`,
+		},
+		{
+			path:  writePath,
 			cmd:   "ls\n",
 			match: `(?ms).*newdir0.* 0 +` + matchToday + ` \d+:\d+\n.*`,
 		},
@@ -243,6 +253,11 @@ func (s *IntegrationSuite) testCadaver(c *check.C, password string, pathFunc fun
 			cmd:   "delete foo\n",
 			match: `(?ms).*Deleting .* failed:.*405 Method Not Allowed.*`,
 		},
+		{
+			path:  pdhPath,
+			cmd:   "lock foo\n",
+			match: `(?ms).*Locking .* failed:.*405 Method Not Allowed.*`,
+		},
 	} {
 		c.Logf("%s %+v", "http://"+s.testServer.Addr, trial)
 		if skip != nil && skip(trial.path) {
diff --git a/services/keep-web/handler.go b/services/keep-web/handler.go
index 95948e325..6aeb7b9c4 100644
--- a/services/keep-web/handler.go
+++ b/services/keep-web/handler.go
@@ -143,20 +143,24 @@ var (
 	writeMethod = map[string]bool{
 		"COPY":   true,
 		"DELETE": true,
+		"LOCK":   true,
 		"MKCOL":  true,
 		"MOVE":   true,
 		"PUT":    true,
 		"RMCOL":  true,
+		"UNLOCK": true,
 	}
 	webdavMethod = map[string]bool{
 		"COPY":     true,
 		"DELETE":   true,
+		"LOCK":     true,
 		"MKCOL":    true,
 		"MOVE":     true,
 		"OPTIONS":  true,
 		"PROPFIND": true,
 		"PUT":      true,
 		"RMCOL":    true,
+		"UNLOCK":   true,
 	}
 	browserMethod = map[string]bool{
 		"GET":  true,

commit 132e1313e78201c905aa692af82dd73a71030614
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Mon Nov 5 16:46:50 2018 -0500

    14345: Unescape all \ooo in names in manifests, not just \040.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/sdk/python/arvados/collection.py b/sdk/python/arvados/collection.py
index 55797bdfe..f4502b7e6 100644
--- a/sdk/python/arvados/collection.py
+++ b/sdk/python/arvados/collection.py
@@ -1667,6 +1667,9 @@ class Collection(RichCollectionBase):
     _block_re = re.compile(r'[0-9a-f]{32}\+(\d+)(\+\S+)*')
     _segment_re = re.compile(r'(\d+):(\d+):(\S+)')
 
+    def _unescape_manifest_path(self, path):
+        return re.sub('\\\\([0-3][0-7][0-7])', lambda m: chr(int(m.group(1), 8)), path)
+
     @synchronized
     def _import_manifest(self, manifest_text):
         """Import a manifest into a `Collection`.
@@ -1691,7 +1694,7 @@ class Collection(RichCollectionBase):
 
             if state == STREAM_NAME:
                 # starting a new stream
-                stream_name = tok.replace('\\040', ' ')
+                stream_name = self._unescape_manifest_path(tok)
                 blocks = []
                 segments = []
                 streamoffset = 0
@@ -1713,7 +1716,7 @@ class Collection(RichCollectionBase):
                 if file_segment:
                     pos = int(file_segment.group(1))
                     size = int(file_segment.group(2))
-                    name = file_segment.group(3).replace('\\040', ' ')
+                    name = self._unescape_manifest_path(file_segment.group(3))
                     filepath = os.path.join(stream_name, name)
                     afile = self.find_or_create(filepath, FILE)
                     if isinstance(afile, ArvadosFile):

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list