Skip to content

Fix aspire update --non-interactive crash when version downgrade or PR hive channels are detected#15602

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-aspire-update-version-downgrade-error
Draft

Fix aspire update --non-interactive crash when version downgrade or PR hive channels are detected#15602
Copilot wants to merge 2 commits intomainfrom
copilot/fix-aspire-update-version-downgrade-error

Conversation

Copy link
Contributor

Copilot AI commented Mar 26, 2026

aspire update --non-interactive crashes with InvalidOperationException: Interactive input is not supported in two scenarios: (1) when the update plan includes a version downgrade and ConfirmAsync is called unconditionally, and (2) when PR hive directories are present and PromptForSelectionAsync is called without checking interactive capability (issue #15600).

Changes

  • IInteractionService — Added bool SupportsInteractiveInput { get; } so callers can gate on interactive capability before invoking selection prompts that have no default.

  • ConsoleInteractionService.ConfirmAsync — Returns defaultValue instead of throwing when non-interactive. All update confirmation calls use defaultValue: true, so updates auto-proceed in non-interactive mode.

  • ConsoleInteractionService — Implements SupportsInteractiveInput delegating to _hostEnvironment.SupportsInteractiveInput.

  • ExtensionInteractionService — Implements SupportsInteractiveInput as _extensionPromptEnabled || _consoleInteractionService.SupportsInteractiveInput.

  • UpdateCommand.ExecuteAsync — When PR hive channels are present but interactive input is not supported, falls through to the implicit/default channel instead of calling PromptForSelectionAsync.

  • UpdateCommand.ExecuteSelfUpdateAsync — When no channel is specified in non-interactive mode, defaults to stable instead of prompting.

  • Tests — Updated ConfirmAsync_WhenInteractiveInputNotSupported to assert the default value is returned (not an exception thrown). Added SupportsInteractiveInput to all test IInteractionService implementations.

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
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
    • No

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • centralus-2.in.applicationinsights.azure.com
    • Triggering command: /home/REDACTED/work/aspire/aspire/artifacts/bin/Aspire.Cli.Tests/Debug/net10.0/Aspire.Cli.Tests /home/REDACTED/work/aspire/aspire/artifacts/bin/Aspire.Cli.Tests/Debug/net10.0/Aspire.Cli.Tests --internal-msbuild-node /home/REDACTED/.local/share/95e09aafa41a4c1e83fd0f10a5126b1c/.p --filter-not-trait category=failing --filter-not-trait quarantined=true --filter-not-trait outerloop=true (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/aspire/aspire/artifacts/bin/Aspire.Cli.Tests/Debug/net10.0/Aspire.Cli.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/aspire/aspire/artifacts/bin/Aspire.Cli.Tests/Debug/net10.0/Aspire.Cli.Tests.deps.json /home/REDACTED/work/aspire/aspire/artifacts/bin/Aspire.Cli.Tests/Debug/net10.0/Microsoft.DotNet.RemoteExecutor.dll Aspire.Cli.Tests, Version=42.42.42.42, Culture=neutral, PublicKeyToken=null Aspire.Cli.Tests.CliSmokeTests+<>c <LocaleOverrideReturnsExitCode>b__4_0 /tmp/dw3wkvdx.ytl invalid-locale False ASPIRE_LOCALE_OVERRIDE (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/aspire/aspire/artifacts/bin/Aspire.Cli.Tests/Debug/net10.0/Aspire.Cli.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/aspire/aspire/artifacts/bin/Aspire.Cli.Tests/Debug/net10.0/Aspire.Cli.Tests.deps.json /home/REDACTED/work/aspire/aspire/artifacts/bin/Aspire.Cli.Tests/Debug/net10.0/Microsoft.DotNet.RemoteExecutor.dll Aspire.Cli.Tests, Version=42.42.42.42, Culture=neutral, PublicKeyToken=null Aspire.Cli.Tests.CliSmokeTests+<>c <LocaleOverrideReturnsExitCode>b__4_0 /tmp/dw3wkvdx.ytl (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Copilot AI changed the title [WIP] Fix crash in aspire update --non-interactive on version downgrade Fix aspire update --non-interactive crash when version downgrade or PR hive channels are detected Mar 26, 2026
Copilot AI requested a review from radical March 26, 2026 06:02
if (!InteractionService.SupportsInteractiveInput)
{
// In non-interactive mode, default to the stable channel
channel = PackageChannelNames.Stable;
Copy link
Member

Choose a reason for hiding this comment

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

@davidfowl does this make sense? Maybe we should force the user to specify the channel, and fail the command?

@github-actions
Copy link
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 -- 15602

Or

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

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