Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public AzureContainerAppEnvironmentResource(string name, Action<AzureResourceInf
var loginToAcrStep = new PipelineStep
{
Name = $"login-to-acr-{name}",
Description = $"Logs in to Azure Container Registry for {name}.",
Action = context => AzureEnvironmentResourceHelpers.LoginToRegistryAsync(this, context),
Tags = ["acr-login"]
};
Expand All @@ -43,6 +44,7 @@ public AzureContainerAppEnvironmentResource(string name, Action<AzureResourceInf
var printDashboardUrlStep = new PipelineStep
{
Name = $"print-dashboard-url-{name}",
Description = $"Prints the deployment summary and dashboard URL for {name}.",
Action = ctx => PrintDashboardUrlAsync(ctx),
Tags = ["print-summary"],
DependsOnSteps = [AzureEnvironmentResource.ProvisionInfrastructureStepName],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public AzureContainerAppResource(string name, Action<AzureResourceInfrastructure
var pushStep = new PipelineStep
{
Name = $"push-{targetResource.Name}",
Description = $"Pushes the container image for {targetResource.Name} to Azure Container Registry.",
Action = async ctx =>
{
var containerImageBuilder = ctx.Services.GetRequiredService<IResourceContainerImageManager>();
Expand All @@ -74,6 +75,7 @@ await AzureEnvironmentResourceHelpers.PushImageToRegistryAsync(
var printResourceSummary = new PipelineStep
{
Name = $"print-{targetResource.Name}-summary",
Description = $"Prints the deployment summary and URL for {targetResource.Name}.",
Action = async ctx =>
{
var containerAppEnv = (AzureContainerAppEnvironmentResource)deploymentTargetAnnotation.ComputeEnvironment!;
Expand All @@ -98,6 +100,7 @@ await AzureEnvironmentResourceHelpers.PushImageToRegistryAsync(
var deployStep = new PipelineStep
{
Name = $"deploy-{targetResource.Name}",
Description = $"Aggregation step for deploying {targetResource.Name} to Azure Container Apps.",
Action = _ => Task.CompletedTask,
Tags = [WellKnownPipelineTags.DeployCompute]
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public AzureAppServiceEnvironmentResource(string name, Action<AzureResourceInfra
var loginToAcrStep = new PipelineStep
{
Name = $"login-to-acr-{name}",
Description = $"Logs in to Azure Container Registry for {name}.",
Action = context => AzureEnvironmentResourceHelpers.LoginToRegistryAsync(this, context),
Tags = ["acr-login"]
};
Expand All @@ -46,6 +47,7 @@ public AzureAppServiceEnvironmentResource(string name, Action<AzureResourceInfra
var printDashboardUrlStep = new PipelineStep
{
Name = $"print-dashboard-url-{name}",
Description = $"Prints the deployment summary and dashboard URL for {name}.",
Action = ctx => PrintDashboardUrlAsync(ctx),
Tags = ["print-summary"],
DependsOnSteps = [AzureEnvironmentResource.ProvisionInfrastructureStepName],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public AzureAppServiceWebSiteResource(string name, Action<AzureResourceInfrastru
var pushStep = new PipelineStep
{
Name = $"push-{targetResource.Name}",
Description = $"Pushes the container image for {targetResource.Name} to Azure Container Registry.",
Action = async ctx =>
{
var containerImageBuilder = ctx.Services.GetRequiredService<IResourceContainerImageManager>();
Expand All @@ -72,6 +73,7 @@ await AzureEnvironmentResourceHelpers.PushImageToRegistryAsync(
var printResourceSummary = new PipelineStep
{
Name = $"print-{targetResource.Name}-summary",
Description = $"Prints the deployment summary and URL for {targetResource.Name}.",
Action = async ctx =>
{
var computerEnv = (AzureAppServiceEnvironmentResource)deploymentTargetAnnotation.ComputeEnvironment!;
Expand All @@ -93,6 +95,7 @@ await AzureEnvironmentResourceHelpers.PushImageToRegistryAsync(
var deployStep = new PipelineStep
{
Name = $"deploy-{targetResource.Name}",
Description = $"Aggregation step for deploying {targetResource.Name} to Azure App Service.",
Action = _ => Task.CompletedTask,
Tags = [WellKnownPipelineTags.DeployCompute]
};
Expand Down
1 change: 1 addition & 0 deletions src/Aspire.Hosting.Azure/AzureBicepResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public AzureBicepResource(string name, string? templateFile = null, string? temp
var provisionStep = new PipelineStep
{
Name = $"provision-{name}",
Description = $"Provisions the Azure Bicep resource {name} using Azure infrastructure.",
Action = async ctx => await ProvisionAzureBicepResourceAsync(ctx, this).ConfigureAwait(false),
Tags = [WellKnownPipelineTags.ProvisionInfrastructure]
};
Expand Down
4 changes: 4 additions & 0 deletions src/Aspire.Hosting.Azure/AzureEnvironmentResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public AzureEnvironmentResource(string name, ParameterResource location, Paramet
var publishStep = new PipelineStep
{
Name = $"publish-{Name}",
Description = $"Publishes the Azure environment configuration for {Name}.",
Action = ctx => PublishAsync(ctx),
RequiredBySteps = [WellKnownPipelineSteps.Publish],
DependsOnSteps = [WellKnownPipelineSteps.PublishPrereq]
Expand All @@ -79,6 +80,7 @@ public AzureEnvironmentResource(string name, ParameterResource location, Paramet
var validateStep = new PipelineStep
{
Name = "validate-azure-login",
Description = "Validates Azure CLI authentication before deployment.",
Action = ctx => ValidateAzureLoginAsync(ctx),
RequiredBySteps = [WellKnownPipelineSteps.Deploy],
DependsOnSteps = [WellKnownPipelineSteps.DeployPrereq]
Expand All @@ -87,6 +89,7 @@ public AzureEnvironmentResource(string name, ParameterResource location, Paramet
var createContextStep = new PipelineStep
{
Name = CreateProvisioningContextStepName,
Description = "Creates the Azure provisioning context for infrastructure deployment.",
Action = async ctx =>
{
var provisioningContextProvider = ctx.Services.GetRequiredService<IProvisioningContextProvider>();
Expand All @@ -101,6 +104,7 @@ public AzureEnvironmentResource(string name, ParameterResource location, Paramet
var provisionStep = new PipelineStep
{
Name = ProvisionInfrastructureStepName,
Description = "Aggregation step for all Azure infrastructure provisioning operations.",
Action = _ => Task.CompletedTask,
Tags = [WellKnownPipelineTags.ProvisionInfrastructure],
RequiredBySteps = [WellKnownPipelineSteps.Deploy],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public DockerComposeEnvironmentResource(string name) : base(name)
var publishStep = new PipelineStep
{
Name = $"publish-{Name}",
Description = $"Publishes the Docker Compose environment configuration for {Name}.",
Action = ctx => PublishAsync(ctx)
};
publishStep.RequiredBy(WellKnownPipelineSteps.Publish);
Expand Down Expand Up @@ -102,6 +103,7 @@ public DockerComposeEnvironmentResource(string name) : base(name)
var prepareStep = new PipelineStep
{
Name = $"prepare-{Name}",
Description = $"Prepares the Docker Compose environment {Name} for deployment.",
Action = ctx => PrepareAsync(ctx)
};
prepareStep.DependsOn(WellKnownPipelineSteps.Publish);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public KubernetesEnvironmentResource(string name) : base(name)
var step = new PipelineStep
{
Name = $"publish-{Name}",
Description = $"Publishes the Kubernetes environment configuration for {Name}.",
Action = ctx => PublishAsync(ctx)
};
step.RequiredBy(WellKnownPipelineSteps.Publish);
Expand Down
1 change: 1 addition & 0 deletions src/Aspire.Hosting/ApplicationModel/ProjectResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public ProjectResource(string name) : base(name)
var buildStep = new PipelineStep
{
Name = $"build-{name}",
Description = $"Builds the container image for the {name} project.",
Action = BuildProjectImage,
Tags = [WellKnownPipelineTags.BuildCompute],
RequiredBySteps = [WellKnownPipelineSteps.Build],
Expand Down
1 change: 1 addition & 0 deletions src/Aspire.Hosting/ContainerResourceBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ internal static IResourceBuilder<T> EnsureBuildPipelineStepAnnotation<T>(this IR
var buildStep = new PipelineStep
{
Name = $"build-{builder.Resource.Name}",
Description = $"Builds the container image for the {builder.Resource.Name} container.",
Action = async ctx =>
{
var containerImageBuilder = ctx.Services.GetRequiredService<IResourceContainerImageManager>();
Expand Down
18 changes: 16 additions & 2 deletions src/Aspire.Hosting/Pipelines/DistributedApplicationPipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ public DistributedApplicationPipeline()
_steps.Add(new PipelineStep
{
Name = WellKnownPipelineSteps.Deploy,
Description = "Aggregation step for all deploy operations. All deploy steps should be required by this step.",
Action = _ => Task.CompletedTask,
});

var parameterPromptingStep = new PipelineStep
{
Name = WellKnownPipelineSteps.ProcessParameters,
Description = "Prompts for parameter values before build, publish, or deployment operations.",
Action = async context =>
{
// Parameter processing - ensure all parameters are initialized and resolved
Expand All @@ -57,6 +59,7 @@ public DistributedApplicationPipeline()
_steps.Add(new PipelineStep
{
Name = WellKnownPipelineSteps.DeployPrereq,
Description = "Prerequisite step that runs before any deploy operations. Initializes deployment environment and manages deployment state.",
Action = async context =>
{
// REVIEW: Break this up into smaller steps
Expand Down Expand Up @@ -138,32 +141,37 @@ public DistributedApplicationPipeline()
_steps.Add(new PipelineStep
{
Name = WellKnownPipelineSteps.Build,
Description = "Aggregation step for all build operations. All build steps should be required by this step.",
Action = _ => Task.CompletedTask,
});

_steps.Add(new PipelineStep
{
Name = WellKnownPipelineSteps.BuildPrereq,
Description = "Prerequisite step that runs before any build operations.",
Action = context => Task.CompletedTask
});

// Add a default "Publish" meta-step that all publish steps should be required by
// Add a default "Publish" aggregation step that all publish steps should be required by
_steps.Add(new PipelineStep
{
Name = WellKnownPipelineSteps.Publish,
Description = "Aggregation step for all publish operations. All publish steps should be required by this step.",
Action = _ => Task.CompletedTask
});

_steps.Add(new PipelineStep
{
Name = WellKnownPipelineSteps.PublishPrereq,
Description = "Prerequisite step that runs before any publish operations.",
Action = _ => Task.CompletedTask,
});

// Add diagnostic step for dependency graph analysis
_steps.Add(new PipelineStep
{
Name = WellKnownPipelineSteps.Diagnostics,
Description = "Dumps dependency graph information for troubleshooting pipeline execution.",
Action = async context =>
{
// Use the resolved pipeline data from the last ExecuteAsync call
Expand Down Expand Up @@ -805,14 +813,20 @@ private static void DumpDependencyGraphDiagnostics(
// Detailed step analysis
sb.AppendLine("DETAILED STEP ANALYSIS");
sb.AppendLine("======================");
sb.AppendLine("Shows each step's dependencies, associated resources, and tags.");
sb.AppendLine("Shows each step's dependencies, associated resources, tags, and descriptions.");
sb.AppendLine("✓ = dependency exists, ? = dependency missing");
sb.AppendLine();

foreach (var step in allSteps.OrderBy(s => s.Name, StringComparer.Ordinal))
{
sb.AppendLine(CultureInfo.InvariantCulture, $"Step: {step.Name}");

// Show description if available
if (!string.IsNullOrWhiteSpace(step.Description))
{
sb.AppendLine(CultureInfo.InvariantCulture, $" Description: {step.Description}");
}

// Show dependencies
if (step.DependsOnSteps.Count > 0)
{
Expand Down
9 changes: 9 additions & 0 deletions src/Aspire.Hosting/Pipelines/PipelineStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ public class PipelineStep
/// </summary>
public required string Name { get; init; }

/// <summary>
/// Gets or initializes the description of the step.
/// </summary>
/// <remarks>
/// The description provides human-readable context about what the step does,
/// helping users and tools understand the purpose of the step.
/// </remarks>
public string? Description { get; init; }

/// <summary>
/// Gets or initializes the action to execute for this step.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions src/Aspire.Hosting/Pipelines/WellKnownPipelineSteps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Aspire.Hosting.Pipelines;
public static class WellKnownPipelineSteps
{
/// <summary>
/// The meta-step that coordinates all publish operations.
/// Aggregation step for all publish operations.
/// All publish steps should be required by this step.
/// </summary>
public const string Publish = "publish";
Expand All @@ -23,7 +23,7 @@ public static class WellKnownPipelineSteps
public const string PublishPrereq = "publish-prereq";

/// <summary>
/// The meta-step that coordinates all deploy operations.
/// Aggregation step for all deploy operations.
/// All deploy steps should be required by this step.
/// </summary>
public const string Deploy = "deploy";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public static IDistributedApplicationPipeline AddManifestPublishing(this IDistri
var step = new PipelineStep
{
Name = "publish-manifest",
Description = "Publishes the Aspire application model as a JSON manifest file.",
Action = async context =>
{
var loggerFactory = context.Services.GetRequiredService<ILoggerFactory>();
Expand Down
Loading