Skip to content

feat(wb): add --skip-install option to optimizeForDockerBuild - #1218

Merged
exKAZUu merged 3 commits into
mainfrom
feat/optimize-docker-skip-install
Aug 11, 2026
Merged

feat(wb): add --skip-install option to optimizeForDockerBuild#1218
exKAZUu merged 3 commits into
mainfrom
feat/optimize-docker-skip-install

Conversation

@exKAZUu

@exKAZUu exKAZUu commented Aug 11, 2026

Copy link
Copy Markdown
Member

Customer Summary

  • wb optimizeForDockerBuild gains a --skip-install option so Docker builds that run their own dependency installation afterwards no longer pay a redundant install, making image builds faster.
  • The command now stops with an error when its internal dependency installation fails, instead of continuing and producing a broken image.
  • No behavior changes for existing invocations without the new flag (other than the fail-fast error handling).

Technical Summary

  • packages/wb/src/commands/optimizeForDockerBuild.ts:
    • Added a skip-install boolean option; when set on the in-image (non---outside) pass, the internal <packageManager> install after rewriting package.json files is skipped while Docker build artifact cleanup still runs.
    • The install's spawnSync exit 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).
  • The option has no effect on the --outside pass, which never installed dependencies.

Why

  • Dockerfiles that reinstall dependencies from scratch after optimizeForDockerBuild prunes 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-install lets them delegate installation entirely to their own step.
  • Previously a failed internal install logged 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.
  • review-booster run f824bc26: two rounds (claude, codex, antigravity), zero findings.

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>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 CLI Option: Added a --skip-install flag to the optimizeForDockerBuild command to provide greater control over the build process.
  • Build Optimization: Implemented conditional logic to bypass automatic dependency installation, allowing Dockerfiles to manage their own installation steps and avoid redundant work.
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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Generative AI Prohibited Use Policy, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/wb/src/commands/optimizeForDockerBuild.ts Outdated
exKAZUu and others added 2 commits August 11, 2026 20:58
@exKAZUu

exKAZUu commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment thread packages/wb/src/commands/optimizeForDockerBuild.ts
@exKAZUu exKAZUu self-assigned this Aug 11, 2026
@exKAZUu
exKAZUu merged commit 510d67c into main Aug 11, 2026
5 checks passed
@exKAZUu
exKAZUu deleted the feat/optimize-docker-skip-install branch August 11, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant