Skip to content

Conversation

@adamint
Copy link
Member

@adamint adamint commented Nov 3, 2025

Description

Isolates the CLI change from #12568, because this behavior should be backported to 13. The apphost should always be built in the extension - the extension can choose whether to call dotnet itself or use a registered task provider like c# dev kit.

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?

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

🚀 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 -- 12621

Or

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

@adamint adamint enabled auto-merge (squash) November 3, 2025 04:56
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

This PR simplifies the build skipping logic in the RunCommand by removing the capability-based check and always skipping the build when running in an extension host context. The change consolidates two previous conditions (extension host with DevKit capability OR single-file apphost) into a simpler approach where any extension host scenario skips the build, and removes the now-unused ShouldBuildAppHostInExtensionAsync helper method.

Key changes:

  • Simplified build condition from !isSingleFileAppHost || isExtensionHost to !isSingleFileAppHost && !isExtensionHost
  • Removed capability check (KnownCapabilities.DevKit) for extension hosts
  • Removed ShouldBuildAppHostInExtensionAsync helper method and related logic
  • Simplified status message display to always show "Building app host" instead of conditionally showing "Connecting to app host"

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/Aspire.Cli/Commands/RunCommand.cs Simplified build skipping logic to unconditionally skip builds when running in extension host, removed DevKit capability check, and deleted unused helper method
tests/Aspire.Cli.Tests/Commands/RunCommandTests.cs Added test case to verify build is skipped when running in extension without requiring DevKit capability

@adamint
Copy link
Member Author

adamint commented Nov 3, 2025

/backport to release/13.0

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

Started backporting to release/13.0: https://github.com/dotnet/aspire/actions/runs/19045123423

@adamint adamint merged commit 64ff63c into dotnet:main Nov 3, 2025
587 of 592 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 13.1 milestone Nov 3, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2025
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.

2 participants