Currently, Dockstore has a "Launch with Terra" button that is available on WDL workflows.
This button is not available for Dockstore WDL tools. It should be, so that Dockstore WDL tools are also available in Terra.
Dockstore and TRS treat tools and workflows separately. This stems in part from CWL, which Dockstore supported first, and which has a formal distinction between CommandLineTool and Workflow.
To fit WDL into this model, Dockstore allows users to register WDL tools. Since WDL does not formally distinguish the two, Dockstore imposes the restriction for tools that the WDL have only one task.
In the TRS API, which Dockstore implements, to distinguish the IDs of workflows and tools, workflow ids are preceded with #workflow/ (which becomes %23workflow%2f when URL-encoded).
When invoking Launch with Terra from Dockstore, Dockstore passes the ID of the workflow to Terra, e.g., https://app.terra.bio/#import-tool/dockstore/github.com/HumanCellAtlas/skylab/Optimus:terra-optimus
Terra then reads the URL, extracting the portion after import-tool/dockstore, then calls back to Dockstore to fetch the WDL contents. It uses the TRS API to fetch WDL content from Dockstore. It always prepends #workflow/ to the ID that Dockstore passes to Terra, assuming it's a workflow, and making it impossible to pass a tool. See https://github.com/DataBiosphere/terra-ui/blob/5c325fdcd362083cd01df0f39af7c357943f889d/src/libs/ajax.js#L115
The solution should not break the existing integration, as this change will require changes on both the Terra and Dockstore sides, and we will not be able to do a simultaneous release.
- Add a new path, e.g., change dockstore to to dockstore-tool: https://app.terra.bio/#import-tool/dockstore-tool/github.com/HumanCellAtlas/skylab/Optimus:terra-optimus
- Add a "query parameter" at the end, e.g., https://app.terra.bio/#import-tool/dockstore/github.com/HumanCellAtlas/skylab/Optimus:terra-optimus?type=tool. Not sure if this actually is a query parameter, since the query parameter should go before the # fragment character in an URL, but in any case the ? is not a valid Git tag character, so Terra would know the "?" is not part of the version and be able to handle it. In this case, if the type is not specified, Terra would continue to default to assuming it's a workflow.