common-workflow-language / common-workflow-language/cwl-v1.2
Clarify priority between when and step input valueFrom
- Dominant language
- Common Workflow Language
- Stars
- 45
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
When a step input is transformed with `valueFrom` and is used in `when` expression, from the specification and conformance tests it's not clear should the `when` expression use the original or the transformed value.
Minimal example:
```
class: Workflow
cwlVersion: v1.2
inputs:
- id: input
type: string?
- id: custom_input
type: boolean
outputs:
- id: output
outputSource:
- step1/output
type: string?
steps:
- id: step1
in:
- id: input
source: input
- id: custom_input
source: custom_input
valueFrom: "$(!self)"
out:
- id: output
run:
class: CommandLineTool
cwlVersion: v1.2
baseCommand:
- echo
inputs:
- id: input
type: string?
inputBinding:
position: 0
outputs:
- id: output
type: string?
outputBinding:
outputEval: "$(inputs.input)"
when: "$(inputs.custom_input)"
requirements:
- class: InlineJavascriptRequirement
- class: StepInputExpressionRequirement
```
When running with
```
custom_input: true
```
The transformation converts the value to `false` and the step is skipped if the transformed value is used, but it is not skipped if the original value is used. Right now `cwltool` uses the transformed value, just wanted to make sure this is expected and that it gets documented. The example can be used as a conformance test.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by comparing the specification language with the conformance tests for step input valueFrom and when expressions, then inspect cwltool's current behavior. Use the minimal workflow in the issue as the test case; done means the original-versus-transformed value priority is decided, explicitly documented, and covered by a conformance test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation, testing
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100