Skip to content

[rush-daemon][WS2.6][5/9] Match Rush exit semantics - #5966

Merged
Mo Jazayeri (mojaza) merged 5 commits into
mainfrom
mojazayeri-microsoft-rushd-ws2-exit-semantics-upstream
Aug 27, 2026
Merged

[rush-daemon][WS2.6][5/9] Match Rush exit semantics#5966
Mo Jazayeri (mojaza) merged 5 commits into
mainfrom
mojazayeri-microsoft-rushd-ws2-exit-semantics-upstream

Conversation

@mojaza

Copy link
Copy Markdown
Contributor

Summary

Migrates WS2 layer 5/9 into microsoft/rushstack as a dependent draft that adds authoritative Rush-compatible command outcomes and exit-code translation for opt-in rushd phased and global routing.

Depends on #5964. Supersedes mojaza#5. Follows #5949 and references #5897 without closing it. PBI: https://onedrive.visualstudio.com/EFun/_workitems/edit/3216022

Draft for explicit human review; do not merge without maintainer approval.

Details

  • Adds a typed final command-result contract for success, warning-only success, failure, and abort outcomes.
  • Matches phased Rush semantics using the authoritative graph status while preserving client operation-subset results.
  • Honors operation warning policy and request-local RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD without mutating process.env.
  • Preserves global command exit codes and translates execution or cleanup failures to Rush's failure exit code.
  • Delivers exactly one final result after ordered phased events/logs or global terminal output drain.
  • Preserves cancellation state when execution or cleanup failures determine the final failure outcome.

Limitations

This remains opt-in and does not integrate the standalone daemon into apps/rush or the normal Rush launcher. It does not add stdin/raw-mode/PTY fallback, scheduler command classification or wait/no-wait admission, concurrent shared-build merging, daemon lifecycle/restart, or CLI routing/configuration. Existing action construction and full command parsing remain integration-owned at the open #5895 boundary.

How it was tested

  • rush build --only @rushstack/rush-daemon-protocol --only @rushstack/rush-daemon --verbose
  • @rushstack/rush-daemon-protocol: 7 Jest suites, 37 tests passed
  • @rushstack/rush-daemon: 10 Jest suites, 88 tests passed
  • API Extractor regenerated and verified common/reviews/api/rush-daemon-protocol.api.md and common/reviews/api/rush-daemon.api.md as up to date

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 opt-in Rush-compatible final outcomes and exit-code handling for daemon-routed phased and global commands.

Changes:

  • Introduces typed command-result protocol contracts.
  • Adds phased warning, failure, abort, and global exit-code policies.
  • Ensures final results follow drained output, with expanded tests and documentation.

Reviewed changes

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

Show a summary per file
File Description
libraries/rush-daemon/src/CommandResultPolicy.ts Implements result and exit-code policy.
libraries/rush-daemon/src/GlobalCommandRequestClient.ts Adds final-result delivery.
libraries/rush-daemon/src/GlobalCommandRequestRouter.ts Translates global execution outcomes.
libraries/rush-daemon/src/PhasedRequestClient.ts Adds phased final-result delivery.
libraries/rush-daemon/src/PhasedRequestRouter.ts Produces phased command outcomes.
libraries/rush-daemon/src/index.ts Exports the global execution result.
libraries/rush-daemon/src/test/CommandResultPolicy.test.ts Tests exit-semantic parity.
libraries/rush-daemon/src/test/GlobalCommandRequestRouter.test.ts Tests global result handling.
libraries/rush-daemon/src/test/PhasedRequestRouter.test.ts Tests phased outcomes and ordering.
libraries/rush-daemon/src/test/PhasedRequestRouterTestUtilities.ts Supports result assertions.
libraries/rush-daemon/README.md Documents result semantics.
libraries/rush-daemon-protocol/src/DaemonCommandResult.ts Defines the shared result contract.
libraries/rush-daemon-protocol/src/DaemonPhasedRequest.ts Adds environment and result fields.
libraries/rush-daemon-protocol/src/index.ts Exports command-result types.
libraries/rush-daemon-protocol/README.md Documents the protocol addition.
common/reviews/api/rush-daemon.api.md Updates daemon API records.
common/reviews/api/rush-daemon-protocol.api.md Updates protocol API records.
common/changes/@rushstack/rush-daemon/mojazayeri-exit-semantics_2026-08-21-19-36.json Records the daemon change.
common/changes/@rushstack/rush-daemon-protocol/mojazayeri-command-results_2026-08-21-19-36.json Records the protocol 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/GlobalCommandRequestRouter.ts
Base automatically changed from mojazayeri-microsoft-rushd-ws2-global-context-upstream to main August 26, 2026 20:21
mojazayeri and others added 5 commits August 26, 2026 14:01
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>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@mojaza
Mo Jazayeri (mojaza) force-pushed the mojazayeri-microsoft-rushd-ws2-exit-semantics-upstream branch from 6cc9262 to 353a0dc Compare August 26, 2026 21:02
@mojaza
Mo Jazayeri (mojaza) merged commit 1a4618b into main Aug 27, 2026
10 checks passed
@mojaza
Mo Jazayeri (mojaza) deleted the mojazayeri-microsoft-rushd-ws2-exit-semantics-upstream branch August 27, 2026 00:11
@github-project-automation github-project-automation Bot moved this from Needs triage to Closed in Bug Triage Aug 27, 2026
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.

4 participants