fix(docker): Add --ignore-scripts to prevent prepare script failure#1213
fix(docker): Add --ignore-scripts to prevent prepare script failure#1213
Conversation
The `prepare` script (`npm run build`) added in #1053 causes the Docker build to fail because `npm ci --omit=dev` triggers it without devDependencies (`rimraf`, `tsc`) being available. Adding `--ignore-scripts` skips the unnecessary rebuild since the build output already exists from the prior step. Docker builds have been broken since 2025-12-31 (PR #1053). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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 addresses a critical issue causing Docker builds to fail. The problem stemmed from a Highlights
🧠 New Feature in Public Preview: You can now enable Memory 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. Changelog
Activity
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
|
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe Dockerfile's npm install command has been modified to include the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1213 +/- ##
=======================================
Coverage 87.14% 87.14%
=======================================
Files 115 115
Lines 4310 4310
Branches 998 998
=======================================
Hits 3756 3756
Misses 554 554 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Code ReviewVerdict: Approve ✅ This is a clean, well-targeted fix for the Docker build failure. The change is minimal and correct. AnalysisThe root cause is clearly identified in the PR description: the The Dockerfile's build pipeline is:
Adding
No concerns found
LGTM — ready to merge. Reviewed by Claude |
Deploying repomix with
|
| Latest commit: |
749392c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2430d0d3.repomix.pages.dev |
| Branch Preview URL: | https://fix-docker-build-prepare-scr.repomix.pages.dev |
Replace `npm ci --omit=dev --ignore-scripts` with `npm prune --production` which is more efficient (removes packages in-place instead of reinstalling) and does not trigger lifecycle scripts by default. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code Review (Updated)Verdict: Approve ✅
What ChangedThe PR replaces npm ci --omit=dev with npm prune --production in the Dockerfile build pipeline: - && npm ci --omit=dev \
+ && npm prune --production \AnalysisThis is a better fix than --ignore-scripts would have been:
The build pipeline is now:
Minor SuggestionConsider using PR Title/Description MismatchThe PR title says Add --ignore-scripts to prevent prepare script failure but the actual change uses npm prune --production. Consider updating the title/description to match the implementation. No Concerns
LGTM - ready to merge. Reviewed by Claude |
Same change as Dockerfile — replace `npm ci --omit=dev --ignore-scripts` with `npm prune --production` for consistency and efficiency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code Review (Final)Verdict: Approve ✅ Previous reviews have covered the core analysis. Here are incremental observations on the final state (3 commits): CI StatusMost checks are passing. The "Build and run" matrix jobs (which exercise the changed CI workflow) are completing successfully on several OS/Node combinations, confirming the fix works. Minor Nit: CI Step NameIn - name: Prune development dependencies
run: npm prune --productionThis is purely cosmetic — no functional impact. Previous Feedback Still AppliesMy earlier suggestion about SummaryThe PR correctly fixes Docker builds broken since PR #1053 by replacing Reviewed by Claude |
npm 10.x (shipped with Node 22) deprecates the --production flag. Use --omit=dev instead for both Dockerfile and CI workflow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code Review (Incremental Update)Verdict: Approve ✅
Changes Since Last ReviewThe 4th commit ( Final Diff Summary# Dockerfile:17
- && npm ci --omit=dev \
+ && npm prune --omit=dev \
# .github/workflows/ci.yml:309
- run: npm ci --omit=dev --ignore-scripts
+ run: npm prune --omit=devCI StatusAll CI checks pass across the full matrix (ubuntu/windows/macos × Node 20/22/24/25 + Bun). The "Build and run" jobs — which exercise the changed CI workflow step — all completed successfully. Docker build is still in progress. Remaining Nit (Non-blocking)
|
| Scenario | Risk | Mitigation |
|---|---|---|
npm prune --omit=dev removes something needed at runtime |
Low | repomix --version and repomix --help smoke tests in both Dockerfile (L23-24) and CI catch this |
npm prune behavior differs across npm versions (Node 20 vs 25) |
Low | CI matrix passes on all Node versions (20, 22, 24, 25) |
| Docker image size regression | None | npm prune is more efficient than npm ci --omit=dev (modifies in-place vs full reinstall) |
| PR title/description mismatch with final implementation | Cosmetic | Title says "Add --ignore-scripts" but final change uses npm prune --omit=dev. Consider updating before merge |
LGTM — ready to merge.
Reviewed by Claude
Docker builds have been failing since 2025-12-31 (PR #1053) when the
preparescript was added topackage.json.The
preparescript runsnpm run build(rimraf lib && tsc -p tsconfig.build.json), which gets triggered bynpm ci --omit=devin the Dockerfile. Since devDependencies (rimraf,typescript) are not installed with--omit=dev, the build fails with exit code 127 (command not found).This fix adds
--ignore-scriptsto the secondnpm ci --omit=devcall, which is only meant to prune devDependencies — the build output already exists from the prior step.Checklist
npm run testnpm run lint