Skip to content

Add CLI logs output channel logging for describe process lifecycle, reduce aspire describe calls, other performance improvements#15963

Draft
adamint wants to merge 7 commits intomicrosoft:mainfrom
adamint:dev/adamint/excessive-cli-logs
Draft

Add CLI logs output channel logging for describe process lifecycle, reduce aspire describe calls, other performance improvements#15963
adamint wants to merge 7 commits intomicrosoft:mainfrom
adamint:dev/adamint/excessive-cli-logs

Conversation

@adamint
Copy link
Copy Markdown
Member

@adamint adamint commented Apr 8, 2026

Description

  • In spawned CLI processes (outside of an aspire terminal), changed so that debug output is logged to the new cli output channel and NOT a file.
  • Reduces aspire restore parallelization from 4 to 2.
  • Adds --no-log-file to the CLI to complement --log-file to avoid logging entirely.
  • Adds an aspire cli availability cache, including coalescing concurrent resolutions and invalidation when aspire.aspireCliExecutablePath changes.
  • Only calls aspire describe when 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.
  • Sets the repo .vscode default aspire.enableAutoRestore: false to avoid auto-restoring across very large workspaces.

CC @JamesNK

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add `` and <code/> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

Copilot AI review requested due to automatic review settings April 8, 2026 17:12
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15963

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15963"

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-file support and makes log file path nullable across relevant plumbing.
  • VS Code extension: refines describe --follow watch 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

  • logFilePath is now nullable, but the error message always formats ErrorStrings.ProjectCouldNotBeAnalyzed with 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).

@adamint adamint changed the title Add CLI logs output channel logging for describe process lifecycle Add CLI logs output channel logging for describe process lifecycle, reduce aspire describe calls, other performance improvements Apr 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

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.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

@adamint adamint marked this pull request as draft April 9, 2026 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants