[rush-daemon][WS2.9][8/9] Merge shared builds - #8
Closed
mojaza wants to merge 1 commit into
Closed
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
It substantially refactors core phased graph-execution concurrency, batching, and cancellation behavior, which warrants final human validation beyond automated review.
Pull request overview
This PR enhances the @rushstack/rush-daemon phased request routing so that compatible concurrent SHARED-BUILD requests can be coalesced into a single warm operation-graph iteration, while still delivering per-client scoped output/events/results and preserving FIFO/exclusive admission semantics.
Changes:
- Introduces a graph-owned batching coordinator that merges admitted
SHARED-BUILDphased requests at deterministic event-loop-turn boundaries and executes a single unioned graph iteration. - Updates event fan-out to support multiple simultaneous per-client sinks with independent ordered backpressure, plus refined cancellation behavior (unsubscribe a client without aborting shared work unless no live clients remain).
- Adds/updates Jest coverage for batching/coalescing behavior and the exclusive FIFO gating between shared-build batches.
File summaries
| File | Description |
|---|---|
| libraries/rush-daemon/src/test/RequestAdmissionIntegration.test.ts | Adds an integration test asserting exclusive FIFO gating between shared-build batches. |
| libraries/rush-daemon/src/test/PhasedRequestRouterTestUtilities.ts | Extends the test phased client to allow distinct sessionId values for multi-client scenarios. |
| libraries/rush-daemon/src/test/PhasedRequestBatching.test.ts | New test suite covering shared-build batching/coalescing, isolation of streams/events/results, and cancellation semantics. |
| libraries/rush-daemon/src/PhasedRequestRouter.ts | Implements shared-build batching via a graph-owned coordinator; unions selections per batch; refactors result derivation per client subset. |
| libraries/rush-daemon/src/PhasedRequestEventSink.ts | Threads write-failure errors through the sink writer so the router can deactivate a client with error context. |
| libraries/rush-daemon/src/PhasedRequestEventMultiplexer.ts | Expands from a single request sink to a set of concurrent request sinks for multi-client fan-out. |
| libraries/rush-daemon/README.md | Updates documentation to describe shared-build coalescing, batching boundaries, and cancellation semantics. |
| common/changes/@rushstack/rush-daemon/mojazayeri-shared-build-merging_2026-08-22-00-11.json | Records a minor change note for shared-build request merging behavior. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mojaza
force-pushed
the
mojazayeri-microsoft-rushd-ws2-shared-build-merge
branch
from
August 24, 2026 01:54
4275840 to
4ada182
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
mojaza
force-pushed
the
mojazayeri-microsoft-rushd-ws2-shared-build-merge
branch
from
August 24, 2026 20:47
4ada182 to
52025b3
Compare
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
Merge compatible concurrent phased
SHARED-BUILDrequests into one warm operation-graph iteration while preserving client-scoped output and results.Depends on #7. This stack follows merged microsoft#5949 and advances microsoft#5897. Azure PBI: https://onedrive.visualstudio.com/EFun/_workitems/edit/3216025
Details
setEnabledStates/schedule/execute cycle.Limitations
This remains opt-in and dead-code-safe. It uses the existing injected real graph/shape seam and does not integrate with
apps/rushor constructPhasedScriptAction. Command-independent graph/plugin construction and complete per-iteration runner lifetime remain blocked by open microsoft#5895.How it was tested
rushx buildinlibraries/rush-daemon(TypeScript, ESLint, API Extractor)PhasedRequestBatching.test.js,PhasedRequestRouter.test.js, andRequestAdmissionIntegration.test.js: 30 tests passedrush change --verify