Skip to content

Commit 2ef32fa

Browse files
authored
Merge branch 'master' into map_syntax
2 parents 7c02afb + 9afc62b commit 2ef32fa

10 files changed

+92
-12
lines changed

CommandLineTool-standalone.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
saladVersion: v1.1
12
- $import: Process.yml
2-
- $import: CommandLineTool.yml
3+
- $import: CommandLineTool.yml

CommandLineTool.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
saladVersion: v1.1
12
$base: "https://w3id.org/cwl/cwl#"
23

34
$namespaces:
@@ -56,8 +57,8 @@ $graph:
5657
* When defining record types with `CommandInputRecordSchema`, fields of
5758
type `File` may now include `format`, `loadContents`,
5859
`secondaryFiles` and `streamable`.
59-
* `CommandInputRecordSchema`, `CommandOutputRecordSchema`,
60-
`CommandInputEnumSchema and `CommandInputArraySchema` now have an optional
60+
* `CommandInputRecordSchema`, `CommandOutputRecordSchema`,
61+
`CommandInputEnumSchema and `CommandInputArraySchema` now have an optional
6162
`doc` field.
6263
* `inputBinding` has been added as an optional field for
6364
`CommandInputRecordSchema` (was previously in CWL `draft-3` but
@@ -100,6 +101,10 @@ $graph:
100101
* [Added](#LoadListingRequirement) `LoadListingRequirement`
101102
and [loadListing](#LoadContents) to control whether and how
102103
`Directory` listings should be loaded for use in expressions.
104+
* The position field of the [CommandLineBinding](#CommandLineBinding) can
105+
now be calculated from a CWL Expression.
106+
* The exit code of a CommandLineTool invocation is now
107+
available to expressions in `outputEval` as `runtime.exitCode`
103108
* [Better explain](#map) the `map<…>` notation that has existed since v1.0.
104109
* Fixed schema error where the `type` field inside the `inputs` and
105110
`outputs` field was incorrectly listed as optional.
@@ -200,8 +205,14 @@ $graph:
200205
201206
fields:
202207
- name: position
203-
type: int?
204-
doc: "The sorting key. Default position is 0."
208+
type: [ int, Expression, string, "null" ]
209+
doc: |
210+
The sorting key. Default position is 0. If the inputBinding is
211+
associated with an input parameter, then the value of `self` in the
212+
expression will be the value of the input parameter. Input parameter
213+
defaults (as specified by the `InputParameter.default` field) must be
214+
applied before evaluating the expression. Expressions must return a
215+
single value of type int or a null.
205216
- name: prefix
206217
type: string?
207218
doc: "Command line prefix to add before the value."
@@ -319,13 +330,15 @@ $graph:
319330
- string
320331
- Expression
321332
doc: |
322-
Evaluate an expression to generate the output value. If `glob` was
323-
specified, the value of `self` must be an array containing file objects
324-
that were matched. If no files were matched, `self` must be a zero
325-
length array; if a single file was matched, the value of `self` is an
326-
array of a single element. Additionally, if `loadContents` is `true`,
327-
the File objects must include up to the first 64 KiB of file contents
328-
in the `contents` field.
333+
Evaluate an expression to generate the output value. If
334+
`glob` was specified, the value of `self` must be an array
335+
containing file objects that were matched. If no files were
336+
matched, `self` must be a zero length array; if a single file
337+
was matched, the value of `self` is an array of a single
338+
element. Additionally, if `loadContents` is `true`, the File
339+
objects must include up to the first 64 KiB of file contents
340+
in the `contents` field. The exit code of the process is
341+
available in the expression as `runtime.exitCode`.
329342
330343
- name: CommandLineBindable
331344
type: record

CommonWorkflowLanguage.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
saladVersion: v1.1
12
$base: "https://w3id.org/cwl/cwl#"
23

34
$namespaces:

Process.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
saladVersion: v1.1
12
$base: "https://w3id.org/cwl/cwl#"
23

34
$namespaces:

Workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
saladVersion: v1.1
12
$base: "https://w3id.org/cwl/cwl#"
23

34
$namespaces:

conformance_tests.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3184,3 +3184,19 @@
31843184
subdirectory objects when input parameter loadListing is
31853185
'deep_listing'
31863186
tags: [ command_line_tool ]
3187+
3188+
- job: tests/echo-position-expr-job.yml
3189+
tool: tests/echo-position-expr.cwl
3190+
label: inputBinding_position_expr
3191+
output:
3192+
out: "🕺 1 singular sensation!\n"
3193+
doc: TBD
3194+
tags: [ command_line_tool, required ]
3195+
3196+
- job: tests/empty.json
3197+
tool: tests/exitcode.cwl
3198+
label: outputEval_exitCode
3199+
output:
3200+
code: 7
3201+
doc: Can access exit code in outputEval
3202+
tags: [ command_line_tool, required ]

invocation.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ providing the fields `successCodes`, `temporaryFailCodes`, and
146146
`permanentFailCodes`. An implementation may choose to default unspecified
147147
non-zero exit codes to either `temporaryFailure` or `permanentFailure`.
148148

149+
The exit code of the process is available to expressions in
150+
`outputEval` as `runtime.exitCode`.
151+
149152
## Output binding
150153

151154
If the output directory contains a file named "cwl.output.json", that file

tests/echo-position-expr-job.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
one: 1
2+
two: 2

tests/echo-position-expr.cwl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env cwl-runner
2+
3+
class: CommandLineTool
4+
cwlVersion: v1.1.0-dev1
5+
requirements:
6+
InlineJavascriptRequirement: {}
7+
inputs:
8+
one:
9+
type: int
10+
inputBinding:
11+
position: $(self)
12+
two:
13+
type: int
14+
inputBinding:
15+
valueFrom: sensation!
16+
position: ${return self+1;}
17+
arguments:
18+
- position: ${return 2;}
19+
valueFrom: singular
20+
- position: ${return null;}
21+
valueFrom: 🕺
22+
outputs:
23+
out:
24+
type: string
25+
outputBinding:
26+
glob: out.txt
27+
loadContents: true
28+
outputEval: $(self[0].contents)
29+
baseCommand: echo
30+
stdout: out.txt

tests/exitcode.cwl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
cwlVersion: v1.1.0-dev1
2+
class: CommandLineTool
3+
requirements:
4+
ShellCommandRequirement: {}
5+
inputs: []
6+
outputs:
7+
code:
8+
type: int
9+
outputBinding:
10+
outputEval: $(runtime.exitCode)
11+
successCodes: [7]
12+
arguments: ["exit", "7"]

0 commit comments

Comments
 (0)