Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#main vs main, inconsistencies #140

Open
mr-c opened this issue Nov 25, 2021 · 3 comments
Open

#main vs main, inconsistencies #140

mr-c opened this issue Nov 25, 2021 · 3 comments

Comments

@mr-c
Copy link
Member

mr-c commented Nov 25, 2021

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

  1. If there are multiple process objects (due to $graph) and which process object to start with is not specified in the input object (via a cwl:tool entry) or by any other means (like a URL fragment) then choose the process with the id 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)

@nsoranzo
Copy link
Contributor

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 .

@Fienne
Copy link

Fienne commented Oct 9, 2022

@mr-c I wish to work on this. Please can you assign it to me?

@mr-c
Copy link
Member Author

mr-c commented Oct 9, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants