Add override options for staging feed and quality in configuration schema and implement related tests#14455
Conversation
…hema and implement related tests
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14455Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14455" |
There was a problem hiding this comment.
Pull request overview
This PR adds configuration options to address a critical issue where the staging channel fails when builds aren't marked as stable. The staging channel normally constructs SHA-specific NuGet feeds (darc-pub-dotnet-aspire-{hash}) that only exist for stable-quality builds. When staging builds are prerelease, these feeds don't exist, causing aspire new and aspire update to fail.
Changes:
- Adds
overrideStagingFeedandoverrideStagingQualityconfiguration options with JSON schema support for IntelliSense - Implements automatic fallback to the shared dotnet9 daily feed when quality is Prerelease/Both and no explicit feed override is provided
- Disables
configureGlobalPackagesFolderfor shared feed scenarios (package isolation not needed) - Provides comprehensive test coverage for all new scenarios
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| extension/schemas/aspire-settings.schema.json | Added schema definitions for overrideStagingFeed (string) and overrideStagingQuality (enum: Stable/Prerelease/Both) |
| extension/schemas/aspire-global-settings.schema.json | Added identical schema definitions for global settings file |
| src/Aspire.Cli/Packaging/PackagingService.cs | Modified CreateStagingChannel() to compute useSharedFeed flag based on quality and feed override state; updated GetStagingFeedUrl() to return shared feed when appropriate; disabled configureGlobalPackagesFolder for shared feed mode |
| tests/Aspire.Cli.Tests/Packaging/PackagingServiceTests.cs | Added 4 comprehensive tests covering: Prerelease quality uses shared feed, Both quality uses shared feed, explicit feed override takes precedence, and NuGet config correctly omits globalPackagesFolder in shared feed mode |
…ent related logic in PackagingService
mitchdenny
left a comment
There was a problem hiding this comment.
Once we've got this in and done basic validation on the E2E scenario we should add an E2E CLI test so we can continue to automatically validate it.
Description
cc: @mitchdenny
Problem
The staging channel constructs a SHA-specific NuGet feed URL (darc-pub-dotnet-aspire-{hash}) for package resolution. These feeds are only created by DARC for stable-quality builds. When staging builds aren't yet marked as stable, the SHA-specific feed doesn't exist
(or is empty), causing aspire new and aspire update to fail for users on the staging channel.
Solution
When overrideStagingQuality is set to Prerelease or Both and no explicit overrideStagingFeed is provided, the staging channel now falls back to the shared dotnet9 daily feed instead of constructing a SHA-based feed. This also disables configureGlobalPackagesFolder
since package isolation isn't needed with the shared feed.
The logic: SHA-specific feeds only contain stable builds, so a non-Stable quality without an explicit feed override can only work with the shared feed — making this a natural signal rather than requiring a new config key.
How to enable
// ~/.aspire/globalsettings.json
{
"overrideStagingQuality": "Prerelease",
"features": { "stagingChannelEnabled": true }
}
Changes
shared feed mode.
Rollback
Once staging builds are published as stable again, remove overrideStagingQuality from settings. The code is safe to leave in — the default quality is Stable, so the shared-feed path is never taken unless explicitly configured.
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: