Add background step syntax to workflow parser and language service#352
Open
lokesh755 wants to merge 7 commits intoactions:mainfrom
Open
Add background step syntax to workflow parser and language service#352lokesh755 wants to merge 7 commits intoactions:mainfrom
lokesh755 wants to merge 7 commits intoactions:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for “background steps” syntax in GitHub Actions workflows across the workflow parser and language service.
Changes:
- Extends the workflow schema/model to support
background: trueplus new step kinds:wait,wait-all, andcancel. - Updates workflow template conversion logic and ID handling (including case-insensitive known-id tracking) to accommodate the new step types.
- Adds/updates reader fixtures and language service tests for validation and completions.
Show a summary per file
| File | Description |
|---|---|
| workflow-parser/testdata/reader/errors-job-id-format.yml | Updates expected ID-format error text (fixes duplicated “and”). |
| workflow-parser/testdata/reader/error.yml | Updates expected “missing info” diagnostic to include new step kinds. |
| workflow-parser/testdata/reader/background-steps.yml | Adds fixture covering background + wait/wait-all/cancel parsing output. |
| workflow-parser/src/workflow-v1.0.json | Extends schema with new step types and background, plus definitions for wait/cancel fields. |
| workflow-parser/src/model/workflow-template.ts | Extends Step union/types to represent wait/wait-all/cancel and background. |
| workflow-parser/src/model/type-guards.ts | Adds isExecutableStep helper for steps that carry if/env/continue-on-error. |
| workflow-parser/src/model/converter/steps.ts | Converts new step fields/types; generates synthetic IDs for new step kinds; validates wait/cancel targets. |
| workflow-parser/src/model/converter/id-builder.ts | Makes known-id tracking case-insensitive; fixes error message text. |
| workflow-parser/src/model/converter/id-builder.test.ts | Adds test coverage for case-insensitive known-id tracking. |
| workflow-parser/src/model/convert.test.ts | Updates tests to only assert if on executable steps. |
| languageservice/src/validate.test.ts | Adds validation tests for accepting background-step keywords and rejecting wait-all: false. |
| languageservice/src/context/workflow-context.ts | Treats new step kinds as step mappings for context lookup. |
| languageservice/src/context-providers/env.ts | Restricts step env context to executable steps only. |
| languageservice/src/complete.test.ts | Updates step-key completion expectations to include new keywords. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (2)
workflow-parser/src/workflow-v1.0.json:2245
step-wait-all-valueis defined asnull | boolean, but the converter/language service rejectswait-all: false. Because completions are schema-driven, this schema will also suggestfalseas a valid value. Iffalseis intentionally invalid, consider tightening the schema/value providers so only the bare key (null) andtrueare offered/accepted (and keep conversion/diagnostics consistent with that).
"step-wait-all-value": {
"description": "Wait for all prior background steps to complete. Use as a bare key (`wait-all:`) or with a boolean value.",
"one-of": [
"null",
"boolean"
]
workflow-parser/src/model/converter/steps.ts:249
wait/canceltargets are described (in the schema) as referring to background steps, but this validation only checks that the referenced step ID exists. As a result, workflows canwait/cancelnon-background steps without any diagnostic. Consider tracking which known step IDs were declared withbackground: trueand validate that targets resolve to those background IDs (in addition to the existing existence/self/reserved checks).
} else if (ownStepId && target.value.toLowerCase() === ownStepId.value.toLowerCase()) {
context.error(target, `Step '${ownStepId.value}' cannot reference itself`);
} else if (!idBuilder.hasKnownId(target.value)) {
context.error(target, `Step references unknown step ID '${target.value}'`);
}
- Files reviewed: 14/14 changed files
- Comments generated: 2
4509387 to
053269d
Compare
lokesh755
commented
Apr 14, 2026
|
|
||
| //step env | ||
| if (workflowContext.step?.env) { | ||
| if (workflowContext.step && "env" in workflowContext.step && workflowContext.step.env) { |
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.
This change adds support for the new background step syntax in GitHub Actions workflows.