Skip to content

Delete "dirname" also for type Directory - #2281

Merged
adamnovak merged 3 commits into
common-workflow-language:mainfrom
adrabent:patch-1
Aug 25, 2026
Merged

adamnovak merged 3 commits into
common-workflow-language:mainfrom
adrabent:patch-1

Conversation

@adrabent

@adrabent adrabent commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Dear developers,

I have observed that suddenly under certain circumstances inputs (of type Directory) are mounted into the WorkDir without having specified it. This may cause conflicts, especially if identical file names are used.

The issue appeared the first time at version 3.2.20260413085819

I have one example (in short).
I have used the InitialWorkDirRequirement to put my inputs msin to:

hints:
   - class: InitialWorkDirRequirement
    listing:
      - entry: $(inputs.msin)
        writable: false

msin itself is correctly mounted to the workDir, but in addition also a second input:

{
        "position": [
            0,
            "flag_transfer_source_ms"
        ],
        "prefix": "flagtransfer.source_ms=",
        "separate": false,
        "datum": {
            "basename": "L667520_123MHz_uv.dp3concat",
            "class": "Directory",
            "dirname": "/ubcCuq",
            "location": "/home/alex/debug/tmp/7da5clhb/L667520_123MHz_uv.dp3concat",
            "nameext": ".dp3concat",
            "nameroot": "L667520_123MHz_uv",
            "writable": false,
            "path": "/ubcCuq/L667520_123MHz_uv.dp3concat"
        }
    },

Surprisingly, it has put the flag_transfer_source_ms already in the workDir right from the beginning, given by the inputs:

"file:///home/alex/prefactor3-cwl/workflows/linc_target/concat.cwl#concat/dp3concat/flag_transfer_source_ms": {
        "basename": "L667520_123MHz_uv.dp3concat",
        "class": "Directory",
        "dirname": "/ubcCuq",
        "location": "/home/alex/debug/tmp/7da5clhb/L667520_123MHz_uv.dp3concat",
        "nameext": ".dp3concat",
        "nameroot": "L667520_123MHz_uv",
        "writable": false
    },

The root cause is that dirname became part of the input dictionary itself and is propagated through the entire workflow.
I repeated my workflow with an older cwltool version. There I get from an output of a previous step:

outputs {
    "msout": [
        {
            "basename": "L667520_121MHz_uv.dp3concat",
            "class": "Directory",
            "location": "file:///home/alex/debug/tmp/sx3t5ahe/L667520_121MHz_uv.dp3concat",
            "nameext": ".dp3concat",
            "nameroot": "L667520_121MHz_uv",
            "writable": true
        }
    ],

And with the new version the dirname became part of the output.

outputs {
    "msout": [
        {
            "basename": "L667520_123MHz_uv.dp3concat",
            "class": "Directory",
            "dirname": "/ubcCuq",
            "location": "file:///home/alex/debug/tmp/7da5clhb/L667520_123MHz_uv.dp3concat",
            "nameext": ".dp3concat",
            "nameroot": "L667520_123MHz_uv",
            "writable": true
        }
    ],

Removing the dirname entry from the output dictionary solves this issue.

Cheers,
Alex

@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.24%. Comparing base (41832d4) to head (6baa370).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2281   +/-   ##
=======================================
  Coverage   85.24%   85.24%           
=======================================
  Files          46       46           
  Lines        8622     8622           
  Branches     2020     2020           
=======================================
  Hits         7350     7350           
  Misses        806      806           
  Partials      466      466           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mr-c
mr-c force-pushed the patch-1 branch 2 times, most recently from daf3737 to 0d9c3dd Compare July 23, 2026 08:57

@adamnovak adamnovak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I don't see anything wrong with this.

@adamnovak
adamnovak merged commit 77f2003 into common-workflow-language:main Aug 25, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants