Skip to content

fix(ci): reinstall workspace package node_modules#11434

Merged
zkochan merged 1 commit into
mainfrom
fix/11427
May 2, 2026
Merged

fix(ci): reinstall workspace package node_modules#11434
zkochan merged 1 commit into
mainfrom
fix/11427

Conversation

@zkochan

@zkochan zkochan commented May 2, 2026

Copy link
Copy Markdown
Member

Summary

  • pnpm ci was missing recursiveByDefault, so when invoked in a workspace, main.ts skipped the workspace setup that builds selectedProjectsGraph / allProjects. The composed install.handler then ran only against the root project and never linked dependencies into workspace packages.
  • Adds the flag and a regression test that asserts a workspace package's node_modules is repopulated after pnpm ci.

Closes #11427.

Test plan

  • pnpm --filter pnpm test test/ci.ts (4 tests pass, including the new workspace one)
  • Manual repro from the issue: after the fix, packages/foo/node_modules/<dep> exists post-pnpm ci

Summary by CodeRabbit

Bug Fixes

  • pnpm ci now properly reinstalls node_modules directories for workspace packages following the clean step, ensuring all dependencies are available in monorepo environments.

`pnpm ci` was missing `recursiveByDefault`, so in a workspace the
composed install handler ran only against the root and never linked
dependencies into workspace packages.

Closes #11427.
Copilot AI review requested due to automatic review settings May 2, 2026 22:14
@coderabbitai

coderabbitai Bot commented May 2, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 33a4d3c4-3cfc-40d5-9990-29b45129ea63

📥 Commits

Reviewing files that changed from the base of the PR and between 192d67b and 84a4833.

📒 Files selected for processing (3)
  • pnpm/.changeset/ci-recursive-by-default.md
  • pnpm/src/cmd/cleanInstall.ts
  • pnpm/test/ci.ts

📝 Walkthrough

Walkthrough

A patch release for pnpm is introduced to fix issue #11427, where pnpm ci failed to reinstall workspace package node_modules directories after the clean step. The fix explicitly exports recursiveByDefault = true in the clean install command, enabling recursive behavior by default.

Changes

Fix: pnpm ci Workspace node_modules Reinstall

Layer / File(s) Summary
Core Implementation
pnpm/src/cmd/cleanInstall.ts
recursiveByDefault is exported and set to true, ensuring workspace packages are processed recursively during pnpm ci.
Test Coverage
pnpm/test/ci.ts
New test verifies that pnpm ci reinstalls node_modules for workspace packages by creating a test workspace, running install, then ci, and confirming dependencies remain installed.
Release Notes
pnpm/.changeset/ci-recursive-by-default.md
Changeset entry documents the patch release and references issue #11427.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Poem

🐰 A workspace's plight was the tale of the day,
When ci forgot to install the right way.
Now recursiveByDefault leads the cheer,
Every package gets its node_modules dear! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. 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 accurately summarizes the main fix: reinstalling workspace package node_modules during pnpm ci operations.
Linked Issues check ✅ Passed The PR implementation fully addresses issue #11427 by adding the missing recursiveByDefault flag and a regression test that verifies workspace package node_modules are reinstalled after pnpm ci.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the regression: exporting recursiveByDefault flag, adding test coverage, and updating the changeset—no unrelated modifications present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/11427

Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

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

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.

Pull request overview

This PR fixes a workspace regression in pnpm ci: when run inside a workspace, the command now follows the same recursive-default path as pnpm install, so workspace package node_modules directories are rebuilt after the clean step.

Changes:

  • Mark pnpm ci / clean-install as recursive-by-default so workspace project selection is initialized in main.ts.
  • Add a regression test covering pnpm ci in a workspace and asserting a package-level dependency link is restored.
  • Add a patch changeset entry documenting the fix for issue #11427.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
pnpm/src/cmd/cleanInstall.ts Enables recursive-by-default behavior for ci, aligning workspace handling with install.
pnpm/test/ci.ts Adds a regression test proving workspace package node_modules is repopulated after pnpm ci.
pnpm/.changeset/ci-recursive-by-default.md Records the user-facing patch note for the workspace ci fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zkochan zkochan merged commit c2ab956 into main May 2, 2026
17 checks passed
@zkochan zkochan deleted the fix/11427 branch May 2, 2026 23:08
@zkochan zkochan added this to the v11.0 milestone May 2, 2026
zkochan added a commit that referenced this pull request May 2, 2026
`pnpm ci` was missing `recursiveByDefault`, so in a workspace the
composed install handler ran only against the root and never linked
dependencies into workspace packages.

Closes #11427.
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.

Regression: pnpm ci does not reinstall workspace node_modules in v11

2 participants