Skip to content

Conversation

@michaeldwan
Copy link
Member

@michaeldwan michaeldwan commented Apr 28, 2025

I'm doing some work in the build code that requires a context.Context (adding another command.Command implementation that hits the docker engine directly). Since most of the build code doesn't accept a context, I had to make a ton of tiny changes to pass a context from a command's run function through to the dockerfile generators and the docker command.Command interface.

These changes shouldn't have a meaningful impact, but extracting them into a separate PR will make the next one much easier to review. 😅

The vast majority of changes are adding ctx context.Context to function signatures then passing it on. The only actual changes that use the context are:

  • calls to the docker CLI that used exec.Command(... now use exec.CommandContext(ctx, ..., such as this example.
  • several function calls that required a context were using context.Background() or context.TODO() and are now using the parent context provided (such as this)

@michaeldwan michaeldwan changed the title wip build api experiment Propagate context.Context to build logic Apr 28, 2025
@michaeldwan michaeldwan requested a review from a team April 28, 2025 22:25
@michaeldwan michaeldwan marked this pull request as ready for review April 28, 2025 22:46
@michaeldwan michaeldwan merged commit c505da2 into main Apr 29, 2025
21 checks passed
@michaeldwan michaeldwan deleted the md/docker-api branch April 29, 2025 16:26
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.

3 participants