Summary
When running a daily Aspire CLI, aspire update --channel staging can resolve/update the app to daily package versions instead of staging package versions. This makes it hard to intentionally move an app from daily packages down to the staging channel.
Repro
- Install or run a daily Aspire CLI build.
- Use an Aspire app that is on daily package versions.
- Run:
aspire update --channel staging
Expected
Passing --channel staging should constrain package resolution to the staging channel/packages. If a daily CLI cannot reliably know the staging feed/version to use, the command should fail clearly or require an explicit staging feed/version instead of selecting daily packages.
Actual
The update plan can propose daily package versions even though --channel staging was passed.
Brief RCA
UpdateCommand does honor the explicit option at the command-selection layer: it resolves --channel staging to the PackageChannel named staging from PackagingService.GetChannelsAsync().
The problem is that the staging channel produced by PackagingService is relative to the currently running CLI build/configuration rather than an independent staging target:
CreateStagingChannel() calls GetStagingFeedUrl(...).
- For stable-quality staging,
GetStagingFeedUrl(false) builds a darc feed URL from the current CLI assembly informational version/commit hash:
darc-pub-microsoft-aspire-{currentCliCommitHash}.
- For prerelease/Both staging quality without an explicit feed override, the code intentionally uses the shared daily feed:
https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json.
Then ProjectUpdater.GetLatestVersionOfPackageAsync() simply queries context.Channel.GetPackagesAsync(...), orders the returned packages by semantic version descending, and picks the highest version. So if the running daily CLI constructs a staging channel that points at the current daily build's darc feed or the shared daily feed, aspire update --channel staging still produces daily versions.
This is distinct from #16650: --channel is being read here, but the selected staging channel can resolve to the wrong feed/version for a daily-to-staging downgrade scenario.
Suggested fix
Make staging channel resolution deterministic for package updates and independent of the currently running daily CLI build. Possible approaches:
- Require/provide an explicit staging feed/version for daily-to-staging downgrades.
- Ensure daily CLI builds do not synthesize a
staging channel from the daily build commit or shared daily feed unless that is explicitly requested.
- Add validation/logging that displays the resolved feed/source and prevents
--channel staging from selecting daily feed/package versions.
Add regression coverage where a daily CLI/channel configuration is present and aspire update --channel staging must not select daily package versions.
Summary
When running a daily Aspire CLI,
aspire update --channel stagingcan resolve/update the app to daily package versions instead of staging package versions. This makes it hard to intentionally move an app from daily packages down to the staging channel.Repro
aspire update --channel stagingExpected
Passing
--channel stagingshould constrain package resolution to the staging channel/packages. If a daily CLI cannot reliably know the staging feed/version to use, the command should fail clearly or require an explicit staging feed/version instead of selecting daily packages.Actual
The update plan can propose daily package versions even though
--channel stagingwas passed.Brief RCA
UpdateCommanddoes honor the explicit option at the command-selection layer: it resolves--channel stagingto thePackageChannelnamedstagingfromPackagingService.GetChannelsAsync().The problem is that the
stagingchannel produced byPackagingServiceis relative to the currently running CLI build/configuration rather than an independent staging target:CreateStagingChannel()callsGetStagingFeedUrl(...).GetStagingFeedUrl(false)builds a darc feed URL from the current CLI assembly informational version/commit hash:darc-pub-microsoft-aspire-{currentCliCommitHash}.https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json.Then
ProjectUpdater.GetLatestVersionOfPackageAsync()simply queriescontext.Channel.GetPackagesAsync(...), orders the returned packages by semantic version descending, and picks the highest version. So if the running daily CLI constructs a staging channel that points at the current daily build's darc feed or the shared daily feed,aspire update --channel stagingstill produces daily versions.This is distinct from #16650:
--channelis being read here, but the selectedstagingchannel can resolve to the wrong feed/version for a daily-to-staging downgrade scenario.Suggested fix
Make
stagingchannel resolution deterministic for package updates and independent of the currently running daily CLI build. Possible approaches:stagingchannel from the daily build commit or shared daily feed unless that is explicitly requested.--channel stagingfrom selecting daily feed/package versions.Add regression coverage where a daily CLI/channel configuration is present and
aspire update --channel stagingmust not select daily package versions.