Add CLI logs output channel logging for describe process lifecycle, reduce aspire describe calls, other performance improvements#15963
Conversation
- Log when describe watch starts/stops - Log process exit and error events to CLI logs output channel - Includes command and exit code in log messages
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15963Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15963" |
There was a problem hiding this comment.
Pull request overview
Adds an opt-in “CLI Logs” output channel in the VS Code extension and updates the Aspire CLI to support extension-driven, file-less logging (--no-log-file) so CLI process lifecycle events (spawn/exit/error/stop) are easier to troubleshoot—especially for describe --follow.
Changes:
- VS Code extension: adds a dedicated “CLI Logs” output channel and routes selected CLI process stderr + lifecycle events into it.
- Aspire CLI: adds hidden
--no-log-filesupport and makes log file path nullable across relevant plumbing. - VS Code extension: refines
describe --followwatch lifecycle (only active when panel/apphost editor visible) and adds CLI path resolution caching/coalescing.
Reviewed changes
Copilot reviewed 38 out of 39 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Cli.Tests/Utils/CliTestHelper.cs | Updates test DI wiring for new nullable log-file/no-log-file logging options. |
| tests/Aspire.Cli.Tests/ProgramTests.cs | Adds unit tests covering --no-log-file and null file logger provider behavior. |
| src/Aspire.Cli/Utils/AppHostHelper.cs | Makes compatibility checks accept nullable log file path. |
| src/Aspire.Cli/Resources/xlf/RootCommandStrings.zh-Hant.xlf | Adds localized string entry for --no-log-file description. |
| src/Aspire.Cli/Resources/xlf/RootCommandStrings.zh-Hans.xlf | Adds localized string entry for --no-log-file description. |
| src/Aspire.Cli/Resources/xlf/RootCommandStrings.tr.xlf | Adds localized string entry for --no-log-file description. |
| src/Aspire.Cli/Resources/xlf/RootCommandStrings.ru.xlf | Adds localized string entry for --no-log-file description. |
| src/Aspire.Cli/Resources/xlf/RootCommandStrings.pt-BR.xlf | Adds localized string entry for --no-log-file description. |
| src/Aspire.Cli/Resources/xlf/RootCommandStrings.pl.xlf | Adds localized string entry for --no-log-file description. |
| src/Aspire.Cli/Resources/xlf/RootCommandStrings.ko.xlf | Adds localized string entry for --no-log-file description. |
| src/Aspire.Cli/Resources/xlf/RootCommandStrings.ja.xlf | Adds localized string entry for --no-log-file description. |
| src/Aspire.Cli/Resources/xlf/RootCommandStrings.it.xlf | Adds localized string entry for --no-log-file description. |
| src/Aspire.Cli/Resources/xlf/RootCommandStrings.fr.xlf | Adds localized string entry for --no-log-file description. |
| src/Aspire.Cli/Resources/xlf/RootCommandStrings.es.xlf | Adds localized string entry for --no-log-file description. |
| src/Aspire.Cli/Resources/xlf/RootCommandStrings.de.xlf | Adds localized string entry for --no-log-file description. |
| src/Aspire.Cli/Resources/xlf/RootCommandStrings.cs.xlf | Adds localized string entry for --no-log-file description. |
| src/Aspire.Cli/Resources/RootCommandStrings.resx | Adds NoLogFileArgumentDescription resource. |
| src/Aspire.Cli/Resources/RootCommandStrings.Designer.cs | Regenerates designer for new resource string. |
| src/Aspire.Cli/Program.cs | Introduces NoLogFile logging option + creates a null file logger provider when enabled. |
| src/Aspire.Cli/Diagnostics/StartupErrorWriter.cs | Allows null log file path when file logging is disabled. |
| src/Aspire.Cli/Diagnostics/FileLoggerProvider.cs | Adds CreateNull() to disable file I/O while keeping a no-op provider. |
| src/Aspire.Cli/CommonOptionNames.cs | Adds --no-log-file option constant. |
| src/Aspire.Cli/Commands/RunCommand.cs | Makes rendered log path optional in the run summary output. |
| src/Aspire.Cli/Commands/RootCommand.cs | Adds hidden recursive --no-log-file option at the root command level. |
| src/Aspire.Cli/Commands/DashboardRunCommand.cs | Makes rendered log path optional in the dashboard summary output. |
| src/Aspire.Cli/CliExecutionContext.cs | Makes LogFilePath nullable across execution context. |
| extension/src/views/AppHostDataRepository.ts | Routes describe/ps/get-apphosts process lifecycle logging to the CLI Logs channel and gates describe-watch by UI visibility. |
| extension/src/utils/workspace.ts | Enables CLI Logs channel logging for extension get-apphosts. |
| extension/src/utils/logging.ts | Adds the new “Aspire Extension - CLI Logs” output channel. |
| extension/src/utils/configInfoProvider.ts | Enables CLI Logs channel logging for config info calls. |
| extension/src/utils/cliPath.ts | Adds caching/coalescing and cache invalidation support for CLI path resolution. |
| extension/src/utils/AspirePackageRestoreProvider.ts | Reduces restore concurrency and logs restore CLI lifecycle to the CLI Logs channel. |
| extension/src/test/cliPath.test.ts | Adds tests for CLI path caching/coalescing and cache clearing. |
| extension/src/loc/strings.ts | Adds localized name for the new CLI Logs output channel. |
| extension/src/extension.ts | Starts/stops describe-watch based on panel/editor visibility; clears CLI path cache on settings changes. |
| extension/src/debugger/languages/cli.ts | Implements log-to-output-channel behavior + logs child process lifecycle. |
| extension/package.nls.json | Adds default (en) string for new CLI Logs output channel name. |
| extension/loc/xlf/aspire-vscode.xlf | Adds localization entry for new CLI Logs output channel name. |
| .vscode/settings.json | Changes repo-level VS Code Aspire settings defaults (auto-restore disabled). |
Files not reviewed (1)
- src/Aspire.Cli/Resources/RootCommandStrings.Designer.cs: Language not supported
Comments suppressed due to low confidence (1)
src/Aspire.Cli/Utils/AppHostHelper.cs:24
logFilePathis now nullable, but the error message always formatsErrorStrings.ProjectCouldNotBeAnalyzedwith it. When file logging is disabled this will produce an incomplete message ("See logs at "). Handle the null case explicitly (e.g., a different message, or instruct the user to re-run without--no-log-file/ with--log-file).
Co-authored-by: Copilot <[email protected]>
|
Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
|
Description
--no-log-fileto the CLI to complement--log-fileto avoid logging entirely.aspire.aspireCliExecutablePathchanges.aspire describewhen an apphost file is open or the panel is open, and tightens the describe-watch lifecycle so stale async starts do not spawn duplicate watchers..vscodedefaultaspire.enableAutoRestore: falseto avoid auto-restoring across very large workspaces.CC @JamesNK
Checklist
<code/>elements on your triple slash comments?aspire.devissue: