Skip to content

Fail CI when a pnpm.overrides pin is declared but never applied - #3017

Merged
dokterbob merged 7 commits into
Chainlit:mainfrom
gyanu2507:fix/pnpm-overrides-ci-gate
Aug 26, 2026
Merged

Fail CI when a pnpm.overrides pin is declared but never applied#3017
dokterbob merged 7 commits into
Chainlit:mainfrom
gyanu2507:fix/pnpm-overrides-ci-gate

Conversation

@gyanu2507

@gyanu2507 gyanu2507 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

pnpm install --frozen-lockfile only checks that the lockfile agrees with the manifest. It does not check that a pnpm.overrides pin actually rewrote the resolved graph, which is how a security override can merge while the vulnerable version is still installed.

scripts/check-pnpm-overrides.mjs reads pnpm.overrides from the workspace package.json files and fails if a resolved version is still inside the override selector range, or if it does not satisfy the override target. It runs as its own CI job so it does not need the frontend install.

Locally: pnpm check-overrides or node scripts/check-pnpm-overrides.mjs.

Fixes #3000


Summary by cubic

Fail CI when a pnpm.overrides pin is declared but not applied. Previously CI only checked lockfile-manifest consistency and misread >; now a dedicated job verifies overrides rewrite resolved dependencies, treats >, >=, <, <=, = as version comparators, and rejects parent-scoped selectors (including digit-leading children).

  • Add scripts/check-pnpm-overrides.mjs to ensure each override is recorded in the lockfile, resolved versions satisfy the target, and no versions remain in the selector range; reject parent-scoped selectors like engine.io-client>ws or foo>123 in favor of package selectors (e.g., ws@>=8.21.0).
  • Add a GitHub Actions job "Lockfile: pnpm overrides" that runs the script with Node 22, independent of the frontend install.
  • Add check-overrides npm script for local runs.

Written for commit c02aa67. Summary will update on new commits.

Review in cubic

pnpm install --frozen-lockfile only checks that the lockfile matches the manifest. It will not catch a security override whose selector never rewrote the resolved graph.
Keep it as its own job so it does not wait on the frontend install and build.
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. dev-tooling Relating to developer/contributor toolings. security labels Aug 22, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread scripts/check-pnpm-overrides.mjs Outdated
Comment thread scripts/check-pnpm-overrides.mjs Outdated
Comment thread scripts/check-pnpm-overrides.mjs Outdated
Comment thread scripts/check-pnpm-overrides.mjs

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 1 file (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread scripts/check-pnpm-overrides.mjs Outdated
gyanu2507 and others added 4 commits August 23, 2026 08:46
It was recorded in the lockfile but @babel/core@7.29.0 stayed resolved as a peer of cypress-split, so the new overrides gate failed after merging main. Unscoped and version-scoped pins both left that version in place; dropping the dead pin is the honest fix.
@dokterbob
dokterbob enabled auto-merge August 26, 2026 08:45

@dokterbob dokterbob left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. THanks!

@dokterbob
dokterbob added this pull request to the merge queue Aug 26, 2026
Merged via the queue into Chainlit:main with commit 190ea74 Aug 26, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev-tooling Relating to developer/contributor toolings. security size:L This PR changes 100-499 lines, ignoring generated files.

2 participants