aurelienbrabant
aurelienbrabant15mo ago

Support for passing variables and resources in shell executor

Hi there, was wondering if there was any plan to support windmill's variable and resource types as script input arguments. Currently using a variable as an argument doesn't expand it, instead it displays the the path of the variable. Also I didn't find a way to specify a type for a resource argument, even using the customize pane. I know bash does not have types but I think expanding either the string value of the variable or the JSON of the resource as a string should be the behaviour. We can always leverage cli tools such as jq to extract the data we want. I'm well aware that it's possible to get specific variables and resources from inside a shell script but I'm truly looking for parametrisation here.
15 Replies
rubenf
rubenf15mo ago
Currently using a variable as an argument doesn't expand it, instead it displays the the path of the variable.
Just so you know, if you pass $var:path or $res:path it will work as you expect so we actually have a way to do this that I think is somewhat clean, to use customize with the format Resource and inside the body you use the path to fetch it this way, this is still legit bash and the UI has a nice resource select box
aurelienbrabant
aurelienbrabant15mo ago
well thing is couldn't find it here. Or that's just not where it is.
No description
rubenf
rubenf15mo ago
yeah it's missing
aurelienbrabant
aurelienbrabant15mo ago
as for the variable I get this
No description
aurelienbrabant
aurelienbrabant15mo ago
But I'm on the old EE version so that might have been fixed in fact. Pretty sure I had still the variable issue on latest CE let me check
rubenf
rubenf15mo ago
hm thatt looks like a bug
aurelienbrabant
aurelienbrabant15mo ago
I get the exact same variable issue on CE
rubenf
rubenf15mo ago
yes, it's a bug specific to bash TODO fix variable not being interpolated in bash as arg TODO add back for string: resource-path format
aurelienbrabant
aurelienbrabant15mo ago
And same issue for the resource type missing apparently
rubenf
rubenf15mo ago
I think resources is gonna be a wontdo or maybe we should do resources it's just that i'm not sure how to assign them to variables we could do that as plaintext of the json I guess
aurelienbrabant
aurelienbrabant15mo ago
imo raw json is okay
rubenf
rubenf15mo ago
ok fair
aurelienbrabant
aurelienbrabant15mo ago
jq to extract data from it
rubenf
rubenf15mo ago
then TODO resources as well I will give it a pass today if I finish everything
aurelienbrabant
aurelienbrabant15mo ago
Yep no problem I can satisfy my use case by making an http request from any other programming language anyway so