The validate command should discover errors with parameters early.
Take Serial workflow engine, for example reana-demo-worldpopulation, and simulate a typo:
$ cd reana-demo-worldpopulation
$ reana-client validate
reana.yaml is a valid REANA specification file.
$ sed -i 's,{region},{rgn},g' reana.yaml
$ reana-client validate
reana.yaml is a valid REANA specification file.
That is, if the user defines a parameter region, but later in the job steps uses rgn, the current validation does not catch these types of errors.
We should check for:
parameters defined in inputs.parameters specification, and if they are not used in the workflow body, emit a warning that this parameter may be unused;
parameter placeholders used in step commands, such as ${foo}, and if they are not defined in inputs.parameters, emit a warning that this parameter is not defined;
(In the second case, we could emit actually an error, however we have to be careful not to report "good" situtations, such as ${USER} or ${REANA_WORKSPACE} which are perfectly valid environment variables that people may want to use. And, since these are hard to detect outside of the image environment context, we can simply emit warning for now that rgn seems undefined.)
The
validate
command should discover errors with parameters early.Take Serial workflow engine, for example
reana-demo-worldpopulation
, and simulate a typo:That is, if the user defines a parameter
region
, but later in the job steps usesrgn
, the current validation does not catch these types of errors.We should check for:
inputs.parameters
specification, and if they are not used in the workflow body, emit a warning that this parameter may be unused;${foo}
, and if they are not defined ininputs.parameters
, emit a warning that this parameter is not defined;(In the second case, we could emit actually an error, however we have to be careful not to report "good" situtations, such as
${USER}
or${REANA_WORKSPACE}
which are perfectly valid environment variables that people may want to use. And, since these are hard to detect outside of the image environment context, we can simply emit warning for now thatrgn
seems undefined.)