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

spec compliance: placeholder options are not enforcing type requirements #342

Open
peterhuene opened this issue Mar 7, 2025 · 1 comment · May be fixed by #345
Open

spec compliance: placeholder options are not enforcing type requirements #342

peterhuene opened this issue Mar 7, 2025 · 1 comment · May be fixed by #345
Labels
bug Something isn't working good first issue Good for newcomers spec compliance Behavior is not to the WDL specification

Comments

@peterhuene
Copy link
Collaborator

peterhuene commented Mar 7, 2025

In the function check_placeholder in wdl-analysis, we're accepting arrays of primitives for the sep option, but otherwise not enforcing the requirements from the WDL specification relating to placeholder options.

For the sep option, it is only allowed if the type of the expression is Array[P] (where P is any primitive type).

For the default option, it is only allowed if the type of the expression is optional.

For the true and false option, it is only allowed if the type of the expression is Boolean.

We should emit diagnostics when the types of the expressions are not the expected one for the option.

Additionally, in wdl-engine, we should also be enforcing these requirements and emitting the same diagnostic if the value produced by the expression is of a type that is not supported by the placeholder option.

This is needed as the type calculation for an expression in wdl-analysis can be Union, which means the type is statically indeterminate. An example of this would be ~{true="yes" false="no" read_json("file")}. This should emit no diagnostics from wdl-analysis, but should emit a diagnostic error from wdl-engine if the file does not contain a boolean.

@peterhuene peterhuene added bug Something isn't working good first issue Good for newcomers spec compliance Behavior is not to the WDL specification labels Mar 7, 2025
@Pabsthegreat
Copy link
Contributor

@peterhuene can I work on this ?

@Ankush1oo8 Ankush1oo8 linked a pull request Mar 8, 2025 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers spec compliance Behavior is not to the WDL specification
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants