fix: report build failures inline for failed concurrent builds #6911
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.
Fixes: #6126
Description
This PR causes Skaffold to report build successes and failures inline as part of the build logs, just as we report cancelled builds.
Previously such an error would be passed up and reported by the top-level command instance. This works for serial builds (
concurrency = 1
, the default with local builds) and single-artifact builds as the failed build would be the last build reported. But it makes diagnosing builds failures very difficult with concurrent builds as Skaffold buffers the logs of each build and reports them as each completes. When a build fails, the log is copied out and any other builds in progress are cancelled. These cancelled logs may appear to have been interrupted mid-stream. And the actual build failure is easily lost in the sea of logs.This change does not report the actual error on serial or single-artifact builds to avoid a visual stutter as Skaffold also reports the build failure in its final output, and leads to output like: