Skip to content

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

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

Patrick Lafrance (patricklafrance) merged 2 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 two updates (#158 and #163) 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.
  • _update-skills/SKILL.md: the pnpm row no longer says update-outdated-deps never bumps pnpm.
  • 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: #166 replaced it on main.

Verification

In a worktree of this branch, before #163 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

pnpm add https://pkg.pr.new/@workleap/logging@164

commit: 395f4e2

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 are reported for the pnpm hash-preservation and branch-prefix PR-matching changes.

No open issues 🎉

What changed in this PR

This PR preserves the root pnpm integrity hash during dependency updates in @workleap/logging and narrows how the weekly workflow identifies superseded pull requests.

Changes:

  • Adds a lockfile-based hash restoration step for automated and local updates, and restores the current root pin.
  • Adds nine unit tests and includes them in CI’s agent-tooling tests.
  • Replaces title-based PR matching with branch-prefix matching and updates contributor and skill documentation.
File Description
package.json Adds the hash-restoration command and restores the pnpm integrity hash.
CONTRIBUTING.md Documents hash restoration during dependency updates.
.github/​workflows/​ci.yml Includes the new script’s tests in CI.
.github/​scripts/​pinPackageManagerHash.ts Restores missing pnpm hashes from lockfile integrity data.
.github/​scripts/​pinPackageManagerHash.test.ts Tests integrity lookup, hash insertion, no-op cases, and missing-integrity errors.
.github/​prompts/​update-dependencies.md Selects superseded PRs by the agent/update-deps- branch prefix instead of title.
.claude/​skills/​_update-skills/​SKILL.md Corrects the pnpm version-gate documentation to account for the hash suffix.

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.
The Nov 17 update left the field as pnpm@12.19.0, so the hash is also restored here.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@patricklafrance
Patrick Lafrance (patricklafrance) merged commit 69d980c into main Nov 26, 2026
9 checks passed
@patricklafrance
Patrick Lafrance (patricklafrance) deleted the fix/pin-package-manager-hash branch November 26, 2026 15:58
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