Skip to content

[rush] Make version consistency checks aware of PNPM catalogs - #6140

Merged
Bharat Middha (bmiddha) merged 1 commit into
mainfrom
bmiddha-catalog-aware-version-checks
Nov 10, 2026
Merged

Bharat Middha (bmiddha) merged 1 commit into
mainfrom
bmiddha-catalog-aware-version-checks

Conversation

@bmiddha

@bmiddha Bharat Middha (bmiddha) commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Version consistency checks compared raw specifiers, so "typescript": "catalog:" was reported as inconsistent with "~5.8.2", with the same version in preferredVersions, and even with "catalog:default". With ensureConsistentVersions, that fails rush install, rush update, and rush check as soon as a repo adopts PNPM catalogs.

Catalog references are now compared by the version that they resolve to in the subspace's catalogs, and --make-consistent no longer replaces other projects' catalog references with literal versions.

Details

  • A reference that doesn't resolve (missing catalog or entry) is reported as its own version, catalog: or catalog:<name>, instead of failing or being ignored.
  • allowedAlternativeVersions matches either the resolved version or the raw reference, such as catalog:react17.
  • rush check annotates catalog versions, for example ~5.8.2 (catalog:). In rush check --json, version is the resolved version, which is what PNPM installs, and an optional catalogReferences field lists the projects that used a catalog. Existing fields are unchanged.
  • --make-consistent (rush add, rush upgrade-interactive) skips projects that reference the package through a catalog, and warns if the catalog version differs. It still overwrites a catalog reference in the target project itself; that is not addressed here.
  • ProjectChangeAnalyzer now trims catalog names the way PNPM does, so catalog: tools is treated as tools.

How it was tested

Unit tests cover catalog references compared with literals, catalog:default, and preferredVersions; named catalogs with allowedAlternativeVersions; per-subspace catalogs; unresolved references; the rush check text and JSON output; and --make-consistent leaving catalog references in place. The consistency check still finds no mismatches in this repo.

@github-project-automation github-project-automation Bot moved this to Needs triage in Bug Triage Oct 14, 2026
@bmiddha
Bharat Middha (bmiddha) force-pushed the bmiddha-catalog-aware-version-checks branch from 664d3de to eff340a Compare October 14, 2026 20:54
@bmiddha
Bharat Middha (bmiddha) force-pushed the bmiddha-catalog-aware-version-checks branch 2 times, most recently from f2519b0 to cb746ea Compare October 20, 2026 21:13
@bmiddha
Bharat Middha (bmiddha) force-pushed the bmiddha-catalog-aware-version-checks branch from cb746ea to 209c8e5 Compare October 28, 2026 04:45
@bmiddha
Bharat Middha (bmiddha) force-pushed the bmiddha-catalog-aware-version-checks branch from 209c8e5 to 354f91f Compare October 30, 2026 21:06
@bmiddha
Bharat Middha (bmiddha) marked this pull request as ready for review October 30, 2026 23:02
@bmiddha
Bharat Middha (bmiddha) force-pushed the bmiddha-catalog-aware-version-checks branch from 354f91f to 13bb763 Compare November 8, 2026 01:13
@bmiddha
Bharat Middha (bmiddha) force-pushed the bmiddha-catalog-aware-version-checks branch from 13bb763 to a9fbd99 Compare November 8, 2026 02:00
@bmiddha
Bharat Middha (bmiddha) force-pushed the bmiddha-catalog-aware-version-checks branch 2 times, most recently from 40f186e to 49d41e2 Compare November 9, 2026 21:34
Base automatically changed from bmiddha-catalog-aware-preferred-versions to main November 10, 2026 01:02
Version checks compared raw specifiers, so "catalog:" was reported as
inconsistent with the same version elsewhere, which fails
ensureConsistentVersions once a repo adopts PNPM catalogs. Compare catalog
references by their resolved version, and keep --make-consistent from
replacing them with literal versions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@bmiddha
Bharat Middha (bmiddha) force-pushed the bmiddha-catalog-aware-version-checks branch from 49d41e2 to f1bf275 Compare November 10, 2026 01:02
@bmiddha
Bharat Middha (bmiddha) merged commit a51dfac into main Nov 10, 2026
8 checks passed
@github-project-automation github-project-automation Bot moved this from Needs triage to Closed in Bug Triage Nov 10, 2026
@bmiddha
Bharat Middha (bmiddha) deleted the bmiddha-catalog-aware-version-checks branch November 10, 2026 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

2 participants