Skip to content

Commit 1e9d283

Browse files
authored
Merge pull request #37 from common-workflow-language/loadListing
Add LoadListingRequirement and parameter-level loadListing option.
2 parents e53d8aa + 635b6ea commit 1e9d283

File tree

5 files changed

+69
-23
lines changed

5 files changed

+69
-23
lines changed

CommandLineTool.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,21 @@ $graph:
8383
directories.
8484
* Clarify that unspecified details related to execution are left open to
8585
the platform.
86-
* Added `InputParameter.loadContents` field. Use of `loadContents` in
87-
`InputBinding` is deprecated; it is preserved for v1.0 backwards
86+
* Added `InputParameter.loadContents` field. Use of `loadContents` in
87+
`InputBinding` is deprecated; it is preserved for v1.0 backwards
8888
compatability and will be removed in CWL v2.0.
89-
* [Added](#TimeLimit) `TimeLimit` feature, allowing to set an upper limit on the
89+
* [Added](#TimeLimit) `TimeLimit` feature, allowing to set an upper limit on the
9090
execution time of a CommandLineTool or ExpressionTool.
91-
* [Added](#WorkReuse) `WorkReuse` feature, allowing to enable or disable the reuse
91+
* [Added](#WorkReuse) `WorkReuse` feature, allowing to enable or disable the reuse
9292
behavior for a particular tool or step for implementations that
9393
support reusing output from past work.
94-
* [Added](#NetworkAccess) `NetworkAccess` feature, allowing to indicate whether a
94+
* [Added](#NetworkAccess) `NetworkAccess` feature, allowing to indicate whether a
9595
process requires outgoing network access.
96-
* [Added](#InplaceUpdateRequirement) `InplaceUpdateRequirement` feature, allowing tools to directly
96+
* [Added](#InplaceUpdateRequirement) `InplaceUpdateRequirement` feature, allowing tools to directly
9797
update files with `writable: true` in `InitialWorkDirRequirement`.
98+
* [Added](#LoadListingRequirement) `LoadListingRequirement`
99+
and [loadListing](#LoadContents) to control whether and how
100+
`Directory` listings should be loaded for use in expressions.
98101
99102
See also the [CWL Workflow Description, v1.1.0-dev1 changelog](Workflow.html#Changelog).
100103
@@ -764,9 +767,9 @@ $graph:
764767
produces an empty command line).
765768
766769
Use of implicit ENTRYPOINT or CMD are discouraged due to reproducibility
767-
concerns of the implicit hidden execution point (For further discussion, see
768-
[https://doi.org/10.12688/f1000research.15140.1](https://doi.org/10.12688/f1000research.15140.1)). Portable
769-
CommandLineTool wrappers in which use of a container is optional must not rely on ENTRYPOINT or CMD.
770+
concerns of the implicit hidden execution point (For further discussion, see
771+
[https://doi.org/10.12688/f1000research.15140.1](https://doi.org/10.12688/f1000research.15140.1)). Portable
772+
CommandLineTool wrappers in which use of a container is optional must not rely on ENTRYPOINT or CMD.
770773
CommandLineTools which do rely on ENTRYPOINT or CMD must list `DockerRequirement` in the
771774
`requirements` section.
772775

Process.yml

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,21 +436,44 @@ $graph:
436436
doc: "The unique identifier for this object."
437437

438438

439+
- name: LoadListingEnum
440+
type: enum
441+
symbols: [no_listing, shallow_listing, deep_listing]
442+
doc:
443+
- |
444+
Specify the desired behavior for loading the `listing` field of
445+
a Directory object for use by expressions.
446+
- "no_listing: Do not load the directory listing."
447+
- "shallow_listing: Only load the top level listing, do not recurse into subdirectories."
448+
- "deep_listing: Load the directory listing and recursively load all subdirectories as well."
449+
450+
439451
- name: LoadContents
440452
type: record
441453
abstract: true
442454
fields:
443455
- name: loadContents
444-
type:
445-
- "null"
446-
- boolean
456+
type: boolean?
447457
jsonldPredicate: "cwl:loadContents"
448458
doc: |
449459
Only valid when `type: File` or is an array of `items: File`.
450460
451461
Read up to the first 64 KiB of text from the file and place it in the
452462
"contents" field of the file object for use by expressions.
463+
- name: loadListing
464+
type: LoadListingEnum?
465+
jsonldPredicate: "cwl:loadListing"
466+
doc: |
467+
Only valid when `type: Directory` or is an array of `items: Directory`.
468+
469+
Specify the desired behavior for loading the `listing` field of
470+
a Directory object for use by expressions.
453471
472+
The order of precedence for loadListing is:
473+
474+
1. `loadListing` on an individual parameter
475+
2. Inherited from `LoadListingRequirement`
476+
3. By default: `no_listing`
454477
455478
- name: FieldBase
456479
type: record
@@ -914,3 +937,20 @@ $graph:
914937
set to `false` and the expected secondary file does not exist.
915938
Default value for `required` field is `true` for secondary files on
916939
input and `false` for secondary files on output.
940+
941+
- name: LoadListingRequirement
942+
type: record
943+
extends: ProcessRequirement
944+
doc: |
945+
Specify the desired behavior for loading the `listing` field of
946+
a Directory object for use by expressions.
947+
fields:
948+
class:
949+
type: string
950+
doc: "Always 'LoadListingRequirement'"
951+
jsonldPredicate:
952+
"_id": "@type"
953+
"_type": "@vocab"
954+
loadListing:
955+
type: LoadListingEnum?
956+
jsonldPredicate: "cwl:loadListing"

Workflow.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,18 @@ $graph:
7676
* `secondaryFiles` can now be explicitly marked as `required` or not.
7777
* Add note that undefined details related to execution are left open to
7878
the platform.
79-
* [Added](#TimeLimit) `TimeLimit` feature, allowing to set an upper limit on the
79+
* [Added](#TimeLimit) `TimeLimit` feature, allowing to set an upper limit on the
8080
execution time of a CommandLineTool or ExpressionTool.
81-
* [Added](#WorkReuse) `WorkReuse` feature, allowing to enable or disable the reuse
81+
* [Added](#WorkReuse) `WorkReuse` feature, allowing to enable or disable the reuse
8282
behavior for a particular tool or step for implementations that
8383
support reusing output from past work.
84-
* [Added](#NetworkAccess) `NetworkAccess` feature, allowing to indicate whether a
84+
* [Added](#NetworkAccess) `NetworkAccess` feature, allowing to indicate whether a
8585
process requires outgoing network access.
86-
* [Added](#InplaceUpdateRequirement) `InplaceUpdateRequirement` feature, allowing tools to directly
86+
* [Added](#InplaceUpdateRequirement) `InplaceUpdateRequirement` feature, allowing tools to directly
8787
update files with `writable: true` in `InitialWorkDirRequirement`.
88+
* [Added](#LoadListingRequirement) `LoadListingRequirement`
89+
and [loadListing](#LoadContents) to control whether and how
90+
`Directory` listings should be loaded for use in expressions.
8891
8992
See also the [CWL Command Line Tool Description, v1.1.0-dev1 changelog](CommandLineTool.html#Changelog).
9093
@@ -202,7 +205,7 @@ $graph:
202205
docParent: "#Workflow"
203206
doc: |
204207
Describe an output parameter of a workflow. The parameter must be
205-
connected to one or more parameters defined in the workflow that
208+
connected to one or more parameters defined in the workflow that
206209
will provide the value of the output parameter. It is legal to
207210
connect a WorkflowInputParameter to a WorkflowOutputParameter.
208211
fields:

tests/dir5.cwl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ requirements:
55
- class: InitialWorkDirRequirement
66
listing: $(inputs.indir.listing)
77
inputs:
8-
indir: Directory
8+
indir:
9+
type: Directory
10+
loadListing: shallow_listing
911
outputs:
1012
outlist:
1113
type: File
@@ -14,4 +16,4 @@ outputs:
1416
arguments: ["find", "-L", ".", "!", "-path", "*.txt",
1517
{shellQuote: false, valueFrom: "|"},
1618
"sort"]
17-
stdout: output.txt
19+
stdout: output.txt

tests/inpdir_update_wf.cwl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@ steps:
3232
inputs:
3333
d1:
3434
type: Directory
35-
# inputBinding:
36-
# loadListing: shallow_listing
35+
loadListing: shallow_listing
3736
d2:
3837
type: Directory
39-
# inputBinding:
40-
# loadListing: shallow_listing
38+
loadListing: shallow_listing
4139
outputs:
4240
d1out: File[]
4341
d2out: File[]

0 commit comments

Comments
 (0)