[rush] Add --show-existing-failure-logs parameter to skip execution and replay failure logs #5454
+283
−29
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
Fixes the workflow inefficiency when performing sweeping monorepo changes (e.g., TypeScript upgrades) where developers lose track of which projects failed after fixing individual failures. Adds
--show-existing-failure-logsparameter that replays error logs from previous runs without re-executing operations.Fixes #5450
Details
Implementation:
PhasedScriptAction: Added--show-existing-failure-logsflag parameter, incompatible with--watchShowExistingFailureLogsPlugin: New plugin that:.rush/temp/operation/<phase>/error.logfilesOperationStatus.Failureif error log exists (replays viaOperationMetadataManager.tryRestoreAsync)OperationStatus.Skippedif no error log (silences operation)@microsoft/rushdocumenting the new feature as a minor version changeDesign choice: Returns terminal status from
beforeExecuteOperationhook to prevent runner execution while preserving full operation graph traversal for dependencies.Performance: Near-instant execution (0.00s per operation) - only reads existing files, no computation or network I/O.
How it was tested
Unit tests: Added comprehensive tests for
ShowExistingFailureLogsPlugincovering both error log presence/absence scenarios.Manual validation:
@microsoft/rush-lib, ranrush build --only @microsoft/rush-libto generate error logrush build --show-existing-failure-logs --only @microsoft/rush-lib--toselection: Confirmed operations without error logs were silenced (Skipped status)Impacted documentation
Example usage:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.