feat(wb): add --skip-install option to optimizeForDockerBuild - #1218
Conversation
The in-image pass always reinstalls dependencies after rewriting package.json files, which is redundant for Dockerfiles that run their own install afterwards (e.g. to garbage-collect removed packages under Bun's isolated linker). Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
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 introduces a --skip-install option to the optimizeForDockerBuild command, enabling users to bypass the automatic dependency installation step. This change is designed to optimize Docker build times by preventing redundant installations when the Dockerfile is already configured to handle dependency management. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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. With Docker builds that take their time, / We skip the install, feeling prime. / No redundant steps to slow the flow, / Just faster builds and ready to go. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds a new --skip-install option to the optimizeForDockerBuild command, allowing dependency installation to be skipped after rewriting package.json files. The review feedback recommends checking the exit status of the spawned package manager installation process to fail fast and prevent silent failures when the installation fails.
…ockerBuild Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a --skip-install option to the optimizeForDockerBuild command, allowing users to skip dependency installation after rewriting package.json files. It also adds error handling for when the dependency installation fails. The reviewer suggested improving the error handling by checking and logging result.error to handle cases where the installation command fails to execute entirely (e.g., if the package manager is missing).
Customer Summary
wb optimizeForDockerBuildgains a--skip-installoption so Docker builds that run their own dependency installation afterwards no longer pay a redundant install, making image builds faster.Technical Summary
packages/wb/src/commands/optimizeForDockerBuild.ts:skip-installboolean option; when set on the in-image (non---outside) pass, the internal<packageManager> installafter rewritingpackage.jsonfiles is skipped while Docker build artifact cleanup still runs.spawnSyncexit status is now checked: on failure, an error is logged and the process exits with the child's status (or 1 when killed by a signal).--outsidepass, which never installed dependencies.Why
optimizeForDockerBuildprunes the manifest (to garbage-collect removed packages under Bun's isolated linker, e.g. exercode and smartse-zoom-bot) currently pay one redundant install per build;--skip-installlets them delegate installation entirely to their own step.Installed dependencies.and continued into cleanup, hiding the failure until later build stages.Testing
bun run verify-full(type checking, linting, and all tests) passed locally.