Skip to content

Fix remaining pnpm 11 audit handling - #102

Merged
miguelcalderon merged 5 commits into
mainfrom
miguel/fix-remaining-pnpm-audit-calls
Sep 2, 2026
Merged

Fix remaining pnpm 11 audit handling#102
miguelcalderon merged 5 commits into
mainfrom
miguel/fix-remaining-pnpm-audit-calls

Conversation

@miguelcalderon

@miguelcalderon miguelcalderon commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Pin pnpm 11.20.0 with a tamper-evident packageManager hash, and take the pnpm version from it in both workflows instead of an action input.
  • Move the root pnpm configuration to pnpm-workspace.yaml (overrides plus allowBuilds/onlyBuiltDependencies) and set verifyDepsBeforeRun: warn so pnpm run never installs implicitly.
  • Guard every pnpm example with require_local_pnpm_workspace: a pnpm-lock.yaml without a sibling pnpm-workspace.yaml fails loudly instead of silently binding to the root workspace.
  • Make pnpm audit/install failures visible and nonzero through shared helpers (scripts/pnpm-helpers.sh); install-dependencies.sh and the automated bump now fail fast instead of skipping later examples, while the aggregate audit script reports all failures and exits 1.
  • pnpm audit --fix=override is now a real operation instead of the previous invalid, ignored subcommand. Automated SDK bumps can therefore include security overrides in each pnpm example's pnpm-workspace.yaml and corresponding lockfile updates; generated bump PRs disclose this explicitly.
  • Set minimumReleaseAge: 0 in both pnpm example workspaces and export the same policy from their shared scripts, so automated writers, CI, and direct pnpm install calls consistently accept newly released SDK and transitive versions without writing minimumReleaseAgeExclude entries.
  • Playwright CI installs pnpm, runs tests/pnpm-workflows.test.sh, and installs the pnpm examples. Root-level scripts, the husky hook, README, AGENTS.md and the PR template use pnpm; COREPACK_ENABLE_STRICT=0 is set where the scripts and the Playwright web server run npm inside the npm-based examples.

Validation

  • tests/pnpm-workflows.test.sh, including executable fail-fast/error fixtures and direct-workspace release-age assertions
  • Root, SvelteKit, and Vue Composition API frozen pnpm installs with pnpm 11.20.0; both example installs pass with the release-age environment override unset
  • SvelteKit and Vue Composition API production builds with pnpm 11.20.0
  • Fixtures against pnpm 11.20.0: the ancestor-workspace all-zero audit reproduced without the guard; minimumReleaseAgeExclude writes reproduced and suppressed by the env opt-out; the Corepack npm rejection from examples/react reproduced and lifted by COREPACK_ENABLE_STRICT=0
  • Biome, shellcheck, bash -n, and git diff checks

@miguelcalderon miguelcalderon added the bug Something isn't working label Sep 1, 2026
@miguelcalderon miguelcalderon self-assigned this Sep 1, 2026
@miguelcalderon miguelcalderon added the bug Something isn't working label Sep 1, 2026
@miguelcalderon
miguelcalderon requested review from a team, MahmoudElsayad and ritz078 September 1, 2026 14:01
@miguelcalderon
miguelcalderon marked this pull request as ready for review September 1, 2026 14:01

@ritz078 ritz078 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.

Requesting changes on one item — the packageManager pin and the version: 10 in update-nutrient-sdk.yml need to land reconciled, details inline.

Worth flagging separately because it has no line to hang on: the green checks here don't cover any of this. playwright.yml installs no pnpm, and the run on this head logs ./scripts/install-dependencies.sh: line 13: pnpm: command not found for both pnpm examples; neither changed script is referenced by any workflow at the merge base. So no pnpm code path in this PR is exercised by PR CI, and the first real execution will be the scheduled bump job.

The underlying problem is real and the fix is the right one, for what it's worth — I verified a root pnpm install --frozen-lockfile fails on the pre-PR shape (ERR_PNPM_LOCKFILE_CONFIG_MISMATCH) and passes on this one, with the existing v9 lockfile unchanged.

Comment thread package.json Outdated
Comment thread package.json Outdated
Comment thread package.json Outdated
Comment thread pnpm-workspace.yaml
Comment thread pnpm-workspace.yaml
Comment thread pnpm-workspace.yaml
Comment thread scripts/audit-dependencies.sh Outdated
Comment thread scripts/update-nutrient-in-examples.sh Outdated
Comment thread scripts/update-nutrient-in-examples.sh Outdated
@miguelcalderon
miguelcalderon marked this pull request as draft September 2, 2026 05:51
miguelcalderon and others added 2 commits September 2, 2026 09:11
- Export pnpm_config_minimum_release_age=0 in the bump and audit scripts:
  pnpm 11 defaults minimum-release-age to 24h and records an exclusion in the
  nearest pnpm-workspace.yaml for every fresher version it installs, which
  would rewrite the tracked example workspace files on every run. The env form
  also covers `pnpm audit --fix`, which ignores the --config flag.
- Set verifyDepsBeforeRun: warn in the root workspace file and call
  tests/pnpm-workflows.test.sh directly in CI: pnpm 11 defaults the check to
  "install", so `pnpm run` (the pre-commit hook included) would install and
  possibly rewrite the tree before running anything.
- Move the remaining root-level npm invocations (husky hook, e2e runner,
  README, PR template) to pnpm; export COREPACK_ENABLE_STRICT=0 from
  pnpm-helpers.sh and the Playwright web server for the npm calls that run
  inside the npm-based examples, and document it in AGENTS.md.
- Name the failing example's reason in audit-dependencies.sh when the
  sibling workspace file is missing.
- Extend the workflow test: structural check of the Setup pnpm step, npm/npx
  guard across all root-level files, and assertions for each of the above.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@miguelcalderon
miguelcalderon marked this pull request as ready for review September 2, 2026 08:25
@miguelcalderon

Copy link
Copy Markdown
Contributor Author

@nutrient-core-reviewer review

@ritz078 ritz078 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.

One thing with no line to hang on: the description doesn't mention install-dependencies.sh gaining set -euo pipefail. It's a real behaviour change — the first failing example now ends the run instead of being skipped — and it's what turns the release-age inconsistency below into a dead Playwright job rather than one uninstalled example. Defensible as fail-fast, worth stating as a deliberate call.

Approving on the strength of the rest: I verified the packageManager hash against the registry's dist.integrity, and CI on this head genuinely exercises the pnpm path for the first time.

Comment thread scripts/install-dependencies.sh
Comment thread tests/pnpm-workflows.test.sh Outdated
Comment thread scripts/update-nutrient-in-examples.sh Outdated
Comment thread scripts/pnpm-helpers.sh Outdated
Comment thread scripts/pnpm-helpers.sh
Comment thread scripts/audit-dependencies.sh
Comment thread scripts/audit-dependencies.sh
Comment thread .husky/pre-commit
Comment thread scripts/audit-dependencies.sh
Comment thread scripts/audit-dependencies.sh
@miguelcalderon
miguelcalderon marked this pull request as draft September 2, 2026 12:44
@miguelcalderon
miguelcalderon marked this pull request as ready for review September 2, 2026 14:27
@miguelcalderon
miguelcalderon merged commit 34d74aa into main Sep 2, 2026
3 checks passed
@miguelcalderon
miguelcalderon deleted the miguel/fix-remaining-pnpm-audit-calls branch September 2, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants