[13.3] `aspire update --self --channel staging` rejects staging after installing a PR CLI
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
`aspire update --self --channel staging` fails when the currently installed CLI came from a PR channel, even though the staging channel feature is enabled in configuration.
Observed command output:
```text
Updating to channel: staging
Failed to update CLI: Unsupported channel 'staging'. Available channels: default, stable, daily, pr-15814, pr-15918, pr-16235, pr-16603.
```
The available channels should include `staging` because `features.stagingChannelEnabled` is set to `true`. In this environment, the current global channel is a PR channel (`pr-16603`) because the CLI was installed from a PR build first, and the next step was to switch back to staging with self-update.
The relevant implementation appears to be:
```text
UpdateCommand.ExecuteSelfUpdateAsync -> CliDownloader.DownloadLatestCliAsync -> PackagingService.GetChannelsAsync
```
`CliDownloader` rejects `staging` because `PackagingService.GetChannelsAsync()` returned a channel list without staging. `PackagingService` only adds staging when `KnownFeatures.IsStagingChannelEnabled(features, configuration)` is true, but the CLI behavior suggests that the enabled feature flag is not being honored in this self-update path, or the effective configuration seen by packaging differs from what `aspire config list --all` reports.
### Expected Behavior
When `features.stagingChannelEnabled` is true, `staging` should be included in the available channels for `aspire update --self --channel staging`, regardless of the current persisted `channel` value being a PR channel.
The command should update the CLI to the staging channel instead of failing validation with `Unsupported channel 'staging'`.
### Steps To Reproduce
1. Install or switch the Aspire CLI to a PR channel, for example `pr-16603`.
2. Enable staging channel access globally:
```text
aspire config set features.stagingChannelEnabled true --global
```
3. Optionally also enable it locally in a workspace:
```text
aspire config set features.stagingChannelEnabled true
```
4. Verify configuration:
```text
aspire config list --all
```
Observed configuration includes:
```text
Local configuration
Key Value
features.experimentalPolyglot.python true
features.stagingChannelEnabled true
language python
Global configuration
Key Value
channel pr-16603
features.stagingChannelEnabled true
```
5. Run:
```text
aspire update --self --channel staging
```
6. Observe that staging is rejected as unsupported.
### Exceptions (if any)
```text
Failed to update CLI: Unsupported channel 'staging'. Available channels: default, stable, daily, pr-15814, pr-15918, pr-16235, pr-16603.
```
### Aspire doctor output
Not captured for this report.
### Anything else?
This blocks switching from a PR-installed CLI back to the staging CLI using the documented/expected staging channel path.
The error also shows PR hive channels in the available channel list, so package channel discovery is finding the local PR hives but not adding the staging channel despite the feature flag being enabled.
Contributor guide
Assessment
This issue has not been assessed yet.