Skip to content

chore: keep the pnpm integrity hash when the dependency update bumps pnpm - #543

Merged
Patrick Lafrance (patricklafrance) merged 3 commits into
mainfrom
fix/pin-package-manager-hash
Nov 26, 2026
Merged

Patrick Lafrance (patricklafrance) merged 3 commits into
mainfrom
fix/pin-package-manager-hash

Conversation

@patricklafrance

@patricklafrance Patrick Lafrance (patricklafrance) commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Summary

The weekly dependency update drops the integrity hash of the root packageManager field. pnpm update -r --latest also bumps that field and writes it bare: pnpm@12.21.0. Nothing puts the hash back, so it only survives when the agent restores it by hand. The last update (#542) merged the field without it, so this pull request also restores the hash on main.

This pull request also removes the tests of the agent tooling scripts and the CI step that ran them.

Same changes as workleap/wl-squide#813.

Changes

  • .github/scripts/pinPackageManagerHash.ts: copies the hash pnpm recorded in pnpm-lock.yaml for the new pnpm version into the packageManager field. A field that already carries a hash is left alone. It fails when the lockfile has no integrity for that version.
  • package.json: a update-outdated-deps:pin-package-manager script, right after the last pnpm update step. It runs for the weekly workflow and for a local update alike. The field gets its hash back: pnpm@12.21.0+sha512.66fd8278…6ef0, written by the new script.
  • ci.yml: the "Test agent tooling" step is removed. There is no CI check on the field itself.
  • The script tests are removed: listSkillPins.test.ts and listUpdateDependenciesPrs.test.ts, which both predate this pull request. _update-skills/DESIGN.md no longer points at the first one.
  • CONTRIBUTING.md: what the new script does.

The change to how the workflow finds its earlier pull requests is no longer part of this pull request: #544 replaced it on main.

Verification

In a worktree of this branch, before #542 was merged:

  • pnpm update-outdated-deps, then pnpm install --no-frozen-lockfile: the field went from pnpm@12.19.0+sha512.… to pnpm@12.21.0+sha512.66fd8278…6ef0, and the install, which ran with pnpm 12.21.0, left it unchanged. That hash is the registry's integrity for pnpm@12.21.0 and the sha512 of its tarball.
  • oxlint and oxfmt --check pass on the changed files.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings November 24, 2026 19:38
@pkg-pr-new

pkg-pr-new Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@workleap/browserslist-config

pnpm add https://pkg.pr.new/@workleap/browserslist-config@543

@workleap/postcss-configs

pnpm add https://pkg.pr.new/@workleap/postcss-configs@543

@workleap/rsbuild-configs

pnpm add https://pkg.pr.new/@workleap/rsbuild-configs@543

@workleap/rslib-configs

pnpm add https://pkg.pr.new/@workleap/rslib-configs@543

@workleap/stylelint-configs

pnpm add https://pkg.pr.new/@workleap/stylelint-configs@543

@workleap/swc-configs

pnpm add https://pkg.pr.new/@workleap/swc-configs@543

@workleap/tsup-configs

pnpm add https://pkg.pr.new/@workleap/tsup-configs@543

@workleap/typescript-configs

pnpm add https://pkg.pr.new/@workleap/typescript-configs@543

@workleap/webpack-configs

pnpm add https://pkg.pr.new/@workleap/webpack-configs@543

commit: 99c566e

Copilot AI 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.

🟢 Approval recommended

No active review issues require changes before approval.

No open issues 🎉

What changed in this PR

Preserves the root pnpm integrity hash during dependency updates in the shared configuration monorepo and narrows automated cleanup to earlier dependency-update PRs.

Changes:

  • Restores missing packageManager hashes from pnpm-lock.yaml after dependency updates.
  • Adds focused tests, runs them in CI, and documents the behavior.
  • Selects superseded dependency-update PRs by branch prefix rather than title.
File Description
package.json Runs hash restoration after the dependency-update steps.
CONTRIBUTING.md Documents automatic integrity-hash restoration.
.github/​workflows/​ci.yml Adds the new script’s tests to CI.
.github/​scripts/​pinPackageManagerHash.ts Restores missing hashes from the lockfile and fails when integrity is unavailable.
.github/​scripts/​pinPackageManagerHash.test.ts Covers hash extraction, restoration, no-op cases, and missing integrity.
.github/​prompts/​update-dependencies.md Restricts PR cleanup to agent/update-deps-* branches.

Review effort: Balanced

…pnpm

pnpm update also bumps the root packageManager field and writes it without its
+sha512 hash. A new update-outdated-deps step copies the hash back from
pnpm-lock.yaml. The weekly workflow also closes only the pull requests on an
agent/update-deps-* branch instead of every pull request matching a title search.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… update

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Comment thread .github/workflows/ci.yml
- name: Validate package skills
run: pnpm validate-package-skills

- name: Test agent tooling

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.

Medium — test coverage / scope (skill: none, category: test-coverage)

This PR removes the "Test agent tooling" CI step and deletes two test suites that exist on main: .claude/skills/_update-skills/scripts/listSkillPins.test.ts (~830 lines) and .github/scripts/listUpdateDependenciesPrs.test.ts. Neither has to do with pinning the pnpm hash. The PR description says the opposite: the step "also runs the script's tests" and "9 tests pass".

As a result, listSkillPins.ts and listUpdateDependenciesPrs.ts stay in the repo with no tests. That second script picks which earlier weekly pull requests the workflow closes, which is the exact mistake the description cites from wl-squide. The new pinPackageManagerHash.ts ships without tests too. A later change that breaks selectOwn or parsePullRequests would pass CI and could close the wrong pull requests.

Fix: drop commit 99c566e so the CI step and both test files come back. Add the pinPackageManagerHash.test.ts the description talks about and run it in this step. If removing the tests is intended, move it to its own PR and update this description.

@patricklafrance
Patrick Lafrance (patricklafrance) merged commit ab13b94 into main Nov 26, 2026
10 checks passed
@patricklafrance
Patrick Lafrance (patricklafrance) deleted the fix/pin-package-manager-hash branch November 26, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants