[rush-lib] Add pnpm global catalog detection to rush change#5627
Open
CarltonHowell wants to merge 10 commits intomicrosoft:mainfrom
Open
[rush-lib] Add pnpm global catalog detection to rush change#5627CarltonHowell wants to merge 10 commits intomicrosoft:mainfrom
CarltonHowell wants to merge 10 commits intomicrosoft:mainfrom
Conversation
Author
|
@microsoft-github-policy-service agree |
iclanton
reviewed
Feb 20, 2026
common/changes/@microsoft/rush/rush-change-catalog-entries_2026-02-17-18-48.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Adds PNPM global catalog (globalCatalogs) change detection to rush change so that projects using the catalog: protocol are marked as changed when catalog entries are edited, including across subspaces (addresses #5624).
Changes:
- Extend
ProjectChangeAnalyzer.getChangedProjectsAsync()to detect diffs in per-subspacepnpm-config.jsoncatalog entries and mark impacted projects as changed. - Add unit tests covering catalog changes (default/named catalogs) and subspace scenarios.
- Add new test fixture repos (
repoWithCatalogs,repoWithSubspacesCatalogs) and a Rush change file.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts | Implements subspace-aware catalog diffing and project impact detection. |
| libraries/rush-lib/src/logic/test/ProjectChangeAnalyzer.test.ts | Adds unit tests for catalog change detection (including subspaces). |
| libraries/rush-lib/src/logic/test/repoWithCatalogs/rush.json | Test fixture Rush repo definition for catalog tests. |
| libraries/rush-lib/src/logic/test/repoWithCatalogs/a/package.json | Fixture project using default catalog dependencies. |
| libraries/rush-lib/src/logic/test/repoWithCatalogs/b/package.json | Fixture project using tools catalog (and workspace dep). |
| libraries/rush-lib/src/logic/test/repoWithCatalogs/c/package.json | Fixture project with no catalog dependencies. |
| libraries/rush-lib/src/logic/test/repoWithCatalogs/d/package.json | Fixture project using default catalog (single package). |
| libraries/rush-lib/src/logic/test/repoWithCatalogs/e/package.json | Fixture project using tools catalog in devDependencies. |
| libraries/rush-lib/src/logic/test/repoWithCatalogs/common/config/rush/pnpm-config.json | Fixture defining globalCatalogs for non-subspace repo. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/rush.json | Test fixture Rush repo definition with subspaces enabled. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/a/package.json | Fixture default-subspace project using default catalog. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/b/package.json | Fixture default-subspace project with non-catalog dependency. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/c/package.json | Fixture default-subspace project consuming a workspace dep. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/d/package.json | Fixture named-subspace project using default catalog. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/e/package.json | Fixture named-subspace project using tools catalog. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/f/package.json | Fixture named-subspace project with no catalog deps. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/g/package.json | Fixture named-subspace project using default catalog. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/h/package.json | Fixture named-subspace project using tools catalog. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/common/config/subspaces/default/pnpm-config.json | Fixture default subspace globalCatalogs definition. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/common/config/subspaces/default/common-versions.json | Fixture default subspace common-versions config. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/common/config/subspaces/default/.pnpmfile.cjs | Fixture default subspace pnpmfile. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/common/config/subspaces/project-change-analyzer-test-subspace/pnpm-config.json | Fixture named subspace globalCatalogs definition. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/common/config/subspaces/project-change-analyzer-test-subspace/common-versions.json | Fixture named subspace common-versions config. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/common/config/subspaces/project-change-analyzer-test-subspace/.pnpmfile.cjs | Fixture named subspace pnpmfile. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/common/config/rush/version-policies.json | Fixture Rush config required by test repo. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/common/config/rush/subspaces.json | Fixture enabling subspaces in test repo. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/common/config/rush/pnpm-config.json | Fixture root pnpm config enabling workspaces for subspaces. |
| libraries/rush-lib/src/logic/test/repoWithSubspacesCatalogs/common/config/rush/experiments.json | Fixture enabling cross-subspace decoupled dependency exemption for tests. |
| common/changes/@microsoft/rush/rush-change-catalog-entries_2026-02-17-18-48.json | Change file documenting the Rush CLI behavior update. |
common/changes/@microsoft/rush/rush-change-catalog-entries_2026-02-17-18-48.json
Outdated
Show resolved
Hide resolved
…6-02-17-18-48.json Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>
iclanton
approved these changes
Feb 23, 2026
Contributor
dmichon-msft
left a comment
There was a problem hiding this comment.
Few readability suggestions.
auto-merge was automatically disabled
February 23, 2026 16:44
Head branch was pushed to by a user without write access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rush changedoes not detect change to catalog version of dependency #5624rush changedoes not consider changes to pnpm global catalog changes. Runningrush changenow considers any chances to catalog entries, be it additions of version changes.Details
getChangedProjectsAsync()between the per-project file change detection and the includeExternalDependencies block. The new logic:a. Guards on
rushConfiguration.isPnpmandglobalCatalogsexistingb. Computes the relative path to
pnpm-config.jsonand checks if it's in changedFilesc. Loads the old
pnpm-config.jsonto find which catalog names changedd. If the old file doesn't exist (new creation), treats all current catalogs as changed
e. Builds a map of catalogName → Set by scanning each project's dependencies, devDependencies, and optionalDependencies for
catalog: protocolentriesf. Marks affected projects as changed
How it was tested
Impacted documentation