Skip to content

[rush] Fix declared environment snapshot hashing - #6203

Open
Yashwanth Reddy Verupaka (yashwanth195) wants to merge 1 commit into
microsoft:mainfrom
yashwanth195:user/yverupaka/rush-environment-hashing-pr
Open

Yashwanth Reddy Verupaka (yashwanth195) wants to merge 1 commit into
microsoft:mainfrom
yashwanth195:user/yverupaka/rush-environment-hashing-pr

Conversation

@yashwanth195

Copy link
Copy Markdown
Contributor

Summary

Fix Rush cache identity for declared environment inputs: capture supplied values at snapshot creation, distinguish unset from empty, and resolve Windows environment names case-insensitively.

Details

  • Reuse EnvironmentMap for snapshot capture, explicit per-operation environments, and previous-snapshot comparison. Preserve memoization, undeclared-input exclusion, and non-Windows case sensitivity.
  • Hash JSON tuples to prevent delimiter collisions. Operations hashing declared environment variables intentionally receive new cache keys; no public API changes.
  • Standalone four-file fix. Intentionally excludes the source snapshot's additional-file/output-folder validation and all sharding APIs, plugins, and fixtures.

How it was tested

Windows, Node 24.22.1, Rush 5.182.0:

Command Result
node common\scripts\install-run-rush.js build --to @microsoft/rush-lib --parallelism 4 Passed: 36 successful operations, 4 no-op; includes TypeScript, lint, API Extractor, and webpack.
From libraries\rush-lib: node ..\..\common\scripts\install-run-rushx.js _phase:test --test-path-pattern InputsSnapshot --max-workers 1 --disable-code-coverage Passed: 46 tests, 0 failures.
node common\scripts\install-run-rush.js prettier Passed.
node common\scripts\install-run-rush.js change --verify --target-branch upstream/main --no-fetch Passed.
git diff --cached --check Passed.

Coverage includes absent/empty/sentinel values, captured caller mutations, separator collisions, Windows and Linux name semantics, explicit operation environments before/after memoization, and previous-snapshot reuse. Jest reported fixture package-name collision warnings; the suite passed.

Build/tests preceded the final rebase onto c2acd010079c6c08e63ba25d0b136ed2c1b16ccd. Upstream changed only unrelated Heft plugin selection; all four validated files were verified byte-identical after rebasing. No broad sharding or coverage matrix was run.

Impacted documentation

None. The patch changefile documents the intentional cache-key change.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

1 participant