Uh oh!
There was an error while loading. Please reload this page.
Add background step deferral infrastructure and metadata plumbing - #4479
Merged
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds infrastructure to support “background step” execution by deferring side effects (outputs, env vars, PATH changes, and outcome/conclusion propagation) and by plumbing background-step metadata through timeline record merging and step result reporting.
Changes:
- Introduces deferred collections and
FlushDeferred*()APIs onIExecutionContext/ExecutionContext, and gatesUpdateGlobalStepsContext()behindDeferOutcomeConclusion. - Updates
GITHUB_OUTPUT,GITHUB_ENV, andGITHUB_PATHfile commands to buffer into deferred collections when present. - Updates timeline record merge logic to preserve background-step metadata fields.
Show a summary per file
| File | Description |
|---|---|
src/Runner.Worker/FileCommandManager.cs | Buffers output/env/path file-command effects into deferred collections when running in a background-step context. |
src/Runner.Worker/ExecutionContext.cs | Adds deferral properties and flush APIs; defers global steps context updates; attempts to emit background metadata in StepResult. |
src/Runner.Common/JobServerQueue.cs | Preserves background-step metadata when merging multiple timeline record updates. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 3
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
TingluoHuang
approved these changes
Jun 4, 2026
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 freeto 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.
Summary
Adds the deferral mechanism and metadata plumbing needed for background step execution. Background steps buffer their outputs, environment variables, and path changes instead of writing to shared state directly — these are flushed to the job context at wait time on the main thread.
Changes
ExecutionContext.cs— AddsDeferredOutputs,DeferredEnvironmentVariables,DeferredPrependPath,DeferOutcomeConclusionproperties with correspondingFlushDeferred*()methods. AddsSetBackgroundStepMetadata()for timeline record metadata. GuardsUpdateGlobalStepsContextbehindDeferOutcomeConclusionflag.FileCommandManager.cs—GITHUB_OUTPUT,GITHUB_ENV, andGITHUB_PATHfile commands check for deferred collections and buffer writes when running as a background step.JobServerQueue.cs—MergeTimelineRecordspreserves background step metadata fields (IsBackground,BackgroundControlType,BackgroundControlStepIds,ParallelGroupId).Related to https://github.com/github/c2c-actions/issues/9534