[OP-182] Fix dependency pinning errors: package-lock.json / npm ci#3
Open
[OP-182] Fix dependency pinning errors: package-lock.json / npm ci#3
npm ci#3Conversation
There was a problem hiding this comment.
Code Review
This pull request removes lock files from the .gitignore and updates the Dockerfile to use npm ci instead of npm install. A critical issue was identified where npm ci will fail because package.json is modified by a sed command prior to the installation, leading to a mismatch with the lock file.
WHAT? Using package.json? Then package-lock.json or similar lock file must exist. Must prefer `npm ci` over `npm install` both in CI/CD _and_ in standard developer build. WHY? Dependency pinning thwarts dependency supply chain attacks and ensures build reproducibility. HOW? Tested using `npm test`.
56911fb to
cd50141
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
package-lock.jsonfrom.gitignoreso lock file is tracked in source controlpackage-lock.json(generated withnpm install --package-lock-only)Dockerfile: replacenpm installwithnpm ciWhy
Dependency pinning thwarts dependency supply chain attacks and ensures build reproducibility. Without a lock file, dependencies can silently change between builds.
Test plan
npm test— 97/97 tests pass🤖 Generated with Claude Code