Log guest app host output to CLI log file and add OutputLineStream/ConsoleLogTypes#15307
Log guest app host output to CLI log file and add OutputLineStream/ConsoleLogTypes#15307JamesNK merged 4 commits intorelease/13.2from
Conversation
This reverts commit 603263a.
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15307Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15307" |
There was a problem hiding this comment.
Pull request overview
Reverts the prior change that forwarded AppHost stdout/stderr to the aspire run console in non-detached runs, removing the associated “live output” plumbing and the tests that validated that behavior.
Changes:
- Removed
OutputCollectorlive-callback support and stopped wiring AppHost/guest process output to console logs during runs. - Simplified guest process launching by removing live forwarding and related completion tracking.
- Removed/updated unit and E2E tests that asserted AppHost console-output forwarding.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Shared/Hex1bAutomatorTestHelpers.cs | Reverts interactive “Empty AppHost” selection flow in Hex1b automations. |
| tests/Aspire.Cli.Tests/Utils/OutputCollectorTests.cs | Removes test validating live output callback forwarding. |
| tests/Aspire.Cli.Tests/Projects/ProcessGuestLauncherTests.cs | Deletes tests asserting guest launcher forwards stdout live. |
| tests/Aspire.Cli.Tests/Commands/RunCommandTests.cs | Removes test asserting aspire run forwards AppHost stdout to console. |
| tests/Aspire.Cli.EndToEnd.Tests/AppHostConsoleLogTests.cs | Deletes E2E coverage for visible AppHost console output during non-detached runs. |
| src/Aspire.Cli/Utils/OutputCollector.cs | Removes live callback API; collector becomes buffered + optional file logger only. |
| src/Aspire.Cli/Projects/ProcessGuestLauncher.cs | Stops accepting live callback and removes post-exit stream completion waiting. |
| src/Aspire.Cli/Projects/GuestRuntime.cs | Removes live-callback parameter from default launcher creation. |
| src/Aspire.Cli/Projects/GuestAppHostProject.cs | Stops wiring guest output to console live; always displays buffered output on failure. |
| src/Aspire.Cli/Projects/DotNetAppHostProject.cs | Stops wiring AppHost run output to console live; keeps file logging/buffering only. |
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #23180590987 |
- Pass FileLoggerProvider through GuestAppHostProject -> GuestRuntime -> ProcessGuestLauncher -> OutputCollector so guest process stdout/stderr is written to the CLI log file (matching .NET app host behavior) - Add OutputLineStream enum to replace stringly-typed stdout/stderr stream identifiers - Add ConsoleLogTypes constants for console log semantic types - Add TaskCompletionSource-based stream drain with 5s timeout in ProcessGuestLauncher to ensure no trailing output lines are lost - Add test verifying guest process output is written to log file
…est FileLoggerProvider
|
Merged improvements in #15298 into this PR. |
|
/deployment-test |
|
🚀 Deployment tests starting on PR #15307... This will deploy to real Azure infrastructure. Results will be posted here when complete. |
mitchdenny
left a comment
There was a problem hiding this comment.
Approved. Looks good but just triggering a deployment test as well.
|
❌ Deployment E2E Tests failed — 25 passed, 2 failed, 0 cancelled View test results and recordings
|
Description
Log guest (non-.NET) app host console output to the CLI log file, matching the behavior already in place for .NET app hosts. Previously, guest process stdout/stderr was only buffered in memory and never written to disk.
Changes
FileLoggerProviderthroughGuestAppHostProject→GuestRuntime→ProcessGuestLauncher→OutputCollectorso guest process output is written to the CLI log fileOutputLineStreamenum: Replace stringly-typed"stdout"/"stderr"stream identifiers with a type-safe enum acrossOutputCollector,IInteractionService, and all implementationsConsoleLogTypesconstants: Replace string literals ("waiting","running","exitCode","failedToStart") with named constants for console log semantic typesTaskCompletionSource-based stream drain with 5-second timeout inProcessGuestLauncherto ensure no trailing output lines are lost after process exitLog file output after change.
Here is an app host (note, console.log):
Log file (note hello world in output):
Checklist