Skip to content

Add background step syntax to workflow parser and language service#352

Open
lokesh755 wants to merge 7 commits intoactions:mainfrom
lokesh755:lokesh755-background-steps
Open

Add background step syntax to workflow parser and language service#352
lokesh755 wants to merge 7 commits intoactions:mainfrom
lokesh755:lokesh755-background-steps

Conversation

@lokesh755
Copy link
Copy Markdown

@lokesh755 lokesh755 commented Apr 14, 2026

This change adds support for the new background step syntax in GitHub Actions workflows.

@lokesh755 lokesh755 marked this pull request as ready for review April 14, 2026 08:29
@lokesh755 lokesh755 requested a review from a team as a code owner April 14, 2026 08:29
Copilot AI review requested due to automatic review settings April 14, 2026 08:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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: true plus new step kinds: wait, wait-all, and cancel.
  • 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-value is defined as null | boolean, but the converter/language service rejects wait-all: false. Because completions are schema-driven, this schema will also suggest false as a valid value. If false is intentionally invalid, consider tightening the schema/value providers so only the bare key (null) and true are 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/cancel targets 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 can wait/cancel non-background steps without any diagnostic. Consider tracking which known step IDs were declared with background: true and 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

Comment thread workflow-parser/src/workflow-v1.0.json
Comment thread workflow-parser/src/model/converter/steps.ts Outdated
@lokesh755 lokesh755 force-pushed the lokesh755-background-steps branch from 4509387 to 053269d Compare April 14, 2026 16:36

//step env
if (workflowContext.step?.env) {
if (workflowContext.step && "env" in workflowContext.step && workflowContext.step.env) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

not all steps has env now.

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