fix(sandbox): harden image packaging integrity checks#19552
Conversation
Summary of ChangesHello @aviralgarg05, 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 significantly enhances the robustness of the sandbox image packaging and release pipeline. By integrating multiple layers of integrity checks, both during the Docker image build and as a pre-publish verification step in the CI/CD workflow, it prevents the release of corrupted sandbox images. This directly addresses a critical startup regression, ensuring that published images are always valid and functional. Highlights
Changelog
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 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 counter productive. 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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively addresses the sandbox image corruption issue (issue #19085) by implementing robust integrity checks during the build process and as a release gate in the CI pipeline. The changes include sequential global installs in the Dockerfile to prevent potential corruption, followed by explicit JSON parsing of the package manifests for both the CLI and core packages. A functional sanity check using gemini --version is also performed. These measures ensure that any corrupted or invalid package configurations are identified before the image is published. The implementation follows existing patterns and maintains the security and reliability of the sandbox environment.
2a4074b to
3ed9912
Compare
Summary
This PR fixes a
--sandboxstartup regression where published sandbox images could contain an invalid/corrupted@google/gemini-cli-core/package.json, causing Gemini CLI to crash withERR_INVALID_PACKAGE_CONFIG(issue #19085).The fix hardens sandbox image packaging and release verification so corrupted package metadata is caught before publish and blocked from release.
Details
Updated
/Users/aviralgarg/Everything/gemini-cli/Dockerfile:@google/gemini-cli-corefirst, then@google/gemini-cli(sequential global installs instead of one combined install)/usr/local/share/npm-global/lib/node_modules/@google/gemini-cli/package.json/usr/local/share/npm-global/lib/node_modules/@google/gemini-cli-core/package.jsongemini --version) during image buildUpdated
/Users/aviralgarg/Everything/gemini-cli/.github/actions/push-sandbox/action.yml:verifystep before publish that:/usr/local/share/npm-global/bin/gemini --versionDesign intent:
Related Issues
Fixes #19085
How to Validate
Expected: all workspace builds succeed.
Expected: image builds successfully and writes
final_image_uri.txt.Expected: exits 0 with no JSON parse errors and CLI version command succeeds.
Expected: both commands pass.
Expected: JSON parse command fails non-zero, demonstrating the release gate blocks publish.
Pre-Merge Checklist