Refactor overrideStagingHash to overrideStagingFeed and add overrideStagingQuality configuration#12775
Conversation
…ride Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12775Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12775" |
|
@copilot add configuration value that controls the PackageChannelQuality of the feed. Basically we should parse the string value of an |
…uality Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
Added |
|
@joperezr can you try this PR? Just download via the script, then do the following: aspire config set -g overrideStagingFeed https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json
aspire config set -g overrideStagingQuality Prerelease
aspire new (should show the prerelease templates from dotnet-libraries) |
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the staging channel configuration mechanism from a commit hash-based approach to a full URL-based approach, providing more flexibility and adding support for quality override configuration.
Key Changes:
- Refactored
GetCommitHashForStagingChannel()toGetStagingFeedUrl(), which now accepts full feed URLs viaoverrideStagingFeedconfiguration - Added
GetStagingQuality()method to support configurable channel quality viaoverrideStagingQualityconfiguration - Added URL validation to ensure override feeds are well-formed before use
- Enhanced test coverage with 6 new test cases covering URL validation, quality override, and edge cases
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Aspire.Cli/Packaging/PackagingService.cs |
Refactored staging channel configuration to use full URLs instead of commit hashes; added quality override support with validation and fallback logic |
tests/Aspire.Cli.Tests/Packaging/PackagingServiceTests.cs |
Updated existing tests to use new URL-based configuration; added comprehensive test coverage for URL validation, quality overrides (Prerelease/Both/Invalid), and edge cases |
|
/backport to release/13.0 |
|
Started backporting to release/13.0: https://github.com/dotnet/aspire/actions/runs/19182239761 |
|
@mitchdenny backporting to "release/13.0" failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Creating an empty commit: Initial plan
Applying: Refactor overrideStagingHash to overrideStagingFeed for full URL override
.git/rebase-apply/patch:57: trailing whitespace.
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M src/Aspire.Cli/Packaging/PackagingService.cs
M tests/Aspire.Cli.Tests/Packaging/PackagingServiceTests.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Aspire.Cli/Packaging/PackagingService.cs
Auto-merging tests/Aspire.Cli.Tests/Packaging/PackagingServiceTests.cs
CONFLICT (content): Merge conflict in tests/Aspire.Cli.Tests/Packaging/PackagingServiceTests.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 Refactor overrideStagingHash to overrideStagingFeed for full URL override
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
…tagingQuality configuration (#12775) * Initial plan * Refactor overrideStagingHash to overrideStagingFeed for full URL override Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com> * Add URL validation for overrideStagingFeed configuration Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com> * Add overrideStagingQuality configuration to control staging channel quality Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
…d add overrideS… (#12825) * Refactor overrideStagingHash to overrideStagingFeed and add overrideStagingQuality configuration (#12775) * Initial plan * Refactor overrideStagingHash to overrideStagingFeed for full URL override Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com> * Add URL validation for overrideStagingFeed configuration Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com> * Add overrideStagingQuality configuration to control staging channel quality Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com> * Remove excess tests. --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com> Co-authored-by: Mitch Denny <mitch@mitchdeny.com>
Description
Replaces
overrideStagingHashconfiguration withoverrideStagingFeedto allow overriding the entire staging feed URL instead of just the commit hash portion. AddsoverrideStagingQualityconfiguration to control the PackageChannelQuality of the staging feed.Changes
PackagingService.cs
GetCommitHashForStagingChannel()→GetStagingFeedUrl()overrideStagingHash→overrideStagingFeedGetStagingQuality()method to parseoverrideStagingQualityconfigurationPackagingServiceTests.cs
Example
Valid quality values (case-insensitive):
Stable- Only stable packages (default)Prerelease- Only prerelease packagesBoth- Both stable and prerelease packagesChecklist
<remarks />and<code />elements on your triple slash comments?doc-ideatemplatebreaking-changetemplatediagnostictemplateOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.