Skip to content

fix: propagate errgroup context to lifecycle phases - #2701

Open
Pranav-IIITM wants to merge 1 commit into
buildpacks:mainfrom
Pranav-IIITM:fix-errgroup-context-propagation
Open

Pranav-IIITM wants to merge 1 commit into
buildpacks:mainfrom
Pranav-IIITM:fix-errgroup-context-propagation

Conversation

@Pranav-IIITM

Copy link
Copy Markdown

Summary

Propagate the parent build context through the errgroup used for concurrent build and run-extension phases.

This ensures that:

  • User cancellation reaches all running phases.
  • A failure in one phase cancels sibling phases.
  • The concurrent phases no longer use an unrelated context.TODO().

Output

Before

group, _ := errgroup.WithContext(context.TODO())
return l.Build(ctx, phaseFactory)

The errgroup context was discarded, and the parent context was not used.

After

group, groupCtx := errgroup.WithContext(ctx)
return l.Build(groupCtx, phaseFactory)

The derived context is now passed to Build, ExtendBuild, and ExtendRun.

Documentation

  • Should this change be documented?
    • Yes, see #___
    • No

This is an internal lifecycle execution and cancellation fix with no user-facing configuration or CLI changes.

Testing

  • git diff --check passed.
  • Phase tests passed: 18 passed, 3 skipped.
  • One Windows Docker-backed test remains environment-specific: the symlink assertion reports the copied symlink as a regular file. This is unrelated to the changed code.

Related

closes #2700

Signed-off-by: Pranav-IIITM <jogdandpranav2007@gmail.com>
@Pranav-IIITM
Pranav-IIITM requested review from a team as code owners September 25, 2026 08:13
@github-actions github-actions Bot added this to the 0.41.0 milestone Sep 25, 2026
@github-actions github-actions Bot added the type/enhancement Issue that requests a new feature or improvement. label Sep 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/enhancement Issue that requests a new feature or improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Concurrent build phases don't respect cancellation/errgroup context

1 participant