Reject if conditions on wait, wait-all, and cancel steps#376
Open
lokesh755 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves validation for wait, wait-all, and cancel steps by ensuring these control-flow steps are recognized by schema even when an if key is present, and then emitting a targeted converter error explaining that these steps cannot be conditional.
Changes:
- Allow
ifin the JSON schema forwait,wait-all, andcancelstep types so the step is classified correctly. - Reject
ifon these control-flow steps during conversion with a clearer, dedicated error message. - Add regression tests that assert the new error message for each control-flow step type.
Show a summary per file
| File | Description |
|---|---|
| workflow-parser/src/workflow-v1.0.json | Adds if to control-flow step schemas so they match their intended step type before conversion-time validation. |
| workflow-parser/src/model/converter/steps.ts | Introduces a dedicated error for if on wait/wait-all/cancel and emits it during step conversion. |
| workflow-parser/src/model/convert.test.ts | Adds tests asserting if is rejected on control-flow steps with the new message. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 3
- Review effort level: Low
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
wait,wait-all, andcancelsteps always run, so anifcondition on them is invalid — but previously it produced a confusing "not enough info… add one of: run, shell, uses" ambiguity error. This addsifto the control-flow step schemas so the step matches its correct type, then rejects it in the converter with a clear message telling the user these steps can't be conditional.