Support for inline tools #52
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #49
In the case of inline tools, the value of the
runattribute for a step is not a string that points to a tool definition, but the tool definition itself. This breaks the old code. The fix is based on "normalizing" the dictionary output byget_workflowso that it has separate entries for the tools, as it does when tools come from separate documents: for each steps,s.runis replaced with the tool's id and the tool is stored in the dictionary (indexed by its fragment part).In CWL 1.0 this works out of the box, because IDs are consistent with each other: an inline tool has an id like
'file:///.../packed.cwl#main/rev/bb642334-0fc4-4f98-93e4-846da100367e'and its parameters have ids like'file:///.../packed.cwl#main/rev/bb642334-0fc4-4f98-93e4-846da100367e/rev_in'.In CWL 1.1 and 1.2, inline tool ids are like
'_:d7f3025e-b6de-487b-8727-98f1649dd739'but parameter ids are like'file:///home/simleo/git/runcrate/tests/data/revsort-inline-cwl1.2-run-1/workflow/packed.cwl#main/rev/run/rev_in', i.e., like in CWL 1.0 but with the fixed string"rev"replacing the UUID. If the tool id is left unchanged, the code fails to match parameter values from activities with formal parameters. To make it work, I've added a line that replaces the tool id with the step id +"/run", so it's consistent with the parameter ids.