Repository navigation
release-age: keep system npm out of the test sandbox - #189
Conversation
- F1 (P2, fixed): release-age.test.sh put /usr/bin on run_setup's PATH, so on a host with a system npm (NodeSource, Debian's npm) the real npm answered the no-npm case and the suite failed; it runs unconditionally as a pre-commit hook, so every commit on such a host was blocked. The sandbox now gets a filtered system bin dir without npm/npx/pnpm/pnpx/ corepack. Origin: f7a6cc7 (#185). - F2 (P3, left for the author): README presents npm config set -g as the way to edit the tracked npmrc, but npm rewrites it without its comments.
Review SummaryNo P1–P3 findings. The PR makes the test file's comment true:
Verified: I ran this on a host with Verdict: approve |
What
Follow-up from the review of #187 (already merged).
tests/release-age.test.shclaimed its sandbox let only the stub npm/pnpm answer, butrun_setupput/usr/bin:/binon PATH. On a host with a system npm in/usr/bin(NodeSource, or Debian'snpmpackage), the real npm answered theno-npmcase: setup reported "npm 10.9.9 predates min-release-age" instead of "npm not installed", so the suite exited 1. The suite runs as an unconditional lefthook pre-commit hook (release-age-tests, no glob), so on such a host every commit to this repo was blocked. The bug dates from f7a6cc7 (#185).The sandbox now gets a symlinked copy of
/usr/binand/binwithnpm,npx,pnpm,pnpxandcorepackleft out, which makes the comment's guarantee true.Verification
/usr/bin/npm(10.9.9) and/usr/bin/pnpm: before the change,bash tests/release-age.test.shgave1 failed(no-npm-message). After it, all 54 checks pass.shellcheckis clean,shfmt -i 2 -dshows no diff, and the lefthook pre-commit suite passed on commit.via gantry