Skip to content

'save' function truncate input source name if it contains step name #402

Description

@natthan-pigoux

I remarked that if a Workflow input source name contains exactly the step name, then if I apply the save function on this workflow, the input source is truncated.

Here is an example:

cwlVersion: v1.2
class: Workflow
label: "Main Workflow"
doc: >
  Test.

inputs:
  first_input:
    type: string
    default: "step_1.log"
  second_step_input:
    type: string
    default: "step_2.log"

outputs:
  log:
    type: File[]
    outputSource:
      - second_step/log

steps:
  first_step:
    run: first_step.cwl
    in:
      input_1: first_input
    out: [log]

  second_step:
    run: second_step.cwl
    in:
      input_2: second_step_input
    out: [log]

Then if you load and save the workflow:

from cwl_utils.parser import save, load_document
from cwl_utils.pack import pack

from pathlib import Path

cwl_path = Path("test_workflow.cwl")
cwl_obj = load_document(pack(str(cwl_path)))

saved_cwl = save(cwl_obj)
print(saved_cwl)

It gives you:

[...] {'id': 'second_step', 'in': [{'id': 'input_2', 'source': '_input'}] [...] 

The input source is no more second_step_input but _input.

Do you have any idea if this behavior is expected?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions