Skip to content

Reject if conditions on wait, wait-all, and cancel steps#376

Open
lokesh755 wants to merge 2 commits into
mainfrom
lokesh755-reject-if-on-control-flow-steps
Open

Reject if conditions on wait, wait-all, and cancel steps#376
lokesh755 wants to merge 2 commits into
mainfrom
lokesh755-reject-if-on-control-flow-steps

Conversation

@lokesh755

Copy link
Copy Markdown
Contributor

wait, wait-all, and cancel steps always run, so an if condition on them is invalid — but previously it produced a confusing "not enough info… add one of: run, shell, uses" ambiguity error. This adds if to 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.

Copilot AI review requested due to automatic review settings July 1, 2026 08:16
@lokesh755
lokesh755 requested a review from a team as a code owner July 1, 2026 08:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 if in the JSON schema for wait, wait-all, and cancel step types so the step is classified correctly.
  • Reject if on 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

Comment thread workflow-parser/src/model/converter/steps.ts
Comment thread workflow-parser/src/model/converter/steps.ts
Comment thread workflow-parser/src/model/converter/steps.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants