Commit d0129d8
Reporter overhaul (4/6): opt-in reporters, selection, StreamCollator replacement (#5868)
* Add reporter selection and configuration precedence
Resolve the reporter and log level from controls for @rushstack/reporter (#5858).
- Add the built-in reporter names and log levels with validation guards
- Add agent and CI detection, including COPILOT_CLI and configured agent
environment variables and the active-value semantics
- Parse the --output control into reporter, target, and params
- Add resolveReporterSelection: the primary reporter runs from explicit CLI
through RUSH_REPORTER, agent, CI, and TTY down to generic non-TTY plaintext,
and always pairs with the file reporter
- Resolve the log level independently, mapping --quiet, --verbose, and --debug
aliases and rejecting contradictions
- Keep command-specific --json distinct from the json reporter and fail explicit
unsupported reporter or log-level requests
- Cover precedence, aliases, contradictions, outputs, and detection with tests
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add rush change file for reporter selection
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add independent per-reporter log-level filtering
Add per-reporter log-level filtering for @rushstack/reporter (#5858).
- Classify each event to a minimum log level and add shouldRenderAtLogLevel and
filterEventsForLogLevel so each reporter applies quiet, normal, verbose, or
debug filtering independently
- Keep diagnostic severity separate from the reporter log level: severity sets
the minimum level while the reporter's configured level gates rendering
- Default the full-detail file reporter to debug
- Cover ranking, classification, per-level rendering, monotonicity, and the
severity separation with tests
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add rush change file for per-reporter log levels
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add automatic reporter selection matrix
Resolve the automatic reporter plan by environment for @rushstack/reporter (#5858).
- Add planAutomaticReporters, which pairs ai with file for an agent, detailed
plaintext with file for CI, default with file for an interactive TTY, and
concise plaintext with file otherwise
- Give machine reporters (ai, json) exclusive stdout and route human progress to
stderr, with emergency diagnostics always on stderr
- Add describeReporterPlan to record the selection reason and reporters in the
detailed log
- Cover the full matrix, machine stdout ownership, and the plan description with
tests
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add rush change file for automatic reporter matrix
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add default interactive reporter with three-row live region
Add the concise default reporter for @rushstack/reporter (#5858).
- Add interactive rendering helpers: a spinner, color resolution honoring
NO_COLOR and FORCE_COLOR, width-aware active projects with +N more, and a
three-row live region renderer that truncates before coloring
- Add DefaultInteractiveReporter, which paints the live region at no more than
10 Hz, reacts to terminal width, hides and restores the cursor, leaves at most
three stable lines on success, appends a bounded diagnostic block and log path
on failure, and appends one summary per completed watch cycle
- Cover rendering helpers and reporter behavior with an injected terminal and
clock
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add rush change file for default interactive reporter
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add append-only plaintext and non-TTY reporter
Add the plaintext reporter for @rushstack/reporter (#5858).
- Add PlaintextReporter, an append-only reporter that never moves the cursor and
disables color by default
- Emit the start line, meaningful operation state changes, diagnostics, and the
final result
- Add a compact 30-second heartbeat for long non-TTY and CI sessions
- Retain StreamCollator-like operation grouping in the detailed CI variant by
grouping each operation's output under a header
- Add stable concise and detailed plaintext snapshot tests
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add rush change file for plaintext reporter
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add JSON and bounded AI reporters
Add the machine reporters for @rushstack/reporter (#5858).
- Add JsonReporter, which emits the complete versioned NDJSON event stream on
exclusive stdout and replaces an oversized record with a valid marker
- Add AiReporter, a bounded projection that emits a status record and a final
record with the result, scope, error codes and categories, structured
remediation, aggregate counts, log reference, and artifact completeness
- Cap the AI record at 64 KiB and 20 detailed diagnostics, represent warnings by
count when failures exist, and exclude raw output and stacks
- Keep the absolute log path in AI output while telemetry continues to exclude it
- Add stdout-purity tests for both reporters and a telemetry path cross-check
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add rush change file for JSON and AI reporters
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add full-detail file reporter with retention and fallback
Add the full-detail file reporter for @rushstack/reporter (#5858).
- Add FileReporter, which writes a debug NDJSON invocation log to
<commonTempFolder>/rush-logs/<UTC timestamp>-<pid>-<action>.log with
owner-only permissions and redacts fields classified as secret
- Maintain a latest.log pointer for both successful and failed commands
- Buffer events until the first flush and fall back to the OS temp folder
- Delete logs older than 14 days and cap retention at 20 sessions
- Treat failure at both paths as nonfatal, emitting an emergency warning and
marking the artifact unavailable
- Cover writing, permissions, redaction, retention, fallback, and failure with
tests against real temp directories
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add rush change file for full-detail file reporter
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add legacy reporter and emergency fallback
Add the legacy reporter for @rushstack/reporter (#5858).
- Add LegacyReporter, which reproduces the current Rush output: the start line,
the parallelism line, StreamCollator-style operation headers with grouped
output, and a success or failure summary with durations
- Add isLegacyEmergencyFallbackRequested and confirm RUSH_REPORTER=legacy selects
the legacy reporter as an emergency fallback
- Validate the reporter against the frozen legacy output snapshots
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add rush change file for legacy reporter
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Replace StreamCollator with raw semantic operation events
Add the uncollated operation event stream for @rushstack/reporter (#5858).
- Add OperationStreamEmitter so the scheduler emits operation registration,
status transitions, raw output chunks, and the aggregate command result
- Emit output chunks immediately in call order and never collate them, so the
concise reporter derives activity without buffering while the detailed and
file reporters own grouping
- Add iterateExternalOutput and regroupOperationOutput so problem matchers
consume the uncollated stream and reporters reconstruct StreamCollator-parity
grouping
- Cover emission, chunking, uncollated ordering, and reporter parity with tests
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add rush change file for StreamCollator replacement
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add problem matchers over preserved external output
Recover diagnostics from raw external output for @rushstack/reporter (#5858).
- Preserve raw stdout and stderr as ordered chunks and run matchers over an
ANSI-normalized copy so the raw evidence and process status are never modified
- Add a tool- and version-scoped problem matcher registry gated on default
enablement, routing older Heft versions through the version predicate
- Add runProblemMatchers, which reassembles lines split across chunks, links
recovered diagnostics to the operation and source location, preserves
unmatched text, and caps duplicate diagnostics
- Cover ANSI stripping, scoping, recovery, split chunks, the duplicate cap, and a
representative corpus with tests
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add rush change file for problem matchers
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add legacy error bridge and deprecate AlreadyReportedError
Bridge the legacy sentinel error pattern for @rushstack/reporter (#5858).
- Deprecate AlreadyReportedError so new usage is prohibited now that structured
diagnostics and RushError are available
- Add LegacyErrorBridge, which observes emitted diagnostics, correlates legacy
sentinels with them, and suppresses duplicate rendering of failures that are
already represented
- Document the bridge removal criteria for a later major
- Cover sentinel detection, suppression, correlation, and the removal criteria
with tests
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Add rush change file for legacy error bridge
Assistant-model: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be3
* Align opt-in reporters with the realigned reporter contracts
- OperationStreamEmitter no longer sets 'required' (manager derives it from
the event type)
- Problem matcher diagnostics use the kind-tagged source union and the
registered RUSH_EXTERNAL_TOOL_PROBLEM code with its template
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Fix reporter self-review findings
Preserve streamed output, enforce reporter privacy and lifecycle contracts, restore legacy compatibility, and correct reporter change metadata.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address reporter review feedback
Harden reporter filtering, protocol bounds, terminal rendering, file streaming, matcher recovery, and legacy summaries.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Refresh PR mergeability after base integration
GitHub continued to report conflicts even though the current base is the direct second parent of the PR head.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Regenerate reporter API report against main
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Sean Larkin <TheLarkInn@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 897dcf7e-e6e8-4a84-85ca-34b93fa29be31 parent 410fb62 commit d0129d8
51 files changed
Lines changed: 6141 additions & 3 deletions
File tree
- common
- changes/@rushstack/rush-reporter
- reviews/api
- libraries/reporter/src
- compat
- config
- diagnostics
- templates
- events
- lifecycle
- matchers
- reporters
- scheduler
- test
- __snapshots__
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments