Add WellKnownPipelineTags to default pipeline steps and rename GetSteps to GetStepsByTag
Description
Default pipeline steps in DistributedApplicationPipeline were not tagged, preventing them from being queried by tag in pipeline configuration callbacks. This made it difficult to create dependencies on groups of default steps (e.g., "run after all build steps complete").
Changes:
- Tagged
DeployandDeployPrereqwithDeployComputeandProvisionInfrastructurerespectively - Tagged
BuildandBuildPrereqwithBuildCompute - Tagged
PublishandPublishPrereqwithPushContainerImage - Left
Diagnosticsstep untagged (debugging/troubleshooting step, not part of deployment workflow) - Added test to verify tag assignments
- Renamed
GetSteps(string tag)toGetStepsByTag(string tag)for clarity when multiple overloads exist
Usage:
pipeline.AddPipelineConfiguration((context) =>
{
// Can now query default steps by tag
var buildSteps = context.GetStepsByTag(WellKnownPipelineTags.BuildCompute);
var provisionSteps = context.GetStepsByTag(WellKnownPipelineTags.ProvisionInfrastructure);
// Create dependencies on groups of steps
myStep.DependsOn(buildSteps);
});
Aligns default steps with tagging pattern already used by resource-specific steps (e.g., ProjectResource, AzureBicepResource).
Checklist
- Is this feature complete?
- [x] Yes. Ready to ship.
- [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if relevant?
- [x] 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
- If yes, did you have an API Review for it?
- [x] No
- [ ] Yes
- 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
- If yes, have you done a threat model and had a security review?
- [x] No
- [ ] Yes
- Does the change require an update in our Aspire docs?
- [ ] Yes
- Link to aspire-docs issue (consider using one of the following templates):
- [x] No
- [ ] Yes
Original prompt
Add tags to all the steps that are registered by default in the DistributedApplicationPipeline and have a WellKnownPipelineTag.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
@copilot Lets rename this to GetStepsByTag since it's a string overload.
@copilot Lets rename this to GetStepsByTag since it's a string overload.
Done in ddc23a1. Renamed GetSteps(string tag) to GetStepsByTag(string tag) and updated all test usages.
@copilot Tweak these tags.
Done in d595317. Removed tags from Deploy, Publish, and PublishPrereq as they are meta/coordination steps that don't actually perform those actions. Only steps that perform actual actions (DeployPrereq for provisioning, Build/BuildPrereq for building) retain tags.
🚀 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 -- 12960
Or
- Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12960"
🚀 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 -- 12960
Or
- Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12960"