[ARVADOS] created: 2.1.0-658-g60b22bcd4
Git user
git at public.arvados.org
Fri Apr 23 20:16:11 UTC 2021
at 60b22bcd41053a641c8157367a1589287f706674 (commit)
commit 60b22bcd41053a641c8157367a1589287f706674
Author: Peter Amstutz <peter.amstutz at curii.com>
Date: Fri Apr 23 16:07:02 2021 -0400
17521: Use normpath to clean up the path segment.
Removes leading ./, trailing slashes, redundant '.' and blank path
segments, and other stuff that potentially confuses the path matching.
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>
diff --git a/sdk/cwl/arvados_cwl/fsaccess.py b/sdk/cwl/arvados_cwl/fsaccess.py
index 16ec2b2f9..1e339d5bb 100644
--- a/sdk/cwl/arvados_cwl/fsaccess.py
+++ b/sdk/cwl/arvados_cwl/fsaccess.py
@@ -100,7 +100,8 @@ class CollectionFsAccess(cwltool.stdfsaccess.StdFsAccess):
if p.startswith("keep:") and (arvados.util.keep_locator_pattern.match(p[5:]) or
arvados.util.collection_uuid_pattern.match(p[5:])):
locator = p[5:]
- return (self.collection_cache.get(locator), urllib.parse.unquote(sp[1]) if len(sp) == 2 else None)
+ rest = os.path.normpath(urllib.parse.unquote(sp[1])) if len(sp) == 2 else None
+ return (self.collection_cache.get(locator), rest)
else:
return (None, path)
commit a7f0aa8f6370153dc0142d35c3369641bfac6e42
Author: Peter Amstutz <peter.amstutz at curii.com>
Date: Fri Apr 23 15:58:42 2021 -0400
17521: Add tests, refs #10380 and refs #17521
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>
diff --git a/sdk/cwl/tests/10380-trailing-slash-dir.cwl b/sdk/cwl/tests/10380-trailing-slash-dir.cwl
new file mode 100644
index 000000000..5eec729f6
--- /dev/null
+++ b/sdk/cwl/tests/10380-trailing-slash-dir.cwl
@@ -0,0 +1,15 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+cwlVersion: v1.2
+class: CommandLineTool
+inputs: []
+outputs:
+ stuff:
+ type: Directory
+ outputBinding:
+ glob: './foo/'
+requirements:
+ ShellCommandRequirement: {}
+arguments: [{shellQuote: false, valueFrom: "mkdir -p foo && touch baz.txt && touch foo/bar.txt"}]
diff --git a/sdk/cwl/tests/17521-dot-slash-glob.cwl b/sdk/cwl/tests/17521-dot-slash-glob.cwl
new file mode 100644
index 000000000..1e182c126
--- /dev/null
+++ b/sdk/cwl/tests/17521-dot-slash-glob.cwl
@@ -0,0 +1,15 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+cwlVersion: v1.2
+class: CommandLineTool
+inputs: []
+outputs:
+ stuff:
+ type: File
+ outputBinding:
+ glob: './foo/*.txt'
+requirements:
+ ShellCommandRequirement: {}
+arguments: [{shellQuote: false, valueFrom: "mkdir -p foo && touch baz.txt && touch foo/bar.txt"}]
diff --git a/sdk/cwl/tests/arvados-tests.yml b/sdk/cwl/tests/arvados-tests.yml
index 48255f857..199ced9f4 100644
--- a/sdk/cwl/tests/arvados-tests.yml
+++ b/sdk/cwl/tests/arvados-tests.yml
@@ -360,3 +360,13 @@
output: {}
tool: wf/trick_defaults2.cwl
doc: "Test issue 17462 - secondary file objects on file defaults are not resolved"
+
+- job: null
+ output: {}
+ tool: 17521-dot-slash-glob.cwl
+ doc: "Test issue 17521 - bug with leading './' capturing files in subdirectories"
+
+- job: null
+ output: {}
+ tool: 10380-trailing-slash-dir.cwl
+ doc: "Test issue 10380 - bug with trailing slash when capturing an output directory"
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list