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

feat: implement the env declaration modifier in WDL 1.2. #296

Merged
merged 5 commits into from
Jan 17, 2025

Conversation

peterhuene
Copy link
Collaborator

@peterhuene peterhuene commented Jan 16, 2025

This PR implements the env declaration modifier in WDL 1.2 that may be present for both inputs and private declarations in a task.

When present, task execution will treat the value of the declaration as an environment variable for the spawned process. The variable can then be referenced using Bash syntax (e.g. $foo).

Validation diagnostics were added to ensure the env variable is only applied to primitive type declarations, as there is no standard string representation for complex types.

Closes #295.

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 implements the `env` declaration modifier in WDL 1.2 that may be
present for both inputs and private declarations in a task.

When present, task execution will treat the value of the declaration as an
environment variable for the spawned process. The variable can then be
referenced using Bash syntax (e.g. `$foo`).

Validation diagnostics were added to ensure the `env` variable is only applied
to primitive type declarations, as there is no standard string representation
for complex types.

Closes stjude-rust-labs#295.
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.

wdl-format needs to be updated as well. Or else it will panic on anything with the env keyword.

wdl-grammar/src/lexer/v1.rs Outdated Show resolved Hide resolved
Co-authored-by: Andrew Frantz <andrew.frantz@stjude.org>
@peterhuene
Copy link
Collaborator Author

I'll add a test case to wdl-format and update it.

@peterhuene peterhuene requested a review from a-frantz January 17, 2025 00:34
Copy link
Member

@claymcleod claymcleod left a comment

Choose a reason for hiding this comment

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

LGTM.

Co-authored-by: Andrew Frantz <andrew.frantz@stjude.org>
@peterhuene peterhuene merged commit 4101a57 into stjude-rust-labs:main Jan 17, 2025
16 checks passed
@peterhuene peterhuene deleted the env-vars branch January 17, 2025 00:58
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.

WDL 1.2 conformance: missing support for task environment variables
3 participants