Report silent build command failures#238
Conversation
Greptile SummaryThis PR adds a dedicated
Confidence Score: 5/5Safe to merge; the fix is tightly scoped to the build-command execution path and correctly preserves the new error type through both the inner and outer exception layers. The previously flagged re-wrapping of BUILD_FAILED as RUNTIME_FAILED has been addressed with two complementary guards. The remaining observation about dropping the OrchestrationException message is a diagnostic nicety, not a correctness issue. src/Executor/Runner/Docker.php — the catch (OrchestrationException) block hardcodes the message; worth reviewing whether the exception carries a more useful message from the Docker API. Important Files Changed
Reviews (4): Last reviewed commit: "Report silent build command failures" | Re-trigger Greptile |
f2d527f to
73ca836
Compare
13fe422 to
7b214f8
Compare
7b214f8 to
3ea3e0c
Compare
| foreach (['v2', 'v5'] as $version) { | ||
| $commands = $this->invokeGetBuildCommands($docker, 'exit 1', $version); | ||
| $command = \implode(' ', $commands); | ||
|
|
||
| $this->assertStringContainsString('Build command exited with code $status.', $command); | ||
| $this->assertStringContainsString('exit $status', $command); | ||
| } |
There was a problem hiding this comment.
Something feels weird here, $status doesnt exist.
Also, would be great to have test over HTTP too - trying to create build runtime with exit 1 command, and making sure logs include this message (and deployment is failed).
Maybe even assertion successfull build doesnt have this copy
What does this PR do?
Makes build command failures explicit in executor responses by introducing a dedicated
build_failederror type.Previously, a build command that exited non-zero could be surfaced as a generic runtime failure. With the Docker API orchestration adapter, non-zero command exits are raised as orchestration exceptions, so executor never reached its existing
$status === falsehandling. That caused user build failures to lose their intended classification.This PR keeps the fix local to executor:
Exception::BUILD_FAILED = 'build_failed'.build_failedto the error config with HTTP 400 andpublish => false.BUILD_FAILED.runtime_failed.ExecutorExceptiontypes through the outer cleanup path instead of wrapping them as generic exceptions.Build command exited with code N.type: build_failed.Why
Downstream services need to distinguish user build failures from executor/runtime infrastructure failures.
build_failedis safe to present as a user build error, while generic runtime failures can remain internal.Test Plan
composer test:unit -- --filter DockerTestRelated PRs and Issues