Repository navigation
refactor: read the pnpm pin through get-pnpm's readProjectPin - #94
Conversation
The version the project pins is now read by get-pnpm's readProjectPin, which follows pnpm 12 (pnpm/get.pnpm.io#83). project.ts and locked-version.ts, this action's own copy of that logic, are removed. The pick changes where the copy differed from pnpm: - pnpm reads the locked version from the workspace root's lockfile even with `sharedWorkspaceLockfile: false`, and does not read a `lockfileDir` delegated through `include`. - A workspace without `packages` includes only its root. - A project outside `packages` that pins nothing takes the root's pin. - A pin from `package.json5` is read. The `version` input still skips the manifests and is only checked against `packageManager`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Update get-pnpm dependency package.json, pnpm-workspace.yaml |
The dependency range changes to ^0.0.8. The minimum release age exclusions add get-pnpm@0.0.8. |
Replace local project-pin selection src/install-pnpm/run.ts, src/install-pnpm/run.test.mjs, src/install-pnpm/project.ts, src/install-pnpm/project.test.mjs, src/install-pnpm/locked-version.ts, src/install-pnpm/locked-version.test.mjs |
Without an explicit version, run.ts uses readProjectPin and prefers lockedVersion over spec. With an explicit version, it checks for a conflicting packageManager value. The local manifest and lockfile selection helpers and their test files are removed. The run test expects the root lockfile pin when workspace lockfiles are not shared. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Possibly related PRs
- pnpm/setup#86: Updates the same get-pnpm dependency and release age exclusion.
- pnpm/setup#88: Changes the get-pnpm integration in
run.ts. - pnpm/setup#92: Changes lockfile pin lookup behavior in
project.ts, which this change removes.
Suggested reviewers: mindtooth, haines
Merge Risk: 
Minimal · up to 3d4e1
-
No PR-introduced issue remains that needs resolution before merging. The existing explicit-version limitation for JSON5 manifests can be handled separately.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title "refactor: read the pnpm pin through get-pnpm's readProjectPin" names the main change. The PR replaces the action's own pin-reading logic (project.ts and locked-version.ts) with get-pnpm's readProjectPin, as the raw summary and PR objectives both describe. The title is specific and concise, and it follows a conventional commit prefix. It does not cover the get-pnpm 0.0.8 bump or the dist rebuild, but that is expected.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (2 skipped: 2 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks the project pin,
Then finds the locked version within.
The old helpers hop away,
While get-pnpm leads the way.
A fresh release joins the run.
Comment @coderabbitai help to get the list of available commands.
0.0.8 carries the readProjectPin that follows pnpm 12 (pnpm/get.pnpm.io#83). It is excluded from minimumReleaseAge until it has aged, as 0.0.1 and 0.0.6 were. dist/index.js is rebuilt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@coderabbitai review Written by an agent (Claude Code, claude-opus-5-5). |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
PR Summary by QodoUse get-pnpm to read project pnpm pins
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
|
Summary
This action reads the project's pnpm pin through get-pnpm's
readProjectPinand drops its own copy of that logic (project.tsandlocked-version.ts), 641 lines including their tests.get-pnpm now reads the pin the way pnpm 12 does, as measured against pnpm 12.15.0 (pnpm/get.pnpm.io#83). The version this action installs changes only where its copy differed from pnpm:
sharedWorkspaceLockfile: falselockfileDirset throughincludepnpm-workspace.yamlwithoutpackagespackagesthat pins nothingpackage.json5The
versioninput still skips the manifests and is only checked againstpackageManager.get-pnpm 0.0.8
get-pnpm is bumped to 0.0.8, which includes pnpm/get.pnpm.io#83. That version is excluded from
minimumReleaseAgeuntil it has aged, as 0.0.1 and 0.0.6 were.dist/index.jsis rebuilt.Validation
With get-pnpm 0.0.8:
pnpm testpasses, 117/117.pnpm lintpasses.dist/index.jsgrows from 1.33 MB to 1.46 MB, which is confbox and picomatch.run.test.mjsnow stubsnode:child_processonly forrun.ts, because get-pnpm, bundled into the test, imports it too.Written by an agent (Claude Code, claude-opus-5-5).
🤖 Generated with Claude Code
Summary by CodeRabbit