19688: Make sure CommandLineTool gets wrapped properly
authorPeter Amstutz <peter.amstutz@curii.com>
Fri, 11 Nov 2022 14:53:18 +0000 (09:53 -0500)
committerPeter Amstutz <peter.amstutz@curii.com>
Fri, 11 Nov 2022 14:53:32 +0000 (09:53 -0500)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

sdk/cwl/arvados_cwl/arvworkflow.py

index c0b479c37f8991d073bc093a23c67cfc52369378..7f9c3c34837cd35caac8582be1bac0be94218045 100644 (file)
@@ -61,10 +61,26 @@ def make_wrapper_workflow(arvRunner, main, packed, project_uuid, name):
         "run": "keep:%s/workflow.json#main" % pdh
     }
 
+    newinputs = []
+    for i in main["inputs"]:
+        inp = {}
+        # Make sure to only copy known fields that are meaningful at
+        # the workflow level. In practice this ensures that if we're
+        # wrapping a CommandLineTool we don't grab inputBinding.
+        # Right now also excludes extension fields, which is fine,
+        # Arvados doesn't currently look for any extension fields on
+        # input parameters.
+        for f in ("type", "label", "secondaryFiles", "streamable",
+                  "doc", "id", "format", "loadContents",
+                  "loadListing", "default"):
+            if f in i:
+                inp[f] = i[f]
+        newinputs.append(inp)
+
     wrapper = {
         "class": "Workflow",
         "id": "#main",
-        "inputs": main["inputs"],
+        "inputs": newinputs,
         "outputs": [],
         "steps": [step]
     }