Raise DockerBuildError on Docker build failures#258
Open
kailun-qin wants to merge 1 commit into
Open
Conversation
d2ba7a2 to
0ac2bc4
Compare
Previously, `build_docker_image()` ignored the 'error' key in the Docker API stream, relying solely on `get_docker_image()` to catch build failures. This caused the script to incorrectly report success even if a build instruction failed, when a stale Graminized image existed. This commit adds an explicit check for the 'error' key and introduces a `DockerBuildError` exception. All callers are updated to catch this exception and exit, ensuring build failures are correctly reported. Signed-off-by: Kailun Qin <kailun.qin@intel.com>
0ac2bc4 to
08cc08f
Compare
kailun-qin
commented
Apr 13, 2026
kailun-qin
left a comment
Contributor
Author
There was a problem hiding this comment.
Please note that this works fine under a clean setup. Not sure if we consider this as a false positive -- I'm raising it here anyway.
@kailun-qin made 1 comment.
Reviewable status: 0 of 1 files reviewed, all discussions resolved, not enough approvals from maintainers (2 more required), not enough approvals from different teams (1 more required, approved so far: Intel).
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.
Description of the changes
Previously,
build_docker_image()ignored the 'error' key in the Docker API stream, relying solely onget_docker_image()to catch build failures. This caused the script to incorrectly report success even if a build instruction failed, when a stale Graminized image existed.This commit adds an explicit check for the 'error' key and introduces a
DockerBuildErrorexception. All callers are updated to catch this exception and exit, ensuring build failures are correctly reported.How to test this PR?
Manual testing: run gsc build w/ the python:bullseye example from our doc.
Before this fix:
After this fix:
This change is