- Notifications
You must be signed in to change notification settings - Fork1k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
There was a problem hiding this 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 ofhandleDevcontainerRecreate
- Change
fakeDevcontainerCLI.upErrC
to carryfunc() error
instead of rawerror
- 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 | Resetdc.Error to an empty string before recreate |
agent/agentcontainers/api_test.go | SwitchupErrC channel tofunc() error and adjust tests |
Comments suppressed due to low confidence (2)
agent/agentcontainers/api_test.go:72
- Update the comment to reflect that
upErrC
receivesfunc() 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
toupErrFnC
(and similarlyexecErrC
toexecErrFnC
) 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.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Nice! 👍🏻
7e372f7
intomainUh oh!
There was an error while loading.Please reload this page.
This PR resets the error when a rebuild is initiated.