Skip to content

Fix duplicate dashboard stopping message - #18827

Merged
James Newton-King (JamesNK) merged 3 commits into
mainfrom
fix/dashboard-run-stopping-message
Jul 22, 2026
Merged

Fix duplicate dashboard stopping message#18827
James Newton-King (JamesNK) merged 3 commits into
mainfrom
fix/dashboard-run-stopping-message

Conversation

@JamesNK

@JamesNK James Newton-King (JamesNK) commented Jul 20, 2026

Copy link
Copy Markdown
Member

Description

Stopping aspire dashboard run currently displays both the dashboard-specific shutdown message and the generic Aspire shutdown message. This change centralizes cancellation rendering in BaseCommand while allowing commands to customize the message, so dashboard run emits exactly one punctuated shutdown line for both fast and slow cancellation paths.

User-facing usage

Pressing Ctrl+C while the standalone dashboard is running now changes the shutdown output from:

Stopping dashboard
Stopping Aspire.

to:

Stopping dashboard.
image

Validation

  • 73 BaseCommandTests and DashboardRunCommandTests passed.
  • Updated localization files with dotnet build /t:UpdateXlf src/Aspire.Cli/Aspire.Cli.csproj.

Fixes # (issue)

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

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

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

This PR removes the duplicate shutdown output when stopping aspire dashboard run by centralizing cancellation message rendering in BaseCommand, while allowing commands (dashboard) to override the displayed message.

Changes:

  • Added a virtual cancellation-message hook in BaseCommand and routed cancellation rendering through it.
  • Overrode cancellation rendering in DashboardRunCommand to emit only the dashboard-specific stopping message.
  • Updated tests and localization resources to reflect the punctuated “Stopping dashboard.” message.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/Aspire.Cli.Tests/Commands/DashboardRunCommandTests.cs Updates cancellation test to validate the single stopping message on both fast/slow cancellation paths.
src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.zh-Hant.xlf Updates localized resource string to include trailing period.
src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.zh-Hans.xlf Updates localized resource string to include trailing period.
src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.tr.xlf Updates localized resource string to include trailing period.
src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.ru.xlf Updates localized resource string to include trailing period.
src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.pt-BR.xlf Updates localized resource string to include trailing period.
src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.pl.xlf Updates localized resource string to include trailing period.
src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.ko.xlf Updates localized resource string to include trailing period.
src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.ja.xlf Updates localized resource string to include trailing period.
src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.it.xlf Updates localized resource string to include trailing period.
src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.fr.xlf Updates localized resource string to include trailing period.
src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.es.xlf Updates localized resource string to include trailing period.
src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.de.xlf Updates localized resource string to include trailing period.
src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.cs.xlf Updates localized resource string to include trailing period.
src/Aspire.Cli/Resources/DashboardCommandStrings.resx Updates the source resource string to include trailing period.
src/Aspire.Cli/Commands/DashboardRunCommand.cs Adds a command-specific cancellation message override and removes message emission from local cancellation paths.
src/Aspire.Cli/Commands/BaseCommand.cs Introduces overridable cancellation rendering and uses it from centralized cancellation handling.

Comment thread src/Aspire.Cli/Commands/DashboardRunCommand.cs Outdated
Comment thread tests/Aspire.Cli.Tests/Commands/DashboardRunCommandTests.cs
Copilot AI review requested due to automatic review settings July 20, 2026 02:16
@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 -- 18827

Or

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

@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 17 out of 17 changed files in this pull request and generated 2 comments.

Comment thread tests/Aspire.Cli.Tests/Commands/DashboardRunCommandTests.cs Outdated
Comment thread src/Aspire.Cli/Commands/DashboardRunCommand.cs Outdated
Copilot AI review requested due to automatic review settings July 22, 2026 00:06
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector (audit mode)

The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement.

2 / 100 test projects · 5 jobs, from 28 changed files.

Selected test projects (2 / 100)

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

Selected jobs (5)

cli-starter, deployment-e2e, extension-e2e, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

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

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

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

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

🧪 tests/Aspire.Cli.Tests/Commands/UpdateCommandTests.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/Templating/DotNetTemplateFactoryTests.cs (changed test)
1 directly: Aspire.Cli.Tests

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

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

Job reasons

Job Triggered by
cli-starter • affected project Aspire.Cli
• selected test Aspire.Cli.Tests
deployment-e2e affected project Aspire.Cli
extension-e2e src/Aspire.Cli/Commands/BaseCommand.cs, src/Aspire.Cli/Commands/DashboardRunCommand.cs, src/Aspire.Cli/Interaction/ConsoleInteractionService.cs, src/Aspire.Cli/Interaction/ExtensionInteractionService.cs, src/Aspire.Cli/Interaction/IInteractionService.cs, src/Aspire.Cli/Resources/DashboardCommandStrings.resx, src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.cs.xlf, src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.de.xlf, src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.es.xlf, src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.fr.xlf, src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.it.xlf, src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.ja.xlf, src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.ko.xlf, src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.pl.xlf, src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.pt-BR.xlf, src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.ru.xlf, src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.tr.xlf, src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.zh-Hans.xlf, src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.zh-Hant.xlf, tests/Aspire.Cli.Tests/Commands/BaseCommandTests.cs, tests/Aspire.Cli.Tests/Commands/DashboardRunCommandTests.cs, tests/Aspire.Cli.Tests/Commands/PublishCommandPromptingIntegrationTests.cs, tests/Aspire.Cli.Tests/Commands/UpdateCommandTests.cs, tests/Aspire.Cli.Tests/Interaction/ExtensionInteractionServiceTests.cs, tests/Aspire.Cli.Tests/Projects/ExtensionGuestLauncherTests.cs, tests/Aspire.Cli.Tests/Templating/DotNetTemplateFactoryTests.cs, tests/Aspire.Cli.Tests/TestServices/TestExtensionInteractionService.cs, tests/Aspire.Cli.Tests/TestServices/TestInteractionService.cs
• affected project Aspire.Cli
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit ae03b4e.

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 28 out of 28 changed files in this pull request and generated 1 comment.

Comment thread src/Aspire.Cli/Commands/DashboardRunCommand.cs
@JamesNK
James Newton-King (JamesNK) merged commit fc96471 into main Jul 22, 2026
342 checks passed
@JamesNK
James Newton-King (JamesNK) deleted the fix/dashboard-run-stopping-message branch July 22, 2026 23:45
@github-actions github-actions Bot added this to the 13.5 milestone Jul 22, 2026
@aspire-repo-bot

This comment has been minimized.

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1445 targeting release/13.5.

Triggered signals: cli_command_file_changed (DashboardRunCommand.cs), cli_resource_strings_changed (DashboardCommandStrings.resx), pr_body_has_user_facing_section (PR body's "User-facing usage" section showing the before/after Ctrl+C shutdown output).

Updated reference/cli/commands/aspire-dashboard-run.mdx to document that pressing Ctrl+C stops the dashboard and now prints a single Stopping dashboard. message, replacing the old duplicate-message behavior.

Note

This draft PR needs human review before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants