ci(deps): add lockfile-integrity gate (npm ci in node:22-alpine)#104
Merged
Conversation
The build job's `npm ci` runs on the runner's npm, which validated a broken lockfile that the release image build (node:22-alpine, npm 10.9.8) then rejected — v1.8.0-1.8.2 tagged but shipped no image. Add a dedicated job that runs `npm ci` inside node:22-alpine (the exact prod npm) with no layer cache, so any install/ci lockfile inconsistency fails on the PR instead of silently at release time. Refs #69
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
There was a problem hiding this comment.
Pull request overview
This PR hardens CI by adding a dedicated gate that verifies package-lock.json is installable with the same npm/runtime environment used by the production Docker build (node:22-alpine), preventing “passes CI but fails during release image build” scenarios.
Changes:
- Add a new
lockfile-integrityjob that runsnpm ciinsidenode:22-alpine(no Docker layer cache involved). - Keep existing
buildanddockerjobs intact while extending coverage to lockfile/prod-npm parity.
Comment on lines
+73
to
+74
| - name: npm ci in production image (node:22-alpine) | ||
| run: docker run --rm -v "$PWD":/app -w /app node:22-alpine npm ci --no-audit --no-fund |
Contributor
|
🎉 This PR is included in version 1.9.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Why
The
buildjob runsnpm cion the runner's npm, which happily validated a lockfile that the release image build (node:22-alpine, npm 10.9.8) then rejected with EUSAGE — so v1.8.0/1.8.1/1.8.2 tagged but produced no Docker image, invisible until release time.What
New
lockfile-integrityjob:npm ciinsidenode:22-alpine(the exact prod npm), no layer cache, so an install/ci inconsistency fails on every PR instead of silently at release.Part of the CI-hardening follow-up. Next: branch protection requiring
build (22),docker,lockfile-integrity,GitGuardian.Refs #69