aspire icon indicating copy to clipboard operation
aspire copied to clipboard

Add WellKnownPipelineTags to default pipeline steps and rename GetSteps to GetStepsByTag

Open Copilot opened this issue 2 months ago • 2 comments

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 Deploy and DeployPrereq with DeployCompute and ProvisionInfrastructure respectively
  • Tagged Build and BuildPrereq with BuildCompute
  • Tagged Publish and PublishPrereq with PushContainerImage
  • Left Diagnostics step untagged (debugging/troubleshooting step, not part of deployment workflow)
  • Added test to verify tag assignments
  • Renamed GetSteps(string tag) to GetStepsByTag(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
    • [x] No
  • 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
    • [x] No
  • Does the change require an update in our Aspire docs?
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 avatar Nov 14 '25 00:11 Copilot

@copilot Lets rename this to GetStepsByTag since it's a string overload.

davidfowl avatar Nov 14 '25 23:11 davidfowl

@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 avatar Nov 14 '25 23:11 Copilot

@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.

Copilot avatar Nov 18 '25 23:11 Copilot

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

github-actions[bot] avatar Nov 18 '25 23:11 github-actions[bot]

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

github-actions[bot] avatar Nov 18 '25 23:11 github-actions[bot]