Skip to content

fix: aspire exec fail fast improvements #10606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 23, 2025
Merged

Conversation

DeagleGross
Copy link
Member

@DeagleGross DeagleGross commented Jul 22, 2025

Description

Instead of searching for apphost project, aspire exec should firstly validate all arguments to fail fast if something is wrong with the user input.

Also if no command is passed, aspire exec should report that

Fixes #10591
Fixes #10592

@Copilot Copilot AI review requested due to automatic review settings July 22, 2025 17:26
Copy link
Contributor

@Copilot 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 modifies the aspire exec command to validate required arguments (specifically the --resource parameter) before attempting to locate the AppHost project, ensuring faster failure when user input is invalid.

Key changes:

  • Moves argument validation logic earlier in the execution flow to fail fast on invalid input
  • Adds a test to verify the new fail-fast behavior with a timeout assertion

Reviewed Changes

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

File Description
src/Aspire.Cli/Commands/ExecCommand.cs Moves target resource and command token validation to occur before project location and build operations
tests/Aspire.Cli.Tests/Commands/ExecCommandTests.cs Adds test case to verify fast failure when --resource is not specified

@DeagleGross DeagleGross changed the title fix: aspire exec should fail fast if --resource not specified fix: aspire exec fail fast improvements Jul 22, 2025
@DeagleGross DeagleGross merged commit 5e8824d into main Jul 23, 2025
276 checks passed
@DeagleGross DeagleGross deleted the dmkorolev/aspire-failfast branch July 23, 2025 08:47
DeagleGross added a commit that referenced this pull request Jul 23, 2025
@DeagleGross DeagleGross self-assigned this Jul 23, 2025
joperezr pushed a commit that referenced this pull request Jul 23, 2025
* chore: `aspire exec --help` improvements (#10598)

* provide more info in help

* rsc changes

* typo

* include COMMAND LINE to be explicit

* with examples

* fix: `aspire exec` fail fast improvements (#10606)

* fix aot (#10625)

* fix build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aspire exec - Failed to parse command. aspire exec - No target resource specified error comes after searching for app host
2 participants