[rush-serve-plugin] Add build status monitoring via WebSocket #4328
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
Adds a new configuration option
buildStatusWebSocketPath
to@rushstack/rush-serve-plugin
that, when configured, enables a secure web socket server atwss://localhost:${port}${buildStatusWebSocketPath}
.A client can connect a
WebSocket
at the aforementioned path to receive information about the status of the current watch-mode build command.Details
Upon connecting a
WebSocket
to the server, the plugin will send async
message that lists all current operations and their statuses, the overall status of the build, and some metadata about the current session (the name of the command, the machine the command is running on).Whenever the status of one or more operations in the build graph changes, a
status-change
message will be sent with the new states of the affected operations.Upon completion of the build, an
after-execute
message will be sent, containing the final aggregate build status.Future Work
Add support for fetching build logs and streaming log content.
How it was tested
Temporarily connected
rush-serve-plugin
to be one of the default Rush plugins instart-dev.js
.Configured a global rule to host a static HTML page that connected to the web socket server and monitored for live updates.
Impacted documentation
The list of
OperationStatus
values in Rush. The package documentation and schema for@rushstack/rush-serve-plugin
.