Fix LogsCommand to sort results by timestamp#14645
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14645Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14645" |
There was a problem hiding this comment.
Pull request overview
Updates the Aspire CLI logs command so that when aggregating logs from multiple resources, the output is sorted globally by timestamp (follow-up to #14632), and adjusts unit tests to validate the new ordering.
Changes:
- Refactors
LogsCommandto parse log lines intoLogEntryobjects and emit results sorted by timestamp. - Updates JSON and text output paths to use the parsed entries (including resolved resource prefixes).
- Revises
LogsCommandTestsexpectations and test data to verify cross-resource timestamp sorting.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Aspire.Cli/Commands/LogsCommand.cs | Refactors log collection/output to sort entries by timestamp across resources. |
| tests/Aspire.Cli.Tests/Commands/LogsCommandTests.cs | Updates tests and fixtures to assert the new timestamp-sorted behavior. |
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #22346761059 |
|
|
This recording seems to not have that 5+s delay you were seeing: https://asciinema.org/a/t1K6ivY4O0yOFyrL |
|
Hmmm, let me verify I am using the right one |
|
➜ aspire --version |
Screen.Recording.2026-02-24.103754.mp4 |
|
It's much faster than it use to be for multiple resources. Now logs are fetched in parallel. 5 seconds vs 20+ seconds. I think the delay at this point is coming from getting logs from DCP. How about:
|
|
Merge this PR, lets file a follow up. |
Description
Fixes #14646
Follow up to #14632. Logs for multiple resources weren't sorted by timestamp across resources
Changes:
GetResourceLogsAsyncto not be a mess of branchesChecklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: