You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add --list-steps flag to aspire do command (#16085)
* Add --list-steps flag to aspire do command
Implement support for 'aspire do --list-steps' that prints pipeline steps
in execution order with their dependencies and tags, without executing them.
Changes:
- Add PipelineStepInfo DTO to BackchannelDataTypes.cs (source-shared)
- Add ResolveStepsAsync to DistributedApplicationPipeline for resolving
steps without executing them
- Add GetPipelineStepsAsync RPC method to AppHostRpcTarget with
'pipeline-steps.v1' capability
- Add GetPipelineStepsAsync to IAppHostCliBackchannel interface and
implementations
- Add --list-steps option to PipelineCommandBase with formatted output
- Make DoCommand step argument optional when --list-steps is used
Testing:
- Unit tests for DoCommand with --list-steps (returns 0, calls
GetPipelineStepsAsync, does not execute pipeline, calls RequestStopAsync)
- Unit tests for PrintPipelineSteps formatting (dependencies, tags,
sequential numbering, empty steps, full pipeline output)
- Unit tests for ResolveStepsAsync and GetTopologicalOrder
- E2E CLI test using Hex1b terminal automation
Fixes#12376
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Improve --list-steps output formatting
Add color to the output: green step numbers, blue 'Depends on:' label,
yellow 'Tags:' label, dim 'No dependencies' text. Add hanging indent
for long dependency lists so wrapped items align under the first item.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix PrintPipelineSteps tests to strip ANSI escape codes
The Spectre.Console AnsiConsole emits ANSI escape codes even with
AnsiSupport.No in CI environments. Strip ANSI codes before asserting
on output content.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix hanging indent alignment and use cyan for step names
Fix the continuation line indent to align wrapped dependency items
directly under the first item (19 chars), not double-indented.
Change step name color from bold white to cyan for better visibility.
Before:
├─ Depends on: provision-redis-infra, provision-postgres-infra,
build-webapi
After:
├─ Depends on: provision-redis-infra, provision-postgres-infra,
build-webapi
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix wrapped dependency alignment to be computed dynamically
Compute the continuation prefix width from the visible length of the
first line prefix rather than hardcoding spaces. This ensures wrapped
dependency items align correctly under the first item regardless of
unicode box-drawing character widths.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review feedback: backchannel spec compliance and versioning
- Use request/response objects (GetPipelineStepsRequest/Response) per
the backchannel spec contract rules instead of raw array return
- Add capability check for 'pipeline-steps.v1' before calling
GetPipelineStepsAsync, throwing AppHostIncompatibleException with a
clear message if the AppHost doesn't support it
- Scope #pragma warning disable ASPIREPIPELINES001 to just the method
that needs it instead of file-wide
- Fix ResolveStepsAsync XML doc to accurately state it returns
collection order (not topological order)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Scope --list-steps output to target step and its dependencies
When a target step is specified (e.g. 'aspire do build --list-steps'),
only show that step and its transitive dependencies instead of the
full pipeline graph. This makes the output much more useful for
understanding what a specific target will actually do.
- aspire do --list-steps -> all steps (no filter)
- aspire do build --list-steps -> build + its deps only
- aspire publish --list-steps -> publish + its deps only
- aspire deploy --list-steps -> deploy + its deps only
Each PipelineCommandBase subclass provides its target step name via
GetTargetStepName(). The step name is passed in GetPipelineStepsRequest
and the AppHost filters using ComputeTransitiveDependencies.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Use System.CommandLine validator for missing step argument
Replace InvalidOperationException with a proper command validator so
users get a standard parse error with help/usage output instead of an
unexpected error when running 'aspire do' without a step argument
and without --list-steps.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments