Repository navigation
fix: report errors swallowed by stop, builder detection and the env probe - #62
Merged
Merged
Conversation
stop and down dropped the error of the container lookup and of the
inspect that follows it, and of os.Getwd. An engine that refused the
list reported {"outcome":"success","result":"no-container-found"} with
exit 0, and a container that could not be inspected was stopped as a
plain container even when it belonged to a Compose project. Each now
ends in an error result.
stop and down are Go-only commands, so no reference behavior applies.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FindDockerDriverBuilder read the stdout of `docker context inspect` without checking its error, and Run returns a nil result when the command does not start or the context is cancelled, so a Feature build on a docker-container builder could end in a nil pointer panic. A context that can't be read now counts as no current context, and the first docker-driver builder is still chosen, as when `buildx ls` names no builder for the current context. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the userEnvProbe could not run in the container, the lifecycle commands got an empty environment and nothing said why. The reference CLI (injectHeadless.ts runUserEnvProbe) also falls back to an empty environment, but writes the error first with toErrorText; Go now does the same, through a log.ToErrorText that renders TS's red text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 free
to 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.
Three errors the code dropped, found during the comment cleanup (#59). One commit each.
fix(cli): stop/down report a failed container lookup.stopanddown(Go-only commands) ignored the errors of the container lookup, of the inspect that follows it, and ofos.Getwd.{"outcome":"success","result":"no-container-found"}with exit 0.TestStopOrDownReportsALookupTheEngineRefusedandTestStopOrDownReportsAContainerItCannotInspect(both fail onmain).fix(docker): no panic when the docker context can't be read.FindDockerDriverBuilderread the stdout ofdocker context inspectwithout checking the error.Runreturns a nil result when the command doesn't start or the context is cancelled, so a Feature build on adocker-containerbuilder could panic.buildx lsnames none for the current context.TestFindDockerDriverBuilderWhenTheContextCannotBeRead(panics onmain).fix(lifecycle): log why the user env probe failed. A probe that couldn't run left an empty environment and said nothing. TS (injectHeadless.tsrunUserEnvProbe) also falls back to{}, but first writes the error withtoErrorText; Go now does the same, through a newlog.ToErrorTextthat reproduces TS's text (TestToErrorTextMatchesTheReference).TestProbedRemoteEnvnow asserts the log line (fails onmain).Investigated, no change:
finalStageName(falls back to the TS-identical regex path), the JSON logstringifyfailure (unreachable:Eventalways serializes) andjsonTruthy(only after V8-compatible validation; true routes to the parse error).Validation (local)
task lint: pass.task test:racewithTMPDIRoutside/tmp: pass.task parity:contract: 104 pass. The 2read-configuration.features-configuration-local-feature-*cases fail locally because of a/tmp/.giton the dev machine (same onmain).task test:e2e: everything passes exceptTestE2E_CABundle/container, which picked up another concurrent run'spostCreateCommand(another URL and nonce) while other e2e runs shared the Docker daemon. It passes when run alone. This looks like an image-name collision between concurrent runs and is unrelated to this change.🤖 Generated with Claude Code