Skip to content

Embed distribution channel in CLI binary instead of relying on aspire.config.json #15947

@radical

Description

@radical

Summary

The Aspire CLI should know its distribution channel — stable, daily, or pr — via build-time metadata embedded in the binary, rather than reading a mutable "channel" setting from aspire.config.json.

Proposed channels

Channel Built from
stable Release branches, official builds
daily main, official daily builds
pr PR CI builds, localhive

Mechanism

  1. New MSBuild property<CliChannel>stable</CliChannel> — set per build configuration:

    • Official release builds: stable
    • Official daily builds: daily
    • localhive / PR scripts: pr
  2. Bake into binary — surface as [assembly: AssemblyMetadata("CliChannel", "stable")] so it can be read at runtime without sidecar files.

  3. Runtime behaviorPackagingService.GetChannelsAsync() uses the embedded channel as its default instead of falling back to an implicit "whatever NuGet feeds are configured" channel. The embedded channel determines:

    • Which NuGet feeds to search for packages
    • Which CLI download base URL to use for aspire update --self
    • Whether self-update is available at all (PR builds: no)
    • Which package quality to search for (stable → stable only, daily → prerelease)
  4. Remove "channel" from aspire.config.json — the --channel CLI argument on aspire update can remain as an override for power users, but the default comes from the embedded metadata.

Key files

File Change
src/Aspire.Cli/Aspire.Cli.csproj Add CliChannel property, emit assembly metadata
src/Aspire.Cli/Packaging/PackagingService.cs Read embedded channel, use as default for GetChannelsAsync()
src/Aspire.Cli/Commands/UpdateCommand.cs Use embedded channel as default for --self update
src/Aspire.Cli/Configuration/AspireConfigFile.cs Remove Channel property
eng/Bundle.proj Set CliChannel based on build type
localhive.sh / localhive.ps1 Set CliChannel=pr when building
eng/clipack/Common.projitems Set CliChannel for archive builds

Related

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions