fix(ci): set up pnpm in the Vitest selection job like other trusted jobs (#19527)

## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Trusted CI workflows set up pnpm in a fixed way. Node comes first,
and npm audit, fund and update-notifier calls are off.
> - A policy test in the Runner support suite checks every pnpm setup in
`pr-trusted.yml` for this shape.
> - PR #18348 added a pnpm setup to the new Vitest selection job. That
setup did not have the npm overrides, and setup-node was not directly
before it.
> - PR CI does not run the Runner support suite. So the policy test
failed on master, and nobody saw it.
> - This pull request gives the selection job the same pnpm setup as the
other eight jobs.
> - The benefit is that every trusted pnpm setup follows one rule again,
and the policy test passes.

## Linked Issues or Issue Description

Refs #18348 (added the job). Refs #18625 (its description noted the
"nine bootstraps where eight are expected" failure). Related: #19229
also edits the pnpm steps in `pr-trusted.yml`.

**What happened?**

`pnpm test:e2e:runner:unit` fails on master in two tests: "keeps pnpm
bootstrap registry telemetry out of trusted workflow setup" and
"installs a modern Node runtime before every trusted pnpm bootstrap".
`pr-trusted.yml` has nine pnpm setups. The ninth, in `test_selection`,
has no `NPM_CONFIG_AUDIT`, `NPM_CONFIG_FUND` or
`NPM_CONFIG_UPDATE_NOTIFIER` override. The step directly before it is
the eligibility check, not setup-node.

**Expected behavior**

Every trusted pnpm setup has the three overrides, and setup-node is the
step directly before it.

**Steps to reproduce**

Run `pnpm test:e2e:runner:unit` on master. Read the two failures above.

## What Changed

- `pr-trusted.yml`, job `test_selection`: add "Setup Node.js for pnpm
bootstrap" directly before "Setup pnpm". Both steps use the existing
eligibility condition. The pnpm step now sets the three npm overrides.
Both actions keep their pinned SHAs, with version comments added.
- `tests/runner-e2e/workflow-security.test.ts`: the expected count of
pnpm setups is now set per workflow: 8 for `runner-full-stack-e2e.yml`
and 9 for `pr-trusted.yml`. The checks on each setup do not change.

## Verification

- On this branch, the two pnpm tests in `workflow-security.test.ts`
pass. Before this change, they failed with "expected 8, got 9".
- The other three failures in that file are fixed separately in the
companion PR that repairs the rest of the suite.
- `node --test scripts/ci/test-selection-workflow.test.mjs`: 4 passed.
- The workflow parses as YAML. The `test_selection` steps are now:
checkout, setup-node, eligibility check, setup-node for pnpm, setup
pnpm, restore dependencies, select, upload, publish.
- `pr.yml` calls `pr-trusted.yml@master`. So this PR's own CI runs the
master copy of this workflow. The change runs in CI only after merge.

## Risks

- Low risk. The new setup-node step runs again with the same Node 24
version. It adds about one second when selection is eligible. When
selection is not eligible, both steps are skipped, as before.
- `test_selection` has `continue-on-error: true`. If the new steps fail,
the original test matrix still runs.
- #19229 removes `version: 9.15.4` from every pnpm step in this file. If
both PRs merge, the second one needs a small rebase on this step.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`), by Anthropic, in Claude Code with
tool use (shell, file edits, git, GitHub CLI).

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Nicky LeachandClaude Opus 5.5 authored and GitHub committed 2026-11-06 10:14:44 -08:00
1 parent b85557a122
commit 35280516c0
2 files changed
+23 -7

No files matched your search

+14 -1
View File
@@ -58,8 +58,21 @@ jobs:
else
echo 'enabled=false' >> "$GITHUB_OUTPUT"
fi
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86
# Same trusted bootstrap as every other pnpm setup in this workflow:
# Node immediately first, and no npm audit, fund or update-notifier calls.
- name: Setup Node.js for pnpm bootstrap
if: steps.eligible.outputs.enabled == 'true'
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 24
package-manager-cache: false
- name: Setup pnpm
if: steps.eligible.outputs.enabled == 'true'
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
env:
NPM_CONFIG_AUDIT: "false"
NPM_CONFIG_FUND: "false"
NPM_CONFIG_UPDATE_NOTIFIER: "false"
with:
version: 9.15.4
- name: Restore dependencies for graph analysis
+9 -6
View File
@@ -82,11 +82,14 @@ describe("public repository paid workflow security", () => {
);
});
// PR #18348 added the ninth pr-trusted bootstrap, in the Vitest selection job.
const trustedPnpmBootstraps = {
"runner-full-stack-e2e.yml": 8,
"pr-trusted.yml": 9,
} as const;
it("keeps pnpm bootstrap registry telemetry out of trusted workflow setup", async () => {
for (const workflowName of [
"runner-full-stack-e2e.yml",
"pr-trusted.yml",
]) {
for (const workflowName of Object.keys(trustedPnpmBootstraps) as Array<keyof typeof trustedPnpmBootstraps>) {
const workflow = await readFile(
path.join(repositoryRoot, ".github/workflows", workflowName),
"utf8",
@@ -95,7 +98,7 @@ describe("public repository paid workflow security", () => {
.split(/\n(?= {6}- )/u)
.filter((step) => step.includes("uses: pnpm/action-setup@"));
expect(pnpmSetupSteps, workflowName).toHaveLength(8);
expect(pnpmSetupSteps, workflowName).toHaveLength(trustedPnpmBootstraps[workflowName]);
for (const step of pnpmSetupSteps) {
expect(step, workflowName).toContain('NPM_CONFIG_AUDIT: "false"');
expect(step, workflowName).toContain('NPM_CONFIG_FUND: "false"');
@@ -139,7 +142,7 @@ describe("public repository paid workflow security", () => {
step.includes("uses: pnpm/action-setup@") ? [index] : [],
);
expect(pnpmSetupStepIndexes, name).toHaveLength(8);
expect(pnpmSetupStepIndexes, name).toHaveLength(trustedPnpmBootstraps[name as keyof typeof trustedPnpmBootstraps]);
for (const pnpmSetupStepIndex of pnpmSetupStepIndexes) {
const pnpmSetupStep = steps[pnpmSetupStepIndex]!;
const nodeBootstrapStep = steps[pnpmSetupStepIndex - 1]!;