-
Notifications
You must be signed in to change notification settings - Fork 707
Support executing single step and its dependencies #12287
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
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12287Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12287" |
There was a problem hiding this 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 pull request adds support for executing a specific deployment step and its transitive dependencies during the deployment process. Users can now use the --step option in the CLI to target individual steps, which is useful for debugging, incremental deployments, or re-running failed steps.
Key Changes
- Added
--stepCLI option to allow targeting specific deployment steps - Implemented transitive dependency computation to ensure all required dependencies are executed
- Enhanced error reporting to show available steps when an invalid step name is provided
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/Aspire.Cli/Commands/DeployCommand.cs |
Added --step CLI option to DeployCommand |
src/Aspire.Hosting/Publishing/PublishingOptions.cs |
Added Step property to PublishingOptions for step filtering |
src/Aspire.Hosting/DistributedApplicationBuilder.cs |
Mapped --step CLI argument to configuration |
src/Aspire.Hosting/Publishing/Publisher.cs |
Added error handling wrapper to report pipeline validation errors |
src/Aspire.Hosting/Pipelines/DistributedApplicationPipeline.cs |
Implemented step filtering logic and transitive dependency computation |
tests/Aspire.Hosting.Tests/Pipelines/DistributedApplicationPipelineTests.cs |
Added comprehensive tests for step filtering scenarios |
| var pipeline = serviceProvider.GetRequiredService<IDistributedApplicationPipeline>(); | ||
| await pipeline.ExecuteAsync(deployingContext).ConfigureAwait(false); | ||
| } | ||
| catch (InvalidOperationException ex) |
Copilot
AI
Oct 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The catch block only handles InvalidOperationException, but other exception types from pipeline execution won't receive user-friendly error reporting. Consider catching a broader exception type or creating a custom exception type specifically for pipeline validation errors to ensure all validation failures are properly reported to users.
tests/Aspire.Hosting.Tests/Pipelines/DistributedApplicationPipelineTests.cs
Outdated
Show resolved
Hide resolved
…elineTests.cs Co-authored-by: Copilot <[email protected]>
33e120b to
8dc410f
Compare
8dc410f to
c2aa278
Compare
|
There's no way to know what the existing steps are so I am struggling to test this. I think we should add --steps |
|
OK so I think after we merge this change we go all the way and re-plat publish and deploy on top of this: aspire build -> build step (we don't have this yet) We need a name for
|
| activity.Data.IsError) | ||
| { | ||
| errorMessage = activity.Data.CompletionMessage; | ||
| if (errorMessage != null && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like ai slop 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spoken by the AI Slop Master himself!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of low hanging fruit to optimize but this works as advertised!
Yep, the error when you provide a non-existent step name helps with this but it does rely on you knowing the conventions know. Personally, I think it should be a
I ran into this while working on the Docker Compose deployer. Since we removed the behavior to automatically run publish on deploy, we need a way to generate the Docker Compose yaml when you call I think we've arrived at #abolishpublish a bit faster than expected 🤠 |
This pull request introduces the ability to run a specific deployment step and its dependencies during the deployment process. The changes add a new
--stepoption to the CLI, update the pipeline execution logic to support step filtering, and improve error handling and test coverage for this feature.Deployment Step Filtering Feature
--steptoDeployCommandthat allows users to specify a particular deployment step to run, along with its dependencies. (src/Aspire.Cli/Commands/DeployCommand.cs) [1] [2] [3]Stepproperty, enabling step filtering throughout the deployment pipeline. (src/Aspire.Hosting/Publishing/PublishingOptions.cs,src/Aspire.Hosting/DistributedApplicationBuilder.cs) [1] [2]Pipeline Execution and Error Handling
Stepproperty, ensuring only the requested step and its transitive dependencies are executed. Added robust error handling for invalid step names, including reporting available steps. (src/Aspire.Hosting/Pipelines/DistributedApplicationPipeline.cs,src/Aspire.Hosting/Publishing/Publisher.cs) [1] [2] [3]src/Aspire.Hosting/Pipelines/DistributedApplicationPipeline.cs) [1] [2]Test Coverage
tests/Aspire.Hosting.Tests/Pipelines/DistributedApplicationPipelineTests.cs)