Skip to content

Fix aspire add in polyglot scenarios without .NET SDK#14817

Merged
davidfowl merged 1 commit intorelease/13.2from
davidfowl/fix-polyglot-add
Mar 1, 2026
Merged

Fix aspire add in polyglot scenarios without .NET SDK#14817
davidfowl merged 1 commit intorelease/13.2from
davidfowl/fix-polyglot-add

Conversation

@davidfowl
Copy link
Member

Description

aspire add fails with "No integration packages were found" in polyglot (TypeScript/Python/etc.) scenarios because the NuGetPackagePrefetcher background service skips package fetching when it detects the .NET SDK is not installed.

The prefetcher had an SDK availability gate that was unnecessary — the CLI always uses its bundled NuGet client for package discovery, not dotnet package search. Removing the gate allows package prefetching to work regardless of SDK availability.

Fixes #14702

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?

Remove the SDK availability gate from NuGetPackagePrefetcher that prevented package discovery when the .NET SDK was not installed. This caused 'aspire add' to fail with 'No integration packages were found' in polyglot (TypeScript/Python) scenarios.

Fixes #14702

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 1, 2026 00:36
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 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/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14817

Or

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

@davidfowl
Copy link
Member Author

We'll need a non interactive version of aspire add and that will enable easier testing of this e2e.

Copy link
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

Removes the .NET SDK availability gate in the CLI’s NuGet package prefetch background service so aspire add can discover integration packages in polyglot scenarios where the .NET SDK is not installed (per #14702).

Changes:

  • Drop IDotNetSdkInstaller from NuGetPackagePrefetcher and remove the early return when the SDK is unavailable.
  • Always allow template/CLI package prefetch to proceed (best-effort) regardless of SDK presence.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2026

🎬 CLI E2E Test Recordings

The following terminal recordings are available for commit 9185391:

Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AgentInitCommand_WithMalformedMcpJson_ShowsErrorAndExitsNonZero ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
CreateAndDeployToDockerCompose ▶️ View Recording
CreateAndDeployToDockerComposeInteractive ▶️ View Recording
CreateAndPublishToKubernetes ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateEmptyAppHostProject ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateStartWaitAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DescribeCommandResolvesReplicaNames ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ❌ Upload failed
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ▶️ View Recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View Recording

📹 Recordings uploaded automatically from CI run #22532423176

Copy link
Member

@JamesNK JamesNK left a comment

Choose a reason for hiding this comment

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

Test?

@davidfowl davidfowl merged commit 4f2d02e into release/13.2 Mar 1, 2026
685 of 688 checks passed
@davidfowl davidfowl deleted the davidfowl/fix-polyglot-add branch March 1, 2026 07:06
@dotnet-policy-service dotnet-policy-service bot added this to the 13.2 milestone Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants