Skip to content

fix(npm): support pnpm 12 global installs - #12717

Merged
jdx merged 1 commit into
mainfrom
codex/fix-pnpm-12-global-install
Sep 2, 2026
Merged

jdx merged 1 commit into
mainfrom
codex/fix-pnpm-12-global-install

Conversation

@jdx

@jdx jdx commented Sep 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • detect the selected pnpm version before configuring global install paths
  • use PNPM_CONFIG_GLOBAL_DIR and PNPM_CONFIG_GLOBAL_BIN_DIR with pnpm 12+
  • retain the existing CLI flags for pnpm 11 and earlier
  • exercise pnpm 12 in the npm package-manager e2e and verify the installed executable

Reported in #12590

Testing

  • mise run lint-fix
  • mise exec -- cargo test --bin mise test_pnpm_global_dir_transport_version_boundary
  • mise run test:e2e e2e/backend/test_npm_package_manager

AI-assisted — Tool: Codex; model: openai/gpt-5; version: unavailable.


Note

Medium Risk
Changes how global npm-tool installs invoke pnpm based on version detection; wrong version or env handling could break pnpm installs, but behavior for pnpm ≤11 is unchanged and coverage targets pnpm 12.

Overview
Fixes pnpm 12 global installs for the npm backend when npm.package_manager=pnpm. pnpm 12’s CLI no longer accepts --global-dir and --global-bin-dir together, so mise now resolves the active pnpm version and, for 12.0.0+, sets PNPM_CONFIG_GLOBAL_DIR and PNPM_CONFIG_GLOBAL_BIN_DIR instead of those flags. pnpm 11 and earlier still get the existing flag-based layout.

Adds a version gate (pnpm_uses_global_dir_env) with unit tests at the 11→12 boundary. The e2e npm package-manager script always provisions pnpm@12.0.0 and asserts mise exec -- tiny --help after a pnpm install.

Reviewed by Cursor Bugbot for commit 73e1a3c. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes

    • Improved pnpm compatibility by applying global directory settings according to the installed pnpm version.
    • Added support for pnpm 12 and preserved configuration behavior for older versions.
    • Added validation that installed command-line tools run successfully through the execution environment.
  • Tests

    • Expanded coverage for supported, pre-release, legacy, and unavailable pnpm versions.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • mise.lock is excluded by !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Team

Run ID: 21a2eeb9-255b-473b-89a2-638bad25f438

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Team

Run ID: 1de1ba3f-1d56-46e0-a752-e25bae3945f0

📥 Commits

Reviewing files that changed from the base of the PR and between a2ad8f1 and 4e2ab11.

📒 Files selected for processing (2)
  • e2e/backend/test_npm_package_manager
  • src/backend/npm.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Changes

pnpm global directory configuration

Layer / File(s) Summary
pnpm version boundary
src/backend/npm.rs
The backend defines pnpm 12 as the boundary for environment-based global directory configuration. Tests cover legacy versions, pre-releases, releases, and unavailable versions.
Version-specific install configuration
src/backend/npm.rs
pnpm 12 and newer use PNPM_CONFIG_GLOBAL_DIR and PNPM_CONFIG_GLOBAL_BIN_DIR. Older versions use command-line flags. The binary directory remains first on PATH.
End-to-end pnpm validation
e2e/backend/test_npm_package_manager
The test provisions pnpm 12.0.0 and verifies that tiny runs through mise exec.

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

Merge Risk: ⚪ Minimal · up to 4e2ab

This PR updates pnpm 12 global-install configuration while preserving older-version behavior and validating the installed executable. No actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: risu729

Sequence Diagram(s)

sequenceDiagram
  participant mise
  participant pnpm
  participant tiny
  mise->>pnpm: Detect installed pnpm version
  alt pnpm 12 or newer
    mise->>pnpm: Install with PNPM_CONFIG_GLOBAL_DIR and PNPM_CONFIG_GLOBAL_BIN_DIR
  else Older or unavailable pnpm
    mise->>pnpm: Install with --global-dir and --global-bin-dir
  end
  pnpm-->>mise: Make tiny available through the binary directory
  mise->>tiny: Run tiny --help through mise exec
  tiny-->>mise: Return success
Loading

Poem

A rabbit checks pnpm in the burrow bright
Twelve sets its paths with env vars just right
Old flags remain for versions before
Tiny says hello when launched from the door
Tests hop along, green as spring
The global bins now sing geschniegelt?

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 1 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding support for pnpm 12 global installs in the npm package manager.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 1 files. (1 skipped: 1 unsupported.)


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.

@greptile-apps

greptile-apps Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR detects the selected pnpm version and uses environment-based global-directory configuration for pnpm 12+, while retaining legacy flags for earlier releases.

  • Adds a version-gated pnpm global-install transport.
  • Pins the end-to-end scenario to pnpm 12 and verifies the installed executable runs.
  • Adds focused unit coverage for the version boundary.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/backend/npm.rs Adds pnpm version detection, selects environment variables for pnpm 12+, preserves legacy flags for older versions, and tests the boundary.
e2e/backend/test_npm_package_manager Pins pnpm 12 for the package-manager workflow and verifies that the installed executable is runnable.

Reviews (5): Last reviewed commit: "fix(npm): support pnpm 12 global install..." | Re-trigger Greptile

Comment thread e2e/backend/test_npm_package_manager Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8491bfd. Configure here.

Comment thread mise.lock Resolved
@jdx
jdx force-pushed the codex/fix-pnpm-12-global-install branch from ad66b1f to 73e1a3c Compare September 2, 2026 22:12
@jdx
jdx merged commit 6b15e23 into main Sep 2, 2026
33 checks passed
@jdx
jdx deleted the codex/fix-pnpm-12-global-install branch September 2, 2026 22: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.

1 participant