19385: fast-parser fixups
authorPeter Amstutz <peter.amstutz@curii.com>
Thu, 26 Jan 2023 16:06:23 +0000 (11:06 -0500)
committerPeter Amstutz <peter.amstutz@curii.com>
Thu, 26 Jan 2023 16:06:23 +0000 (11:06 -0500)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

sdk/cwl/arvados_cwl/arvworkflow.py

index e850ebcb2944920647399f26d5756e57a1e562cf..c38458833acf0669c3de8ab1f3045339141e5f4c 100644 (file)
@@ -188,7 +188,12 @@ def update_refs(d, baseuri, urlexpander, merged_map, jobmapper, set_block_style,
             else:
                 update_refs(s, baseuri, urlexpander, merged_map, jobmapper, set_block_style, runtimeContext, prefix, replacePrefix)
     elif isinstance(d, MutableMapping):
-        if "id" in d:
+        for field in ("id", "name"):
+            if isinstance(d.get(field), str) and d[field].startswith("_:"):
+                # blank node reference, was added in automatically, can get rid of it.
+                del d[field]
+
+        if "id" in d and not d:
             baseuri = urlexpander(d["id"], baseuri, scoped_id=True)
         elif "name" in d and isinstance(d["name"], str):
             baseuri = urlexpander(d["name"], baseuri, scoped_id=True)
@@ -353,6 +358,8 @@ def new_upload_workflow(arvRunner, tool, job_order, project_uuid,
 
     col.save_new(name=toolname, owner_uuid=arvRunner.project_uuid, ensure_unique_name=True, properties=properties)
 
+    logger.info("Workflow uploaded to %s", col.manifest_locator())
+
     adjustDirObjs(job_order, trim_listing)
     adjustFileObjs(job_order, trim_anonymous_location)
     adjustDirObjs(job_order, trim_anonymous_location)