New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rush] Replay logs for warnings and errors as well #4668
[rush] Replay logs for warnings and errors as well #4668
Conversation
libraries/rush-lib/src/logic/operations/OperationMetadataManager.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/schemas/log-chunk.schema.json
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/schemas/log-chunk.schema.json
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/OperationMetadataManager.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/OperationMetadataManager.ts
Outdated
Show resolved
Hide resolved
common/changes/@microsoft/rush/sennyeya-log-replays_2024-04-29-20-05.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This overall looks good to me, but it'd be good for @octogonz to review this too, as he originally wrote a lot of the streaming logs stuff.
build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/repo/.gitignore
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/OperationMetadataManager.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/OperationMetadataManager.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/OperationExecutionRecord.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/OperationExecutionRecord.ts
Outdated
Show resolved
Hide resolved
fccbf98
to
82b0c1d
Compare
libraries/rush-lib/src/logic/operations/OperationMetadataManager.ts
Outdated
Show resolved
Hide resolved
… chunk separations
…-20-05.json Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>
…/repo/.gitignore Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
…er.ts Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>
85d9903
to
a8a6f93
Compare
libraries/rush-lib/src/logic/operations/OperationExecutionRecord.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/OperationExecutionRecord.ts
Outdated
Show resolved
Hide resolved
@octogonz @dmichon-msft This is ready for re-review when you get a chance! |
libraries/rush-lib/src/logic/operations/OperationMetadataManager.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How painful would it be to add a unit test for the chunked file format?
libraries/rush-lib/src/logic/operations/OperationExecutionRecord.ts
Outdated
Show resolved
Hide resolved
@aramissennyeydd - Looks good overall. Once you just address @dmichon-msft's comments we can get this in. |
@iclanton Added a unit test as well for the log restoration in |
Summary
Replays logs through the hook context's
runWithTerminalAsync
to hook into the stdio summarization functionality. This allows the report at the end of execution to be the same across machines.Operations with 2 second durations were executed on the agent, those with <.5 seconds were restored from the build cache from the cobuild.
Before:
Agent 1
Agent 2
After:
Agent 1
Agent 2
Details
This stores the log chunks into a JSON file, that is a direct write of the
ITerminalChunk
type. This is then restored while the build cache is being restored to the terminal with the correct severity following theShellOperationPlugin
logging semantics.How it was tested
Tested against the
repo
cobuild sandbox with build caching enabled. Both restoring from the original build cache and cobuild cache work as expected and display the output above.Impacted documentation