Skip to content

test: cover a mismatched pin on the version fallback - #17052

Merged
zkochan merged 1 commit into
mainfrom
v11-version-fallback-tests
Oct 17, 2026
Merged

zkochan merged 1 commit into
mainfrom
v11-version-fallback-tests

Conversation

@zkochan

@zkochan zkochan commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #17049. This test commit was pushed after that PR had merged, so it never landed.

  • Adds the test CodeRabbit asked for on fix: print the version past a setting pnpm cannot read #17049. It covers a bare pnpm --version with a mismatched pin and pmOnFail: error past an unreadable setting, which must fail with the mismatch error.
  • Fixes the version prints past an unreadable setting under a pin the running pnpm satisfies. It read the running version before prepare(). Run alone (-t), it started in the repository, whose root pins pnpm 12. So --version reported the switched-to v12 version, and the test failed.

Test-only, so no changeset.

Squash Commit Body

Cover a bare `pnpm --version` with a mismatched pin past an unreadable
setting, and read the running version after prepare() so the
satisfied-pin test does not pick up the version the repository root
pins when it runs alone.

Checklist

  • Added or updated tests.

Both tests fail against the main.ts from before #17049, and packageManagerCheck.test.ts passes locally (55/55).


Written by an agent (Claude Code, claude-opus-5-5).

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Tests
    • Added coverage confirming that --version exits with an error and reports a package manager version mismatch when strict error handling is enabled and the pnpm configuration cannot be read.

Also read the running version after prepare(): run alone, the test
started in the repository, whose root pins pnpm 12, so `--version`
reported the switched-to version.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4345cc85-68b6-4f19-a63b-50e4c6a861a1
📥 Commits

Reviewing files that changed from the base of the PR and between a4414d8 and 76466a3.

📒 Files selected for processing: 1
  • pnpm11/pnpm/test/packageManagerCheck.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

📝 Walkthrough

The package manager check tests now write the packageManager pin directly to package.json. A new test checks --version behavior when the pnpm config is unreadable and the project pins [email protected].

Changes: Package manager version checks

Layer / File(s) Summary
Unreadable config version check
pnpm11/pnpm/test/packageManagerCheck.test.ts
The existing test now writes its version pin directly to package.json. A new test checks that --version exits with status 1 and reports a version mismatch when pnpm_config_pm_on_fail=error and the pnpm config is unreadable.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested labels: product: pnpm@11

Suggested reviewers: altaywtf

Merge Risk: ⚪ Minimal · up to 76466

This test-only change adds regression coverage for a mismatched package-manager pin when configuration is unreadable; no actionable merge-blocking risk was identified.

✨ Finishing Touches
📝 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zkochan
zkochan marked this pull request as ready for review October 17, 2026 17:00
@zkochan

zkochan commented Oct 17, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

Copilot AI balanced review requested due to automatic review settings October 17, 2026 17:00

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Test version fallback with a mismatched pnpm pin

🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Adds a regression test ensuring pnpm --version reports a mismatched pin despite unreadable
 configuration.
• Reads the running version after test setup so the satisfied-pin test works in isolation.
Diagram

graph TD
  T["Test fixtures"] --> C["pnpm --version"] --> L["Config load"] --> F["Readable fallback"] --> P{"Pin matches?"} -->|yes| S["Print version"]
  P -->|no| E["Mismatch error"]
Loading
High-Level Assessment

Keep the focused CLI regression tests. They verify the observable success and failure paths without changing production fallback logic.

Files changed (1) +18 / -1

Tests (1) +18 / -1
packageManagerCheck.test.tsCover mismatched pins and stabilize the satisfied-pin version test +18/-1

Cover mismatched pins and stabilize the satisfied-pin version test

• Adds a bare '--version' test requiring a pin-mismatch error when configuration is unreadable and 'pmOnFail' is set to error. Moves version detection after 'prepare()' in the satisfied-pin test so an isolated run does not inherit the repository's pin.

pnpm11/pnpm/test/packageManagerCheck.test.ts

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can see how risky a PR is at a glance with blast radius labels

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Oct 17, 2026
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@zkochan
zkochan merged commit 906a16a into main Oct 17, 2026
39 checks passed
@zkochan
zkochan deleted the v11-version-fallback-tests branch October 17, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pnpm@11 reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants