Skip to content

fix(agent/agentcontainers): reset error at start of rebuild #18686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2025

Conversation

DanielleMaywood
Copy link
Contributor

This PR resets the error when a rebuild is initiated.

Copy link
Contributor

@Copilot 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

This PR ensures that any previous error on a devcontainer is cleared when a rebuild is started and updates test fakes to support deferred error injection via functions.

  • Clear the Error field at the start of handleDevcontainerRecreate
  • Change fakeDevcontainerCLI.upErrC to carry func() error instead of raw error
  • Update tests to send error-producing functions and verify the cleared error

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
agent/agentcontainers/api.go Reset dc.Error to an empty string before recreate
agent/agentcontainers/api_test.go Switch upErrC channel to func() error and adjust tests
Comments suppressed due to low confidence (2)

agent/agentcontainers/api_test.go:72

  • Update the comment to reflect that upErrC receives func() error values, e.g. "If set, send a function that returns the desired error".
	upErrC         chan func() error // If set, send to return err, close to return upErr.

agent/agentcontainers/api_test.go:72

  • [nitpick] Consider renaming upErrC to upErrFnC (and similarly execErrC to execErrFnC) to clearly indicate that the channel carries functions rather than raw errors.
	upErrC         chan func() error // If set, send to return err, close to return upErr.

@DanielleMaywood DanielleMaywood marked this pull request as ready for review July 1, 2025 08:48
@DanielleMaywood DanielleMaywood requested a review from mafredri July 1, 2025 08:48
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Nice! 👍🏻

@DanielleMaywood DanielleMaywood merged commit 7e372f7 into main Jul 1, 2025
38 checks passed
@DanielleMaywood DanielleMaywood deleted the danielle/reset-error-on-rebuild branch July 1, 2025 09:57
@github-actions github-actions bot locked and limited conversation to collaborators Jul 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants