Skip to content

[rush-daemon][WS2.9][8/9] Merge shared builds - #5972

Merged
Mo Jazayeri (mojaza) merged 4 commits into
mainfrom
mojazayeri-microsoft-rushd-ws2-shared-build-merge-upstream
Aug 28, 2026
Merged

[rush-daemon][WS2.9][8/9] Merge shared builds#5972
Mo Jazayeri (mojaza) merged 4 commits into
mainfrom
mojazayeri-microsoft-rushd-ws2-shared-build-merge-upstream

Conversation

@mojaza

Copy link
Copy Markdown
Contributor

Summary

Migrates WS2 layer 8/9 into microsoft/rushstack as a dependent draft that merges compatible concurrent phased SHARED-BUILD requests into one warm operation-graph iteration while preserving client-scoped output and results.

Depends on #5970. Supersedes mojaza#8. Follows merged #5949 and references #5897 without closing it. PBI: https://onedrive.visualstudio.com/EFun/_workitems/edit/3216025

Draft for explicit human review; do not merge without maintainer approval. Do not enable auto-merge.

Details

  • Adds a graph-owned coordinator with deterministic event-loop-turn batch boundaries for admitted shared builds.
  • Reconciles retained workspace invalidations once per batch, unions each client's dependency closure, and performs one setEnabledStates/schedule/execute cycle.
  • Fans raw streams and structured events out only to each client's retained operation subset with independent ordered backpressure.
  • Derives exit semantics from each client's subset, isolating disjoint failures while propagating shared failures only to affected clients.
  • Removes pre-start cancellations, unsubscribes mid-run cancellations without stopping work needed by live clients, and aborts only when no live client still needs the iteration.
  • Preserves WS2.8 FIFO/exclusive admission gating, one-deadline no-wait/timeout semantics, warm retained results, late-arrival batching, exact-once cleanup, and recovery after failed iterations.

Limitations

This remains opt-in and dead-code-safe. It uses the existing injected real graph/shape seam and does not integrate with apps/rush or construct PhasedScriptAction. Command-independent graph/plugin construction and complete per-iteration runner lifetime remain blocked by open #5895. It does not add WS3 lifecycle or WS4 CLI/config integration.

How it was tested

  • node common/scripts/install-run-rush.js build --only @rushstack/rush-daemon --verbose
  • Focused emitted Jest suites for batching, phased routing, interactive input, admission, result policy, and command classification: 6 suites and 62 tests passed
  • node common/scripts/install-run-rush.js change --verify
  • API Extractor report validation, git diff --check, source-to-replay range-diff, and conflict-focused read-only review

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

Adds shared-build batching to the warm Rush daemon graph while preserving request-scoped events, results, admission, and cancellation behavior.

Changes:

  • Merges compatible phased build requests into one graph iteration.
  • Adds per-client event multiplexing, result isolation, and cancellation handling.
  • Expands integration and batching test coverage.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
libraries/rush-daemon/src/PhasedRequestRouter.ts Coordinates merged graph iterations and client-scoped results.
libraries/rush-daemon/src/PhasedRequestEventSink.ts Reports client output failures to the coordinator.
libraries/rush-daemon/src/PhasedRequestEventMultiplexer.ts Fans graph events out to multiple request sinks.
libraries/rush-daemon/src/test/PhasedRequestBatching.test.ts Tests batching, isolation, cancellation, and recovery.
libraries/rush-daemon/src/test/RequestAdmissionIntegration.test.ts Tests admission timing and exclusive FIFO gating.
libraries/rush-daemon/src/test/PhasedRequestRouterTestUtilities.ts Supports distinct test session identifiers.
libraries/rush-daemon/README.md Documents shared-build batching behavior.
common/changes/@rushstack/rush-daemon/mojazayeri-shared-build-merging_2026-08-22-00-11.json Records the minor package change.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread libraries/rush-daemon/src/PhasedRequestRouter.ts Outdated
Comment thread libraries/rush-daemon/src/PhasedRequestEventMultiplexer.ts
@mojaza
Mo Jazayeri (mojaza) marked this pull request as draft August 27, 2026 20:43
@mojaza
Mo Jazayeri (mojaza) marked this pull request as ready for review August 27, 2026 20:44
@mojaza
Mo Jazayeri (mojaza) force-pushed the mojazayeri-microsoft-rushd-ws2-shared-build-merge-upstream branch from 2822147 to bf45a97 Compare August 27, 2026 20:45
Base automatically changed from mojazayeri-microsoft-rushd-ws2-8-request-admission-upstream to main August 27, 2026 23:33
mojazayeri and others added 4 commits August 27, 2026 16:33
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@mojaza
Mo Jazayeri (mojaza) force-pushed the mojazayeri-microsoft-rushd-ws2-shared-build-merge-upstream branch from bf45a97 to d5c531c Compare August 27, 2026 23:33
@mojaza
Mo Jazayeri (mojaza) merged commit 9b4feb4 into main Aug 28, 2026
10 checks passed
@github-project-automation github-project-automation Bot moved this from Needs triage to Closed in Bug Triage Aug 28, 2026
@mojaza
Mo Jazayeri (mojaza) deleted the mojazayeri-microsoft-rushd-ws2-shared-build-merge-upstream branch August 28, 2026 00:22
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.

5 participants