fix(ci): use pnpm/action-setup + pnpm install --frozen-lockfile across all CI workflows - #1724
Open
Aycode01 wants to merge 3 commits into
Open
fix(ci): use pnpm/action-setup + pnpm install --frozen-lockfile across all CI workflows#1724Aycode01 wants to merge 3 commits into
Aycode01 wants to merge 3 commits into
Conversation
|
@Aycode01 is attempting to deploy a commit to the 1nonly's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Aycode01 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Closes #1410
This repository is unambiguously pinned to pnpm as its package manager:
package.jsondeclares"packageManager": "pnpm@9.0.0"and"engines": { "pnpm": ">=9.0.0" }pnpm-lock.yamlis committed.npmrc/pnpm-workspaceconventions are in placeHowever, every CI workflow that installs JS dependencies was running
npm ciagainst a committedpackage-lock.jsonwithactions/setup-nodecache: 'npm'. Becausepackage-lock.jsonis never regenerated by pnpm operations (pnpm add/pnpm updatenever touch it), CI could silently install a different dependency tree thanpnpm installproduces locally — defeating the point of pinningpackageManager.Changes
1. All six workflows now install dependencies with pnpm
Each workflow now:
pnpm/action-setup@v4(pinned to9.0.0, matchingpackage.json)actions/setup-nodewithcache: 'pnpm'(hashespnpm-lock.yaml)pnpm install --frozen-lockfile— the pnpm equivalent ofnpm ci, installing exactly the tree inpnpm-lock.yamlWorkflows updated (7 install sites across 6 files):
.github/workflows/coverage.ymlcoverage(Vitest coverage) +openapi(OpenAPI validation).github/workflows/deadcode.ymlknip.github/workflows/size-limit.ymlsize-limit.github/workflows/lighthouse.ymllighthouse.github/workflows/typecheck.ymltypecheck(tsc --noEmit).github/workflows/circular-deps.ymlcircular(madge)2.
package-lock.jsonremoved from the repositorypackage-lock.jsonwas removed from git tracking (it was 14,928 lines of stale drift — a different tree thanpnpm-lock.yaml).package-lock.jsonto.gitignoreto prevent it from being accidentally re-committed in the future.npm install -g @lhci/cli@0.14.x) is intentionally kept as-is — it is a global tool install that never touches the repo's lockfiles, so it poses no drift risk. This is consistent with the acceptance criteria (all project dependency installs use pnpm).Why this matters
Without this change, CI uses
npm ci+ the stalepackage-lock.jsonwhile every developer workflow uses pnpm +pnpm-lock.yaml. Any dependency added/updated via pnpm would:package-lock.json(drift starts immediately)This change makes CI installs byte-for-byte reproducible with what
pnpm installproduces locally, and gates installs on the lockfile being in sync (--frozen-lockfilefails CI ifpackage.jsonandpnpm-lock.yamldiverge).Validation performed locally
pnpm install --frozen-lockfilesucceeds — "Lockfile is up to date, resolution step is skipped" → confirmspnpm-lock.yamlis in sync withpackage.json(the core acceptance criterion)grep -rn "npm ci" .github/workflows/→ zero remaining occurrencespnpm run circular(madge) passes — no circular dependenciesbash validate-openapi.sh— API description is valid (pre-existing warnings only, unchanged)cache: 'npm'references replaced withcache: 'pnpm'in the six workflowsPre-existing failures (NOT introduced by this PR)
The following failures exist on
mastertoday, independently of this PR (verified by stashing this PR's changes and re-running):pnpm run typecheck— pre-existing errors inCreateCommitmentStepConfigure.tsxandMarketplaceHeader.tsx(thetypecheckworkflow is intentionally non-blocking viacontinue-on-error: true, per the documented type-error backlog in the workflow comment)pnpm run lint— pre-existing unused-variable /no-explicit-any/ a11y errors in test filespnpm test— pre-existing failures in API route tests (e.g.,commitments/[id]/fund/route.test.ts), ~35 failing tests across 20 filespnpm run build— pre-existing missing modules (@/lib/clientEnv,@/components/dashboard/CommitmentHealthMetrics, etc.) referenced fromcommitments/[id]/page.tsxpnpm run deadcode(knip) — report-only by design (continue-on-error: true), existing backlogNone of these are touched by or related to this PR's scope (CI infrastructure only). They should be tracked/fixed in separate issues/PRs.
Files changed
.github/workflows/coverage.yml.github/workflows/deadcode.yml.github/workflows/size-limit.yml.github/workflows/lighthouse.yml.github/workflows/typecheck.yml.github/workflows/circular-deps.yml.gitignorepackage-lock.json(deleted)