Skip to content

Hide the aspire setup command if the bundle isn't available#14464

Merged
davidfowl merged 3 commits intorelease/13.2from
copilot/hide-aspire-setup-command
Feb 12, 2026
Merged

Hide the aspire setup command if the bundle isn't available#14464
davidfowl merged 3 commits intorelease/13.2from
copilot/hide-aspire-setup-command

Conversation

Copy link
Contributor

Copilot AI commented Feb 12, 2026

  • Understand the change: setup command is conditionally added based on bundleService.IsBundle
  • Explore existing test patterns (ExecCommand feature flag tests, CliTestHelper, NullBundleService)
  • Add BundleServiceFactory option to CliServiceCollectionTestOptions to allow overriding IBundleService in tests
  • Add TestBundleService with configurable IsBundle property
  • Write tests in RootCommandTests.cs:
    • SetupCommand_NotAvailable_WhenBundleIsNotAvailable — verifies setup is hidden when no bundle
    • SetupCommand_Available_WhenBundleIsAvailable — verifies setup is shown when bundle exists
  • All 1247 CLI tests pass (2 new tests added)
  • Code review: no issues found
  • Security scan: no issues found

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Conditionally add SetupCommand to the CLI command tree only when
IBundleService.IsBundle is true, following the same pattern used for
ExecCommand and SdkCommand feature-flag gating.

Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Copilot AI changed the title [WIP] Hide aspire setup command when bundle is unavailable Hide the aspire setup command if the bundle isn't available Feb 12, 2026
Copilot AI requested a review from davidfowl February 12, 2026 06:21
Add two tests to RootCommandTests:
- SetupCommand_NotAvailable_WhenBundleIsNotAvailable: verifies setup
  command is hidden when the CLI has no embedded bundle
- SetupCommand_Available_WhenBundleIsAvailable: verifies setup command
  is visible when the CLI has an embedded bundle

Also add BundleServiceFactory to CliServiceCollectionTestOptions and
TestBundleService to support overriding bundle behavior in tests.

Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
@davidfowl davidfowl marked this pull request as ready for review February 12, 2026 06:32
Copilot AI review requested due to automatic review settings February 12, 2026 06:32
@github-actions
Copy link
Contributor

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

Or

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

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 updates the Aspire CLI’s root command composition so the setup command is only surfaced when the running CLI binary actually contains an embedded bundle payload (bundle mode). This aligns the CLI’s help/command surface with what the binary can meaningfully support.

Changes:

  • Conditionally adds SetupCommand to RootCommand subcommands based on IBundleService.IsBundle.
  • Extends CliTestHelper DI setup to allow overriding IBundleService via a new BundleServiceFactory test option.
  • Adds root command tests validating setup is hidden/shown depending on bundle availability.

Reviewed changes

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

File Description
src/Aspire.Cli/Commands/RootCommand.cs Gates adding setup to the command tree on bundleService.IsBundle.
tests/Aspire.Cli.Tests/Utils/CliTestHelper.cs Adds BundleServiceFactory to test service-collection options and introduces TestBundleService for bundle/no-bundle scenarios.
tests/Aspire.Cli.Tests/Commands/RootCommandTests.cs Adds two tests asserting the setup subcommand is absent/present based on bundle service behavior.

@davidfowl davidfowl merged commit ec55d98 into release/13.2 Feb 12, 2026
347 of 348 checks passed
@davidfowl davidfowl deleted the copilot/hide-aspire-setup-command branch February 12, 2026 16:09
@dotnet-policy-service dotnet-policy-service bot added this to the 13.2 milestone Feb 12, 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.

4 participants