st2 doesn't validate ActionChain task parameters when loading workflow, tasks with missing parameters are "silently" skipped on workflow execution
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
I have an ActionChain workflow with several tasks that are remote-shell-script runners. When creating my yaml metadata for the workflow, I neglected to include the required hosts parameter for the task declaration in the workflow. I would have expected that st2 would have validated the task parameters when loading my pack, but it apparently does not do that.
Even more confusingly, when the workflow executes the task is "skipped" due to the ValidationError exception (I eventually found the traceback buried in one of the st2actionrunner.<pid>.log files) but the workflow continues on executing whatever tasks follow the "skipped" task (it still appears to follow the on-failure task declaration for the task that doesn't run due to the exception). Looking at the execution history in the UI or command line for the workflow, there is no indication anywhere that the task hit this exception, it just isn't shown in the execution list at all.
At the very least, I would expect that the task ValidationError would cause it to show up as "failed" (or maybe some other error state) in the execution history. Instead it's like it isn't even there in the workflow. Also the workflow status after execution ends up being "Succeeded" which seems like it should be "Failed" given that one of the tasks threw an exception.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the ActionChain workflow with a remote-shell-script task missing its hosts parameter, then inspect the st2actionrunner.log traceback and the execution history in the UI or command line. The fix should ensure the invalid task is validated or visibly reported as failed, and that the overall workflow status reflects the task error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100