Skip to content

Fix PR channel version selection in Aspire CLI#16125

Merged
mitchdenny merged 31 commits into
mainfrom
sebastienros/sebros-fix-cli-prerelease-install
Apr 21, 2026
Merged

Fix PR channel version selection in Aspire CLI#16125
mitchdenny merged 31 commits into
mainfrom
sebastienros/sebros-fix-cli-prerelease-install

Conversation

@sebastienros
Copy link
Copy Markdown
Contributor

Description

PR-built CLI installs can see both stable feed results and PR hive packages at the same time. That let aspire add, aspire new, and aspire init drift to a stable or latest version instead of the exact PR build version, which caused mismatches like stable AppHost package requests against prerelease-only PR hives.

This change prefers the current CLI version whenever a pr-* channel or PR hive is in play across package and template selection. It updates the shared .NET template selection path as well, adds focused unit coverage for add, new, and init, and reuses the shared test packaging helper instead of another file-local implementation.

Fixes # N/A

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

Copilot AI review requested due to automatic review settings April 13, 2026 18:21
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 13, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16125

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16125"

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes version drift when the Aspire CLI is running against PR hives / pr-* channels by preferring the currently installed CLI version during template and package selection, preventing mismatched stable vs PR-build dependencies.

Changes:

  • Prefer the current CLI/SDK version when resolving templates/packages from pr-* channels (and when PR hives are present for aspire add).
  • Add unit tests covering aspire new, aspire init, and aspire add PR-channel/PR-hive selection behavior.
  • Extend a shared test IPackagingService helper to allow test-controlled channel enumeration.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Aspire.Cli.Tests/TestServices/TestPackagingService.cs Adds a callback hook to control GetChannelsAsync in tests.
tests/Aspire.Cli.Tests/Commands/NewCommandTests.cs Adds coverage ensuring PR channel selects the current CLI version without prompting.
tests/Aspire.Cli.Tests/Commands/InitCommandTests.cs Adds coverage ensuring PR channel selects the current CLI version without prompting.
tests/Aspire.Cli.Tests/Commands/AddCommandTests.cs Adds coverage ensuring PR hives cause add to prefer the current CLI version.
src/Aspire.Cli/Utils/VersionHelper.cs Introduces IsPrChannel helper for consistent PR-channel detection.
src/Aspire.Cli/Templating/DotNetTemplateFactory.cs Prefers current CLI version when selecting templates from pr-* channels.
src/Aspire.Cli/Commands/NewCommand.cs Prefers current CLI version when resolving template version from a pr-* channel.
src/Aspire.Cli/Commands/InitCommand.cs Prefers current CLI version when selecting templates from pr-* channels.
src/Aspire.Cli/Commands/AddCommand.cs Prefers current CLI version for integration packages when PR hives are present.

Comment thread tests/Aspire.Cli.Tests/Commands/InitCommandTests.cs
Comment thread src/Aspire.Cli/Utils/VersionHelper.cs
@github-actions
Copy link
Copy Markdown
Contributor

Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

@eerhardt
Copy link
Copy Markdown
Member

/deployment-test

1 similar comment
@eerhardt
Copy link
Copy Markdown
Member

/deployment-test

@github-actions
Copy link
Copy Markdown
Contributor

🚀 Deployment tests starting on PR #16125...

This will deploy to real Azure infrastructure. Results will be posted here when complete.

View workflow run

@eerhardt
Copy link
Copy Markdown
Member

/deployment-test

@github-actions
Copy link
Copy Markdown
Contributor

🚀 Deployment tests starting on PR #16125...

This will deploy to real Azure infrastructure. Results will be posted here when complete.

View workflow run

@github-actions
Copy link
Copy Markdown
Contributor

🚀 Deployment tests starting on PR #16125...

This will deploy to real Azure infrastructure. Results will be posted here when complete.

View workflow run

@github-actions github-actions Bot temporarily deployed to deployment-testing April 14, 2026 01:37 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 14, 2026 01:37 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 14, 2026 01:37 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 14, 2026 01:37 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 14, 2026 01:37 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 14, 2026 01:37 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 14, 2026 01:37 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 14, 2026 01:37 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 14, 2026 01:37 Inactive
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Deployment tests starting on PR #16125...

This will deploy to real Azure infrastructure. Results will be posted here when complete.

View workflow run

@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot had a problem deploying to deployment-testing April 21, 2026 04:52 Failure
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@github-actions github-actions Bot temporarily deployed to deployment-testing April 21, 2026 04:52 Inactive
@aspire-repo-bot
Copy link
Copy Markdown
Contributor

Documentation Check ✅

No documentation PR is required for this change.

Reason: This is an internal bug fix for PR channel version selection in the Aspire CLI build infrastructure. All changes are in internal CLI command implementations (AddCommand, InitCommand, NewCommand), packaging services, and test files. No new public APIs, CLI commands, configuration options, or user-facing behaviors were introduced. The fix ensures consistency when installing from PR-built CLI channels — relevant only to contributors testing PR builds, not end users.

Generated by PR Documentation Check for issue #16125 · ● 292.3K ·

@github-actions
Copy link
Copy Markdown
Contributor

Deployment E2E Tests failed — 26 passed, 1 failed, 0 cancelled

View test results and recordings

View workflow run

Test Result Recording
Deployment.EndToEnd-VnetKeyVaultInfraDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-VnetSqlServerConnectivityDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-VnetSqlServerInfraDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-TypeScriptVnetSqlServerInfraDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-VnetKeyVaultConnectivityDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AcaCompactNamingDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-NspStorageKeyVaultDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-TypeScriptExpressDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureStorageDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureServiceBusDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureAppConfigDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AksStarterDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-FrontDoorDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureKeyVaultDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AuthenticationTests ✅ Passed
Deployment.EndToEnd-AcaStarterDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-VnetStorageBlobConnectivityDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureLogAnalyticsDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureContainerRegistryDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AcaCustomRegistryDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AksStarterWithRedisDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AcaDeploymentErrorOutputTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureEventHubsDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AcaExistingRegistryDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-VnetStorageBlobInfraDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AcaManagedRedisDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AppServiceReactDeploymentTests ❌ Failed ▶️ View Recording

@github-actions github-actions Bot mentioned this pull request Apr 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants