cwl-v1.2
cwl-v1.2 copied to clipboard
#main vs main, inconsistencies
https://www.commonwl.org/v1.2/Workflow.html#Packed_documents reminds us that
If the reference to the packed document does not include a fragment identifier, the runner must choose the top-level process object as the entry point. If there is no top-level process object (as in the case of
$graph
) then the runner must choose the process object with an id of#main
. If there is no#main
object, the runner must return an error.
Though https://www.commonwl.org/v1.2/Workflow.html#Generic_execution_process does state that
- If there are multiple process objects (due to
$graph
) and which process object to start with is not specified in the input object (via acwl:tool
entry) or by any other means (like a URL fragment) then choose the process with theid
of "#main" or "main".
That is a bit inconsistent, we should probably mention the plain main
in https://www.commonwl.org/v1.2/Workflow.html#Packed_documents (and ensure there is a conformance test using that)
After a bit of experimenting on how load_document_by_uri()
from cwl-utils resolves the ids in the objects it returns, I've noticed that:
-
main
becomes 'file:///path/to/file.cwl#main' -
#main
also becomes 'file:///path/to/file.cwl#main' -
##main
becomes 'file:///path/to/file.cwl##main' -
###main
becomes 'file:///path/to/file.cwl###main' and so on - This applies for any id starting with
#
So it seems that #main
and main
are indeed equivalent, so agreed that sticking with main
makes more sense.
In the code I'm writing to find a process object inside a document, I now strip the (first) #
from the start of an object id before comparing, and it seems to work with all conformance tests.
That is a bit inconsistent, we should probably mention the plain main in https://www.commonwl.org/v1.2/Workflow.html#Packed_documents (and ensure there is a conformance test using that)
There are already conformance tests using main
, e.g. the wf_scatter_twoparam_flat_crossproduct_valuefrom
test uses tool: "tests/scatter-valuefrom-wf3.cwl#main"
where the workflow in tests/scatter-valuefrom-wf3.cwl
has - id: main
.
@mr-c I wish to work on this. Please can you assign it to me?
Hello @Fienne . Go ahead and work on this issue. Just saying that you are working on it is enough, we hardly use the assignment feature.
Please let us know if you have any questions.
We have a weekly voice/video chat on Mondays at 15:00 UTC https://www.commonwl.org/community/#when