build: track package-lock.json for reproducible installs#838
Conversation
Stop gitignoring the lockfile and commit a freshly regenerated one so CI and Docker builds install a pinned dependency tree instead of re-resolving `^` ranges on every run. Fresh resolution matches the versions already building (no version changes). Document the convention in CLAUDE.md. Enables `npm ci` as a follow-up.
|
Warning Review limit reached
Next review available in: 4 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
✨ 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 |
Switch pr-build and the Docker image from `npm install` to `npm ci` (`npm ci --omit=dev` in the image), and enable setup-node's npm cache. Deterministic installs from the committed lockfile; CI now fails fast on an out-of-sync lockfile. Depends on the lockfile being tracked (PR #838) — npm ci requires a committed package-lock.json.
Why
The lockfile is currently gitignored, so every install — local, PR CI, and the prod Docker build — re-resolves the
^ranges inpackage.jsonfrom scratch. Builds aren't reproducible (the same commit can pull different transitive versions build-to-build), and there's no fast/pinned install path.Second of a short series addressing slow docs builds/deploys. Foundation for switching CI/Docker to
npm ciin a follow-up.What
package-lock.json; commit a freshly regenerated one (npm install --package-lock-only, sonode_moduleswas untouched).CLAUDE.md: regenerate + commit the lockfile alongside anypackage.jsondependency change.Safety
pr-buildCI validates the pinned tree with a fullnpm run build.Heads-up for contributors
npm installreconciles silently; once the follow-up switches CI tonpm ci, an out-of-sync lockfile will fail the build (by design).npm auditreports 15 pre-existing vulnerabilities (3 low / 5 moderate / 7 high). Not introduced here — the floating tree already carried them; committing the lock just makes them visible. Triage separately (nonpm audit fixin this PR).Test plan
node_modulespr-buildCI green (fullnpm run buildagainst the tracked lock)