Skip to content

[rush] Add an external execution planning contract - #6204

Open
Yashwanth Reddy Verupaka (yashwanth195) wants to merge 2 commits into
microsoft:mainfrom
yashwanth195:user/yverupaka/rush-external-execution-contract
Open

Yashwanth Reddy Verupaka (yashwanth195) wants to merge 2 commits into
microsoft:mainfrom
yashwanth195:user/yverupaka/rush-external-execution-contract

Conversation

@yashwanth195

Copy link
Copy Markdown
Contributor

Summary

Export executable Rush graphs without scheduling operations or running cache/environment hooks. This adds a pure planning API, explicit per-record environment overrides, and a versioned BuildXL graph contract.

Details

  • Plan after all graph-created hooks, using fresh records without consuming iteration IDs or replacing execution results. An external-execution hook can suppress native scheduling.
  • Apply explicit overrides after local environment hooks, preserving Windows name casing and accepted daemon-extension behavior. Export only these non-secret overrides, never a computed or ambient environment. Plugins remain responsible for including semantic overrides in cache identity.
  • Export initial shell commands, opaque operation IDs, the existing task field, output folders, warning policy, and cache exclusions. Validate identities, edges and cycles before pruning disabled/no-op nodes; native shards remain cacheable unless explicitly excluded.
  • Commands tapping the new hook require --no-daemon; watch export is rejected. Custom executable runners must expose getCommandForExecution(). Native operation execution remains on its existing lifecycle.

This is standalone on main. Heft shard identity, manifests, collation, Jest/coverage/JUnit integration and end-to-end BuildXL/QTest adoption are deferred, not implied by this contract. No input-hashing or Heft-parameter changes are included.

How it was tested

Windows, Node 24.22.1, repository-pinned Rush 5.182.0. Tests use the packages' existing Heft/Jest configuration and test locations.

Working directory Exact command Result
Repository root node common\scripts\install-run-rush.js build --only @microsoft/rush-lib --only @rushstack/rush-buildxl-graph-plugin --production --parallelism 2 Passed, including TypeScript, lint and API reports
Repository root node common\scripts\install-run-rush.js build --only @rushstack/rush-buildxl-graph-plugin --production --parallelism 2 Passed after the exporter test-resolution correction below
libraries\rush-lib node ..\..\common\scripts\install-run-rushx.js _phase:test --test-path-pattern OperationGraph --max-workers 2 117 passed
libraries\rush-lib node ..\..\common\scripts\install-run-rushx.js _phase:test --test-path-pattern ShellOperationRunner --max-workers 2 54 passed, 1 existing Windows skip
libraries\rush-lib node ..\..\common\scripts\install-run-rushx.js _phase:test --test-path-pattern RushCommandLineParser --max-workers 2 76 passed
rush-plugins\rush-buildxl-graph-plugin node ..\..\common\scripts\install-run-rushx.js _phase:test --test-path-pattern Graph --max-workers 2 GraphProcessor: 22 passed. Four plugin lifecycle tests initially failed because the SDK loaded installed Rush rather than this checkout
rush-plugins\rush-buildxl-graph-plugin node ..\..\common\scripts\install-run-rushx.js _phase:test --test-path-pattern DropBuildGraphPlugin --max-workers 2 All 4 passed after resolving the SDK to the checkout's actual Rush API; includes writing the versioned JSON
libraries\rush-daemon node ..\..\common\scripts\install-run-rushx.js _phase:test --test-path-pattern 'WorkspaceEngineComponentFactory\.test' --max-workers 2 27 passed
Repository root node common\scripts\install-run-rush.js prettier Passed
Repository root node common\scripts\install-run-rush.js change --verify --target-branch upstream/main --no-fetch Passed

Final retained results: 300 passed, 1 existing skip, with no unresolved failures. Passing suites were not rerun after changes confined to the exporter test.

Prerequisites and the daemon built successfully during node common\scripts\install-run-rush.js build --to @rushstack/rush-buildxl-graph-plugin --to @rushstack/rush-daemon --production --parallelism 4; that invocation failed on a subsequently corrected exporter test type mismatch. The final package builds above passed. Initial test-only compile/lint issues were corrected; Windows shell parsing prevented combined | selectors from launching, so successful runs used the simple selectors above. Existing fixture naming/phantom-dependency warnings were not suppressed. No full sharding acceptance or downstream BuildXL/QTest run was performed.

Impacted documentation

Updated the BuildXL graph plugin README, API documentation/reports and Rush changefiles. The README describes consumer responsibilities and the deferred integration scope. No JSON schemas changed.

@yashwanth195

Copy link
Copy Markdown
Contributor Author

Fixed the missing RepoStateCache mock in 594f6a8. The daemon-guard test still checks the exact --no-daemon rejection and now asserts no warning/error output using a call-through spy. No production changes or output suppression.

Validation on Windows, Node 24.22.1:

  • From libraries\rush-lib: node ..\..\common\scripts\install-run-rushx.js _phase:test --test-path-pattern RushCommandLineParser --max-workers 2: 76 passed, exit 0.
  • From the root: node common\scripts\install-run-rush.js test --only @microsoft/rush-lib --verbose --production --parallelism 2: build/type/lint/API checks passed; the changed suite passed all 36 tests with zero repo-state warnings. The overall run failed 15 unchanged tests involving receipt files, configuration reuse and timeouts (1946 passed, 32 skipped), so this is not a full-package green claim.
  • A single-file selector passed its 36 tests but hit Windows fixture-lock teardown; the standard multi-suite selector above completed cleanly.

The original Node 26/Linux DaemonStartup timeout is separate and unchanged. New CI still needs to complete; unaffected exporter validation was retained.

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