Fix #18834: use docker inspect exit code instead of stdout parsing#27428
Fix #18834: use docker inspect exit code instead of stdout parsing#27428LifeJiggy wants to merge 1 commit into
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request improves the reliability of the sandbox image existence check by switching from parsing command output to checking the exit code of the Docker inspection command. This ensures that the system correctly identifies image presence even when environment variables like DOCKER_BUILDKIT are enabled, which previously caused output to be redirected to stderr and triggered unnecessary image pulls. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the imageExists utility in packages/cli to use docker inspect --type=image instead of docker images -q for checking the existence of a sandbox image. The implementation now relies on the process exit code rather than parsing stdout, and includes stdio: 'ignore' to suppress output. Corresponding test mocks and assertions in sandbox.test.ts have been updated to reflect these changes. I have no feedback to provide as there were no review comments to evaluate.
8bc9dba to
9e19863
Compare
|
@scidomino, @abhipatel12 , @bbiggs PTAL |
…ut parsing The old implementation parsed stdout from docker images -q which could produce false negatives when Docker outputs image names to stderr (e.g. with DOCKER_BUILDKIT). Switch to docker inspect --type=image and check exit code directly. Also update all test mocks to match the new args and remove now-unused stdout data emission.
9e19863 to
13facc0
Compare
|
Please do not ping individual maintainers. Our inboxes are overfull and many of us have been assigned to other project. I appreciate that it's frustrating but this will be reviewed by the normal process or not at all. |
|
Understood. I apologize for pinging multiple maintainers. I won't ping individuals again and will respect the normal review process going forward. Thank you. |
Summary
Fix sandbox imageExists returning false negatives when Docker outputs image names to stderr (e.g. with DOCKER_BUILDKIT). Switch from parsing docker images -q stdout to using docker inspect --type=image exit code.
Details
docker images -q may write the image name to stderr when DOCKER_BUILDKIT=1 is set, causing the old stdout-based parsing to return a false negative. The sandbox would then attempt to pull the image unnecessarily. The fix uses docker inspect --type=image and checks the exit code, which is reliable regardless of output channel.
Related Issues
Fixes #18834
How to Validate
Pre-Merge Checklist