Fix aspire update --non-interactive crash when version downgrade or PR hive channels are detected#15602
Draft
Fix aspire update --non-interactive crash when version downgrade or PR hive channels are detected#15602
aspire update --non-interactive crash when version downgrade or PR hive channels are detected#15602Conversation
…orSelectionAsync Co-authored-by: radical <1472+radical@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/825f8980-70fe-49ad-b4dd-ea573778e09d
Copilot
AI
changed the title
[WIP] Fix crash in aspire update --non-interactive on version downgrade
Fix Mar 26, 2026
aspire update --non-interactive crash when version downgrade or PR hive channels are detected
radical
reviewed
Mar 26, 2026
| if (!InteractionService.SupportsInteractiveInput) | ||
| { | ||
| // In non-interactive mode, default to the stable channel | ||
| channel = PackageChannelNames.Stable; |
Member
There was a problem hiding this comment.
@davidfowl does this make sense? Maybe we should force the user to specify the channel, and fail the command?
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15602Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15602" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
aspire update --non-interactivecrashes withInvalidOperationException: Interactive input is not supportedin two scenarios: (1) when the update plan includes a version downgrade andConfirmAsyncis called unconditionally, and (2) when PR hive directories are present andPromptForSelectionAsyncis called without checking interactive capability (issue #15600).Changes
IInteractionService— Addedbool SupportsInteractiveInput { get; }so callers can gate on interactive capability before invoking selection prompts that have no default.ConsoleInteractionService.ConfirmAsync— ReturnsdefaultValueinstead of throwing when non-interactive. All update confirmation calls usedefaultValue: true, so updates auto-proceed in non-interactive mode.ConsoleInteractionService— ImplementsSupportsInteractiveInputdelegating to_hostEnvironment.SupportsInteractiveInput.ExtensionInteractionService— ImplementsSupportsInteractiveInputas_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 callingPromptForSelectionAsync.UpdateCommand.ExecuteSelfUpdateAsync— When no channel is specified in non-interactive mode, defaults tostableinstead of prompting.Tests — Updated
ConfirmAsync_WhenInteractiveInputNotSupportedto assert the default value is returned (not an exception thrown). AddedSupportsInteractiveInputto all testIInteractionServiceimplementations.Checklist
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/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)/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)/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.