Skip to content

Improve VS Code AppHost build failure notifications - #19755

Open
Ella Hathaway (ellahathaway) wants to merge 8 commits into
mainfrom
ellahathaway-vscode-build-failure-ux
Open

Improve VS Code AppHost build failure notifications#19755
Ella Hathaway (ellahathaway) wants to merge 8 commits into
mainfrom
ellahathaway-vscode-build-failure-ux

Conversation

@ellahathaway

@ellahathaway Ella Hathaway (ellahathaway) commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Description

AppHost build failures in VS Code currently produce separate error and log-path notifications, and the log path must be copied manually. This change consolidates that experience into one error notification with Open CLI Log and, when available, Open AppHost Log actions while keeping the full diagnostics and log locations in the Debug Console.

The CLI/extension backchannel now supports reusable structured message actions. Each action has a display name and either a command to execute or a file path to open. VS Code hides actions whose command is not registered or whose file is not an existing absolute path, and action selection remains asynchronous so the CLI does not wait for the notification.

The behavior is gated by the extension-advertised message-actions.v1 capability. A newer CLI paired with an older extension retains the existing separate error and log notifications; an older CLI paired with the newer extension continues using the existing pathless message RPCs. This replaces the previous localized-message parsing approach and incorporates the diagnostic-log scenarios from #19679.

User-facing usage

When an AppHost fails to build during a run or debug launch, VS Code shows one error notification. Selecting a log action opens that file directly in a non-preview editor.

Screenshots / Recordings

Before:
https://github.com/user-attachments/assets/5d2f732e-a11d-4c77-abea-005f3afc43d2

After:
https://github.com/user-attachments/assets/d53a6b0f-fe4f-4f77-bde9-fda29081aad3

Validation

  • Built the Aspire CLI and VS Code extension together with extension\build.ps1 after merging current main.
  • Passed 65 focused Aspire.Cli.Tests covering combined actions, legacy fallback, capability failures, console output, and the AOT JSON wire shape.
  • Passed extension lint/compilation and 72 focused extension tests covering command/file actions, unavailable-action filtering, nonblocking notification selection, cancellation, and existing resource-command log actions.
  • Updated the existing failed-AppHost-build E2E scenario to verify Debug Console diagnostics, one relevant notification, and the log-opening action.

Fixes #19748
Fixes #19511

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 <remarks /> 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
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b4574890-67c5-476a-abdd-cd5ac59e9418
Copilot AI balanced review requested due to automatic review settings August 27, 2026 20:05
@github-actions

Copy link
Copy Markdown
Contributor

🚀 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 -- 19755

Or

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

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Consolidates CLI build failures into one VS Code notification with an Open CLI Log action while preserving diagnostics and backward compatibility.

Changes:

  • Adds capability-gated CLI/extension RPC support for associated log files.
  • Opens CLI logs in a non-preview editor.
  • Adds unit, compatibility, command, and extension E2E coverage.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/Aspire.Cli.Tests/TestServices/TestInteractionService.cs Records combined errors and log paths.
tests/Aspire.Cli.Tests/TestServices/TestExtensionInteractionService.cs Implements the new test interface method.
tests/Aspire.Cli.Tests/TestServices/TestExtensionBackchannel.cs Supports combined-error RPC testing.
tests/Aspire.Cli.Tests/Templating/DotNetTemplateFactoryTests.cs Updates the interaction test stub.
tests/Aspire.Cli.Tests/Projects/ExtensionGuestLauncherTests.cs Updates the interaction test stub.
tests/Aspire.Cli.Tests/Interaction/ExtensionInteractionServiceTests.cs Tests capability and fallback behavior.
tests/Aspire.Cli.Tests/Commands/UpdateCommandTests.cs Forwards the new interaction method.
tests/Aspire.Cli.Tests/Commands/RunCommandTests.cs Verifies build failures include the CLI log.
tests/Aspire.Cli.Tests/Commands/PublishCommandPromptingIntegrationTests.cs Updates the interaction test implementation.
tests/Aspire.Cli.Tests/Commands/BaseCommandTests.cs Verifies combined unexpected-error reporting.
src/Aspire.Cli/Utils/ExtensionHelper.cs Defines the versioned capability.
src/Aspire.Cli/Interaction/IInteractionService.cs Adds combined error/log reporting.
src/Aspire.Cli/Interaction/ExtensionInteractionService.cs Negotiates RPC behavior and preserves console output.
src/Aspire.Cli/Interaction/ConsoleInteractionService.cs Retains the console two-line presentation.
src/Aspire.Cli/Commands/BaseCommand.cs Routes eligible failures through combined reporting.
src/Aspire.Cli/Backchannel/ExtensionBackchannel.cs Sends the optional log path over RPC.
extension/src/test/rpc/interactionServiceTests.test.ts Tests the notification action.
extension/src/test-e2e/debugDashboard.e2e.test.ts Covers the complete failure UX.
extension/src/server/interactionService.ts Displays the action and opens the log.
extension/src/capabilities.ts Advertises extension support.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b4574890-67c5-476a-abdd-cd5ac59e9418
Copilot AI review requested due to automatic review settings August 27, 2026 23:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread extension/src/utils/diagnosticLogPath.ts Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b4574890-67c5-476a-abdd-cd5ac59e9418
Copilot AI review requested due to automatic review settings August 28, 2026 00:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread extension/src/utils/diagnosticLogPath.ts Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b4574890-67c5-476a-abdd-cd5ac59e9418
Copilot AI review requested due to automatic review settings August 28, 2026 01:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b4574890-67c5-476a-abdd-cd5ac59e9418
Copilot AI review requested due to automatic review settings August 28, 2026 01:27
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

Comment thread extension/src/server/interactionService.ts Outdated
Replace extension-side log-message parsing with capability-gated CLI message actions for opening files or running registered commands. Preserve legacy notifications for older extensions and keep diagnostic paths in console output.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b4574890-67c5-476a-abdd-cd5ac59e9418
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b4574890-67c5-476a-abdd-cd5ac59e9418
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Tests selector

2 / 99 PR test projects · 4 PR jobs · 1 advisory-only target, from 32 changed files.

Selected PR test projects (2 / 99)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests

Selected PR jobs (4)

extension-e2e, extension-unit, polyglot, typescript-api-compat

Advisory workflow impact (1)

  • deployment-e2e (schedule/dispatch-only)

How these were chosen — grouped by what changed

📦 affected project Aspire.Cli
1 test: Aspire.Cli.EndToEnd.Tests

🔧 src/Aspire.Cli/Resources/InteractionServiceStrings.Designer.cs (changed source)
1 via the project graph: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.Tests/Backchannel/BackchannelJsonSerializerContextTests.cs (changed test)
1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Commands/BaseCommandTests.cs (changed test)
1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Interaction/ExtensionInteractionServiceTests.cs (changed test)
1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Projects/ExtensionGuestLauncherTests.cs (changed test)
1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/TestServices/TestExtensionBackchannel.cs (changed test)
1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/TestServices/TestExtensionInteractionService.cs (changed test)
1 directly: Aspire.Cli.Tests

Job reasons

Job Triggered by
deployment-e2e affected project Aspire.Cli
extension-e2e extension/src/capabilities.ts, extension/src/server/interactionService.ts, extension/src/test-e2e/debugDashboard.e2e.test.ts, extension/src/test/appHostLogOutputCapability.test.ts, extension/src/test/rpc/interactionServiceTests.test.ts, src/Aspire.Cli/Backchannel/BackchannelJsonSerializerContext.cs, src/Aspire.Cli/Backchannel/ExtensionBackchannel.cs, src/Aspire.Cli/Backchannel/ExtensionBackchannelDataTypes.cs, src/Aspire.Cli/Commands/BaseCommand.cs, src/Aspire.Cli/Interaction/ExtensionInteractionService.cs, src/Aspire.Cli/Resources/InteractionServiceStrings.Designer.cs, src/Aspire.Cli/Resources/InteractionServiceStrings.resx, src/Aspire.Cli/Resources/xlf/InteractionServiceStrings.cs.xlf, src/Aspire.Cli/Resources/xlf/InteractionServiceStrings.de.xlf, src/Aspire.Cli/Resources/xlf/InteractionServiceStrings.es.xlf, src/Aspire.Cli/Resources/xlf/InteractionServiceStrings.fr.xlf, src/Aspire.Cli/Resources/xlf/InteractionServiceStrings.it.xlf, src/Aspire.Cli/Resources/xlf/InteractionServiceStrings.ja.xlf, src/Aspire.Cli/Resources/xlf/InteractionServiceStrings.ko.xlf, src/Aspire.Cli/Resources/xlf/InteractionServiceStrings.pl.xlf, src/Aspire.Cli/Resources/xlf/InteractionServiceStrings.pt-BR.xlf, src/Aspire.Cli/Resources/xlf/InteractionServiceStrings.ru.xlf, src/Aspire.Cli/Resources/xlf/InteractionServiceStrings.tr.xlf, src/Aspire.Cli/Resources/xlf/InteractionServiceStrings.zh-Hans.xlf, src/Aspire.Cli/Resources/xlf/InteractionServiceStrings.zh-Hant.xlf, src/Aspire.Cli/Utils/ExtensionHelper.cs, tests/Aspire.Cli.Tests/Backchannel/BackchannelJsonSerializerContextTests.cs, tests/Aspire.Cli.Tests/Commands/BaseCommandTests.cs, tests/Aspire.Cli.Tests/Interaction/ExtensionInteractionServiceTests.cs, tests/Aspire.Cli.Tests/Projects/ExtensionGuestLauncherTests.cs, tests/Aspire.Cli.Tests/TestServices/TestExtensionBackchannel.cs, tests/Aspire.Cli.Tests/TestServices/TestExtensionInteractionService.cs
• affected project Aspire.Cli
extension-unit extension/src/capabilities.ts, extension/src/server/interactionService.ts, extension/src/test-e2e/debugDashboard.e2e.test.ts, extension/src/test/appHostLogOutputCapability.test.ts, extension/src/test/rpc/interactionServiceTests.test.ts
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit 7e32352.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 31 out of 32 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • src/Aspire.Cli/Resources/InteractionServiceStrings.Designer.cs: Generated file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 participants