-
Notifications
You must be signed in to change notification settings - Fork 2
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
Reduce use of "if defined(argument)" #4
base: master
Are you sure you want to change the base?
Conversation
Hey @TMiguelT, thanks for putting this together. I'm very happy with the miniwdl stuff in there, I think it's a great addition. I tried your approach to start, but it appears MiniWDL and Cromwell don't cascade the (string + null + string) the same.
I don't know if this is an error in Cromwell, or just the behaviour isn't defined as well in OpenWDL. What do you think the approach from here should be? I'm not a big fan of the way this task generation happens. I'm pretty happy to overhaul it to make it better. It's a hodepodge of legitimate template options and helpers. We know our criteria now, like the way arrays are handled is not as clean as it could be. ExampleTask: version development
task quotetest {
input {
String? str
}
command <<<
echo ~{'"--prefix" "' + str + '"'}
>>>
output {
String out = read_string(stdout())
}
} MiniWDL:
Cromwell
|
Based on the much more clear development spec, it seems that Cromwell is actually wrong here: https://github.com/openwdl/wdl/blob/master/versions/development/SPEC.md#interpolating-and-concatenating-optional-strings
So, like miniWDL it should evaluate that entire chunk to None, which becomes an empty string after interpolation. I'll file that as a bug for cromwell (not that it will get any attention). In the short term, I guess this means either giving up the use of quotes around the argument (which might be dangerous), or giving up the simpler syntax, which I guess is the best optional the moment. |
Yeah I'm split:
I'm just not confident it'll get fixed in Cromwell. |
I think it's reasonable to want to produce a subset of valid WDL that works on both execution engines. It means messier code and also generated WDL but that's life. |
I've added a PR to Cromwell to bring its behaviour in line with the OpenWDL spec: When this is merged, I'm happy to action this card. |
Hey @TMiguelT, I see there isn't action on the Cromwell side, I've restructured the v0.3.0 API (#5) which allows you to build the command input yourself. The existing commandinput helper functionality was preserved (but updated to use development features, notably the I share the following snippet of code which I use to build command inputs now (to handle all cases from scalar and quotable values, to optional arrays of optional quotable values (which is easier now). Happy to answer any questions - for now I'd recommend you pin your projects to |
Changes:
if defined(argument)
being used for optional scalar arguments #2)I'm unsure if I've got the string syntax 100% right given it has 3 nested levels of quotes, so another pair of eyes would be good. Also if you don't want the miniWDL dependency then feel free to just delete that part.