Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wdl run should join input paths correctly. #302

Merged
merged 3 commits into from
Jan 21, 2025

Conversation

peterhuene
Copy link
Collaborator

@peterhuene peterhuene commented Jan 21, 2025

This PR fixes the wdl run command to properly join input paths relative to the inputs file.

The code to make the path of the inputs file absolute was incorrectly done, resulting in the later join_paths call to effectively be a no-op when the inputs file path on the command line was relative to CWD (e.g. ./foo.json).

As a result, task execution would fail when using the path as the path would then be treated as relative to the task's working directory as it was not made absolute.

The fix is to simply return the absolute path correctly from parse_inputs.

Fixes #301.

Before submitting this PR, please make sure:

  • You have added a few sentences describing the PR here.
  • You have added yourself or the appropriate individual as the assignee.
  • You have added at least one relevant code reviewer to the PR.
  • Your code builds clean without any errors or warnings.
  • You have added tests (when appropriate).
  • You have updated the README or other documentation to account for these
    changes (when appropriate).
  • You have added an entry to the relevant CHANGELOG.md (see
    "keep a changelog" for more information).
  • Your commit messages follow the conventional commit style.

This commit fixes the `wdl run` command to properly join input paths relative
to the inputs file.

The code to make the path of the inputs file absolute was incorrectly done,
resulting in the later `join_paths` call to effectively be a no-op when the
inputs file path on the command line was relative to CWD (e.g. `./foo.json`).

As a result, task execution would likely fail if using the path as the path
would then be treated as relative to the task's working directory because it
was not made absolute.

The fix is to simply return the absolute path correctly from `parse_inputs`.

Fixes stjude-rust-labs#301.
Copy link
Member

@a-frantz a-frantz left a comment

Choose a reason for hiding this comment

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

Changes look good! But can we add some comments to the body of parse_inputs() to clarify what's happening? It's a bit messy and hard to follow IMO.

@peterhuene
Copy link
Collaborator Author

Done.

Copy link
Member

@adthrasher adthrasher left a comment

Choose a reason for hiding this comment

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

Appreciate the extra comments!

@peterhuene peterhuene merged commit 424f69f into stjude-rust-labs:main Jan 21, 2025
16 checks passed
@peterhuene peterhuene deleted the fix-paths branch January 21, 2025 16:42
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.

Files aren't being localized to the work directory when they are workflow inputs.
3 participants