Feature Request - Orquesta inspection of when expressions
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
SUMMARY
Recently in Slack there have been several help requests that all were caused by people introducing logic errors into when expressions in task transitions. When these logic errors are made they result in the when expression always evaluating to true/false and Orquesta either taking always an unexpected branch (in the case of the expression always evaluating to True) and never taking the branch they expect (in the case where the expression always evaluates to False)
This request is to help detect these kinds of errors and warn/fail the workflow to help the user.
ISSUE TYPE
- Feature Idea
STACKSTORM VERSION
2.10.2
PROBLEM EXPRESSIONS
Mis-typed state functions
Bad Expression:
when: <% succeeded %>
Logic Error:
- The user thought that they were executing only when the task succeeded, but their expression instead was returning the string
succeededwhich then evaluated toTrueand caused that branch to always be taken
Proper Expression:
What the user really wanted was to use the succeeded() function.
when: <% succeeded() %>
Logic outside of expression delimeters
Bad Expression:
when: <% ctx().foo %> and <% ctx().bar %>
Logic Error:
- The user thought that they were combining two expressions logically with the
andkeyword. Instead they were creating a string"foo's value and bar's value". This string is non-empty so evaluates toTrueand causes the branch to be taken no matter the values ofctx().fooandctx().bar.
Proper Expression
What the user really wanted was to put the logic keyword inside of the expression delimiters
when: <% ctx().foo and ctx().bar %>
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
The issue names no files, tests, or entry points. Start by locating Orquesta's handling of task-transition when expressions and review the two malformed examples; done should include detection that warns or fails workflows for these logic errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100