281 references to CompletionState
Aspire.Hosting (93)
Ats\PipelineExports.cs (5)
153private static CompletionState ParseCompletionState(string completionState) 159"inprogress" or "in_progress" or "in-progress" => CompletionState.InProgress, 160"completed" => CompletionState.Completed, 161"completedwithwarning" or "completed_with_warning" or "completed-with-warning" => CompletionState.CompletedWithWarning, 162"completedwitherror" or "completed_with_error" or "completed-with-error" => CompletionState.CompletedWithError,
Pipelines\IPipelineActivityReporter.cs (1)
36Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default);
Pipelines\IReportingStep.cs (4)
60Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default); 68Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default);
Pipelines\IReportingTask.cs (4)
34Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default); 42Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default);
Pipelines\NullPipelineActivityReporter.cs (9)
31public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 67public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 72public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 96public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 101public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Pipelines\PipelineActivityReporter.cs (29)
32private static string ToBackchannelCompletionState(CompletionState state) => state switch 34CompletionState.InProgress => CompletionStates.InProgress, 35CompletionState.Completed => CompletionStates.Completed, 36CompletionState.CompletedWithWarning => CompletionStates.CompletedWithWarning, 37CompletionState.CompletedWithError => CompletionStates.CompletedWithError, 53CompletionState = ToBackchannelCompletionState(CompletionState.InProgress), 71if (parentStep.CompletionState != CompletionState.InProgress) 89CompletionState = ToBackchannelCompletionState(CompletionState.InProgress), 99public async Task CompleteStepAsync(ReportingStep step, string completionText, CompletionState completionState, bool enableMarkdown, CancellationToken cancellationToken) 104if (step.CompletionState != CompletionState.InProgress) 138if (parentStep.CompletionState != CompletionState.InProgress) 153CompletionState = ToBackchannelCompletionState(CompletionState.InProgress), 171if (parentStep.CompletionState != CompletionState.InProgress) 184CompletionState = ToBackchannelCompletionState(CompletionState.Completed), 195public async Task CompleteTaskAsync(ReportingTask task, CompletionState completionState, string? completionMessage, bool enableMarkdown, CancellationToken cancellationToken) 203if (task.CompletionState != CompletionState.InProgress) 210if (parentStep.CompletionState != CompletionState.InProgress) 239var finalState = options?.CompletionState ?? CalculateOverallAggregatedState(); 249CompletionState.Completed => "Pipeline completed successfully", 250CompletionState.CompletedWithWarning => "Pipeline completed with warnings", 251CompletionState.CompletedWithError => "Pipeline completed with errors", 268public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 280private CompletionState CalculateOverallAggregatedState() 284return CompletionState.Completed; 287var maxState = CompletionState.InProgress; 290var stepState = step.CompletionState; 348CompletionState = ToBackchannelCompletionState(CompletionState.InProgress), 379CompletionState = ToBackchannelCompletionState(CompletionState.InProgress),
Pipelines\PipelineStepHelpers.cs (4)
92CompletionState.Completed, 99CompletionState.CompletedWithError, 132CompletionState.Completed, 139CompletionState.CompletedWithError,
Pipelines\PublishCompletionOptions.cs (1)
23public CompletionState? CompletionState { get; set; }
Pipelines\ReportingStep.cs (16)
41public CompletionState CompletionState 47private CompletionState _completionState = CompletionState.InProgress; 75internal CompletionState CalculateAggregatedState() 79return CompletionState.Completed; 82var maxState = CompletionState.InProgress; 155public async Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 166public async Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 189if (CompletionState != CompletionState.InProgress) 195var finalState = CalculateAggregatedState(); 201CompletionState.Completed => $"{Title} completed successfully", 202CompletionState.CompletedWithWarning => $"{Title} completed with warnings", 203CompletionState.CompletedWithError => $"{Title} completed with errors",
Pipelines\ReportingTask.cs (7)
47public CompletionState CompletionState { get; internal set; } = CompletionState.InProgress; 68public async Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 74public async Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 85if (CompletionState != CompletionState.InProgress)
Publishing\PipelineExecutor.cs (1)
84await activityReporter.CompletePublishAsync(new PublishCompletionOptions { CompletionMessage = ex.Message, CompletionState = CompletionState.CompletedWithError }, stoppingToken).ConfigureAwait(false);
Publishing\PublishingExtensions.cs (12)
29await step.CompleteAsync(completionText, CompletionState.Completed, cancellationToken).ConfigureAwait(false); 45await step.CompleteAsync(message, CompletionState.Completed, cancellationToken).ConfigureAwait(false); 62await step.CompleteAsync(completionText, CompletionState.CompletedWithWarning, cancellationToken).ConfigureAwait(false); 78await step.CompleteAsync(message, CompletionState.CompletedWithWarning, cancellationToken).ConfigureAwait(false); 95await step.CompleteAsync(completionText, CompletionState.CompletedWithError, cancellationToken).ConfigureAwait(false); 111await step.CompleteAsync(errorMessage, CompletionState.CompletedWithError, cancellationToken).ConfigureAwait(false); 159await task.CompleteAsync(message, CompletionState.Completed, cancellationToken).ConfigureAwait(false); 175await task.CompleteAsync(message, CompletionState.Completed, cancellationToken).ConfigureAwait(false); 191await task.CompleteAsync(message, CompletionState.CompletedWithWarning, cancellationToken).ConfigureAwait(false); 207await task.CompleteAsync(message, CompletionState.CompletedWithWarning, cancellationToken).ConfigureAwait(false); 223await task.CompleteAsync(errorMessage, CompletionState.CompletedWithError, cancellationToken).ConfigureAwait(false); 239await task.CompleteAsync(errorMessage, CompletionState.CompletedWithError, cancellationToken).ConfigureAwait(false);
Aspire.Hosting.Azure (7)
AzureBicepResource.cs (3)
334CompletionState.Completed, 345CompletionState.Completed, 360CompletionState.CompletedWithError,
AzureEnvironmentResource.cs (2)
177CompletionState.Completed, 184CompletionState.CompletedWithError,
AzurePublishingContext.cs (2)
3090 => ("No azure compute environments found in the model.", CompletionState.CompletedWithWarning), 310_ => ($"Found {computeEnvironments.Count} compute environment(s) in the model.", CompletionState.Completed)
Aspire.Hosting.Azure.AppContainers (1)
AzureContainerAppEnvironmentResource.cs (1)
139CompletionState.Completed,
Aspire.Hosting.Azure.AppService (4)
AzureAppServiceEnvironmentResource.cs (4)
155CompletionState.Completed, 166CompletionState.Completed, 207CompletionState.CompletedWithError, 216CompletionState.Completed,
Aspire.Hosting.Azure.ContainerRegistry (1)
AzureContainerRegistryHelpers.cs (1)
56CompletionState.Completed,
Aspire.Hosting.Azure.Tests (26)
AzureAppServiceTests.cs (2)
111step.CompletionState == CompletionState.CompletedWithError); 149step.CompletionState == CompletionState.Completed);
AzureDeployerTests.cs (11)
176Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 231Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 286Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 346Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 412Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 508Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 717Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 779Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 989Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 1241.Where(s => s.CompletionState == CompletionState.CompletedWithError) 1246.Where(t => t.CompletionState == CompletionState.CompletedWithError)
tests\Shared\TestPipelineActivityReporter.cs (13)
41public List<(string StepTitle, string CompletionText, CompletionState CompletionState)> CompletedSteps { get; } = []; 46public List<(string TaskStatusText, string? CompletionMessage, CompletionState CompletionState)> CompletedTasks { get; } = []; 66public Action<string, string, CompletionState>? OnStepCompleted { get; set; } 81public CompletionState? ResultCompletionState { get; private set; } 138public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 175public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 232public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 254public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 282public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Docker (4)
DockerComposeEnvironmentResource.cs (4)
271CompletionState.Completed, 278await deployTask.CompleteAsync($"Docker Compose deployment failed: {ex.Message}", CompletionState.CompletedWithError, context.CancellationToken).ConfigureAwait(false); 330CompletionState.Completed, 337await deployTask.CompleteAsync($"Docker Compose shutdown failed: {ex.Message}", CompletionState.CompletedWithError, context.CancellationToken).ConfigureAwait(false);
Aspire.Hosting.Docker.Tests (13)
tests\Shared\TestPipelineActivityReporter.cs (13)
41public List<(string StepTitle, string CompletionText, CompletionState CompletionState)> CompletedSteps { get; } = []; 46public List<(string TaskStatusText, string? CompletionMessage, CompletionState CompletionState)> CompletedTasks { get; } = []; 66public Action<string, string, CompletionState>? OnStepCompleted { get; set; } 81public CompletionState? ResultCompletionState { get; private set; } 138public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 175public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 232public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 254public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 282public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Tests (110)
Pipelines\DistributedApplicationPipelineTests.cs (2)
874Assert.Contains(reporter.CompletedSteps, step => step.StepTitle == "failing-step" && step.CompletionState == CompletionState.CompletedWithError); 1252Assert.Contains(reporter.CompletedSteps, step => step.StepTitle == "failing-step" && step.CompletionState == CompletionState.CompletedWithError);
Pipelines\PipelineLoggerProviderTests.cs (3)
141public Task CompleteAsync(string statusText, CompletionState completionState, CancellationToken cancellationToken = default) 146public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Publishing\PipelineActivityReporterTests.cs (87)
37Assert.Equal(CompletionState.InProgress, stepInternal.CompletionState); 76Assert.Equal(CompletionState.InProgress, taskInternal.CompletionState); 113await step.CompleteAsync("Completed", CompletionState.Completed, CancellationToken.None); 137await step.CompleteAsync(completionText, isError ? CompletionState.CompletedWithError : CompletionState.Completed, CancellationToken.None); 141Assert.NotEqual(CompletionState.InProgress, stepInternal.CompletionState); 217await step.CompleteAsync("Completed", CompletionState.Completed, CancellationToken.None); 247Assert.Equal(CompletionState.Completed, taskInternal.CompletionState); 271await step.CompleteAsync("Completed", CompletionState.Completed, CancellationToken.None); 282[InlineData(CompletionState.Completed, "Pipeline completed successfully", false)] 283[InlineData(CompletionState.CompletedWithError, "Pipeline completed with errors", true)] 284[InlineData(CompletionState.CompletedWithWarning, "Pipeline completed with warnings", false)] 285public async Task CompletePublishAsync_EmitsCorrectActivity(CompletionState completionState, string expectedStatusText, bool expectedIsError) 301Assert.Equal(completionState == CompletionState.CompletedWithWarning, activity.Data.IsWarning); 312await reporter.CompletePublishAsync(new PublishCompletionOptions { CompletionMessage = expectedStatusText, CompletionState = CompletionState.CompletedWithError }, CancellationToken.None); 337await step1.CompleteAsync("Step 1 completed", CompletionState.Completed, CancellationToken.None); 341await step2.CompleteAsync("Step 2 completed with warning", CompletionState.CompletedWithWarning, CancellationToken.None); 345await step3.CompleteAsync("Step 3 failed", CompletionState.CompletedWithError, CancellationToken.None); 401Assert.Equal(CompletionState.Completed, taskInternal.CompletionState); 414await task.CompleteAsync((string?)null, CompletionState.Completed, cancellationToken: CancellationToken.None); 420await task.CompleteAsync("Error", CompletionState.CompletedWithError, cancellationToken: CancellationToken.None); 426Assert.Equal(CompletionState.Completed, taskInternal.CompletionState); // Original state is retained 450Assert.Equal(CompletionState.Completed, stepInternal.CompletionState); 463await step.CompleteAsync("Complete", CompletionState.Completed, cancellationToken: CancellationToken.None); 469await step.CompleteAsync("Error", CompletionState.CompletedWithError, cancellationToken: CancellationToken.None); 475Assert.Equal(CompletionState.Completed, stepInternal.CompletionState); // Original state is retained 492await step.CompleteAsync("Step completed", CompletionState.Completed, CancellationToken.None); 503await task.CompleteAsync("Error", CompletionState.CompletedWithError, cancellationToken: CancellationToken.None); // Should also not throw (noop) 646var aggregatedState = stepInternal.CalculateAggregatedState(); 649Assert.Equal(CompletionState.Completed, aggregatedState); 667Assert.Equal(CompletionState.Completed, stepInternal.CompletionState); 701Assert.Equal(CompletionState.Completed, stepInternal.CompletionState); 722await step.CompleteAsync("Step completed manually", CompletionState.Completed, CancellationToken.None); 733Assert.Equal(CompletionState.Completed, stepInternal.CompletionState); 757Assert.Equal(CompletionState.CompletedWithWarning, taskInternal.CompletionState); 792Assert.Equal(CompletionState.CompletedWithError, taskInternal.CompletionState); 808[InlineData(CompletionState.Completed, "Pipeline completed successfully", false)] 809[InlineData(CompletionState.CompletedWithError, "Pipeline completed with errors", true)] 810[InlineData(CompletionState.CompletedWithWarning, "Pipeline completed with warnings", false)] 811public async Task CompletePublishAsync_WithDeployFlag_EmitsCorrectActivity(CompletionState completionState, string expectedStatusText, bool expectedIsError) 827Assert.Equal(completionState == CompletionState.CompletedWithWarning, activity.Data.IsWarning); 838await reporter.CompletePublishAsync(new PublishCompletionOptions { CompletionMessage = expectedStatusText, CompletionState = CompletionState.CompletedWithError }, CancellationToken.None); 864await reporter.CompletePublishAsync(new PublishCompletionOptions { CompletionState = CompletionState.Completed, PipelineSummary = pipelineSummary }, CancellationToken.None); 891await reporter.CompletePublishAsync(new PublishCompletionOptions { CompletionState = CompletionState.Completed }, CancellationToken.None); 988await step.CompleteAsync("Completed", CompletionState.Completed, CancellationToken.None); 1078await task.CompleteAsync(new MarkdownString("Deployed to **Azure**"), CompletionState.Completed, CancellationToken.None); 1097await step.CompleteAsync(new MarkdownString("Step **completed** successfully"), CompletionState.Completed, CancellationToken.None); 1117await task.CompleteAsync("Warning message", CompletionState.CompletedWithWarning, CancellationToken.None); 1123await task.CompleteAsync("Different warning message", CompletionState.CompletedWithWarning, CancellationToken.None); 1129Assert.Equal(CompletionState.CompletedWithWarning, taskInternal.CompletionState); 1142await task.CompleteAsync("Error message", CompletionState.CompletedWithError, CancellationToken.None); 1148await task.CompleteAsync("Different error message", CompletionState.CompletedWithError, CancellationToken.None); 1154Assert.Equal(CompletionState.CompletedWithError, taskInternal.CompletionState); 1166await step.CompleteAsync("Warning", CompletionState.CompletedWithWarning, CancellationToken.None); 1172await step.CompleteAsync("Different warning", CompletionState.CompletedWithWarning, CancellationToken.None); 1178Assert.Equal(CompletionState.CompletedWithWarning, stepInternal.CompletionState); 1190await step.CompleteAsync("Error", CompletionState.CompletedWithError, CancellationToken.None); 1196await step.CompleteAsync("Different error", CompletionState.CompletedWithError, CancellationToken.None); 1202Assert.Equal(CompletionState.CompletedWithError, stepInternal.CompletionState); 1206[InlineData(CompletionState.Completed, CompletionState.CompletedWithWarning)] 1207[InlineData(CompletionState.Completed, CompletionState.CompletedWithError)] 1208[InlineData(CompletionState.CompletedWithWarning, CompletionState.Completed)] 1209[InlineData(CompletionState.CompletedWithWarning, CompletionState.CompletedWithError)] 1210[InlineData(CompletionState.CompletedWithError, CompletionState.Completed)] 1211[InlineData(CompletionState.CompletedWithError, CompletionState.CompletedWithWarning)] 1212public async Task CompleteTaskAsync_IdempotentWhenTransitioningBetweenTerminalStates(CompletionState firstState, CompletionState secondState) 1237[InlineData(CompletionState.Completed, CompletionState.CompletedWithWarning)] 1238[InlineData(CompletionState.Completed, CompletionState.CompletedWithError)] 1239[InlineData(CompletionState.CompletedWithWarning, CompletionState.Completed)] 1240[InlineData(CompletionState.CompletedWithWarning, CompletionState.CompletedWithError)] 1241[InlineData(CompletionState.CompletedWithError, CompletionState.Completed)] 1242[InlineData(CompletionState.CompletedWithError, CompletionState.CompletedWithWarning)] 1243public async Task CompleteStepAsync_IdempotentWhenTransitioningBetweenTerminalStates(CompletionState firstState, CompletionState secondState)
Publishing\PublishingExtensionsTests.cs (5)
32Assert.Equal(CompletionState.InProgress, taskInternal.CompletionState); 49Assert.NotEqual(CompletionState.InProgress, stepInternal.CompletionState); 86Assert.Equal(CompletionState.Completed, taskInternal.CompletionState); 104Assert.Equal(CompletionState.CompletedWithWarning, taskInternal.CompletionState); 121Assert.Equal(CompletionState.CompletedWithError, taskInternal.CompletionState);
tests\Shared\TestPipelineActivityReporter.cs (13)
41public List<(string StepTitle, string CompletionText, CompletionState CompletionState)> CompletedSteps { get; } = []; 46public List<(string TaskStatusText, string? CompletionMessage, CompletionState CompletionState)> CompletedTasks { get; } = []; 66public Action<string, string, CompletionState>? OnStepCompleted { get; set; } 81public CompletionState? ResultCompletionState { get; private set; } 138public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 175public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 232public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 254public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 282public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Pipelines.AppHost (12)
AppHost.cs (12)
88CompletionState.CompletedWithWarning, 103CompletionState.CompletedWithWarning, 123CompletionState.CompletedWithWarning, 138CompletionState.CompletedWithWarning, 158CompletionState.CompletedWithWarning, 173CompletionState.CompletedWithWarning, 196CompletionState.CompletedWithWarning, 208CompletionState.CompletedWithWarning, 215CompletionState.Completed, 222CompletionState.CompletedWithWarning, 274CompletionState.CompletedWithWarning, 319CompletionState.Completed,
Pipelines.Library (7)
DistributedApplicationPipelineExtensions.cs (7)
88CompletionState.CompletedWithError, 100CompletionState.CompletedWithError, 107CompletionState.Completed, 119CompletionState.Completed, 137CompletionState.CompletedWithError, 163CompletionState.CompletedWithError, 170CompletionState.Completed,
SimplePipelines.AppHost (3)
AppHost.cs (3)
20CompletionState.Completed, 38CompletionState.Completed, 56CompletionState.Completed,