196 references to CompletionState
Aspire.Hosting (65)
Pipelines\IPipelineActivityReporter.cs (1)
28Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default);
Pipelines\IReportingStep.cs (2)
37Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default);
Pipelines\IReportingTask.cs (2)
27Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default);
Pipelines\NullPipelineActivityReporter.cs (5)
24public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 43public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 62public Task CompleteAsync(string? completionMessage = null, 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), 98public async Task CompleteStepAsync(ReportingStep step, string completionText, CompletionState completionState, CancellationToken cancellationToken) 103if (step.CompletionState != CompletionState.InProgress) 136if (parentStep.CompletionState != CompletionState.InProgress) 151CompletionState = ToBackchannelCompletionState(CompletionState.InProgress), 168if (parentStep.CompletionState != CompletionState.InProgress) 181CompletionState = ToBackchannelCompletionState(CompletionState.Completed), 192public async Task CompleteTaskAsync(ReportingTask task, CompletionState completionState, string? completionMessage, CancellationToken cancellationToken) 200if (task.CompletionState != CompletionState.InProgress) 207if (parentStep.CompletionState != CompletionState.InProgress) 232public async Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 235var finalState = completionState ?? CalculateOverallAggregatedState(); 245CompletionState.Completed => "Pipeline completed successfully", 246CompletionState.CompletedWithWarning => "Pipeline completed with warnings", 247CompletionState.CompletedWithError => "Pipeline completed with errors", 260private CompletionState CalculateOverallAggregatedState() 264return CompletionState.Completed; 267var maxState = CompletionState.InProgress; 270var stepState = step.CompletionState; 328CompletionState = ToBackchannelCompletionState(CompletionState.InProgress), 359CompletionState = ToBackchannelCompletionState(CompletionState.InProgress),
Pipelines\ReportingStep.cs (14)
41public CompletionState CompletionState 47private CompletionState _completionState = CompletionState.InProgress; 75internal CompletionState CalculateAggregatedState() 79return CompletionState.Completed; 82var maxState = CompletionState.InProgress; 131public async Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 152if (CompletionState != CompletionState.InProgress) 158var finalState = CalculateAggregatedState(); 164CompletionState.Completed => $"{Title} completed successfully", 165CompletionState.CompletedWithWarning => $"{Title} completed with warnings", 166CompletionState.CompletedWithError => $"{Title} completed with errors",
Pipelines\ReportingTask.cs (5)
47public CompletionState CompletionState { get; internal set; } = CompletionState.InProgress; 70public async Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 80if (CompletionState != CompletionState.InProgress)
Publishing\PipelineExecutor.cs (1)
83await activityReporter.CompletePublishAsync(completionMessage: ex.Message, completionState: CompletionState.CompletedWithError, cancellationToken: stoppingToken).ConfigureAwait(false);
Publishing\PublishingExtensions.cs (6)
29await step.CompleteAsync(completionText, CompletionState.Completed, cancellationToken).ConfigureAwait(false); 46await step.CompleteAsync(completionText, CompletionState.CompletedWithWarning, cancellationToken).ConfigureAwait(false); 63await step.CompleteAsync(completionText, CompletionState.CompletedWithError, cancellationToken).ConfigureAwait(false); 95await task.CompleteAsync(message, CompletionState.Completed, cancellationToken).ConfigureAwait(false); 111await task.CompleteAsync(message, CompletionState.CompletedWithWarning, cancellationToken).ConfigureAwait(false); 127await task.CompleteAsync(errorMessage, CompletionState.CompletedWithError, cancellationToken).ConfigureAwait(false);
Aspire.Hosting.Azure (10)
AzureBicepResource.cs (3)
332CompletionState.Completed, 343CompletionState.Completed, 358CompletionState.CompletedWithError,
AzureEnvironmentResource.cs (2)
148CompletionState.Completed, 155CompletionState.CompletedWithError,
AzureEnvironmentResourceHelpers.cs (3)
57await loginTask.CompleteAsync($"Successfully logged in to **{registryEndpoint}**", CompletionState.Completed, context.CancellationToken).ConfigureAwait(false); 90await pushTask.CompleteAsync($"Successfully pushed **{resource.Name}** to `{targetTag}`", CompletionState.Completed, context.CancellationToken).ConfigureAwait(false); 94await pushTask.CompleteAsync($"Failed to push **{resource.Name}**: {ex.Message}", CompletionState.CompletedWithError, context.CancellationToken).ConfigureAwait(false);
AzurePublishingContext.cs (2)
2770 => ("No azure compute environments found in the model.", CompletionState.CompletedWithWarning), 278_ => ($"Found {computeEnvironments.Count} compute environment(s) in the model.", CompletionState.Completed)
Aspire.Hosting.Azure.AppContainers (1)
AzureContainerAppEnvironmentResource.cs (1)
144CompletionState.Completed,
Aspire.Hosting.Azure.AppService (1)
AzureAppServiceEnvironmentResource.cs (1)
145CompletionState.Completed,
Aspire.Hosting.Azure.Tests (7)
AzureDeployerTests.cs (7)
1364public List<(string StepTitle, string CompletionText, CompletionState CompletionState)> CompletedSteps { get; } = []; 1365public List<(string TaskStatusText, string? CompletionMessage, CompletionState CompletionState)> CompletedTasks { get; } = []; 1369public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 1399public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 1435public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Docker (4)
DockerComposeEnvironmentResource.cs (4)
253await deployTask.CompleteAsync($"Service **{Name}** is now running with Docker Compose locally", CompletionState.Completed, context.CancellationToken).ConfigureAwait(false); 259await deployTask.CompleteAsync($"Docker Compose deployment failed: {ex.Message}", CompletionState.CompletedWithError, context.CancellationToken).ConfigureAwait(false); 312await deployTask.CompleteAsync($"Docker Compose shutdown complete for **{Name}**", CompletionState.Completed, context.CancellationToken).ConfigureAwait(false); 318await deployTask.CompleteAsync($"Docker Compose shutdown failed: {ex.Message}", CompletionState.CompletedWithError, context.CancellationToken).ConfigureAwait(false);
Aspire.Hosting.Tests (89)
Pipelines\PipelineLoggerProviderTests.cs (1)
135public Task CompleteAsync(string statusText, CompletionState completionState, CancellationToken cancellationToken = default)
Publishing\PipelineActivityReporterTests.cs (83)
36Assert.Equal(CompletionState.InProgress, stepInternal.CompletionState); 75Assert.Equal(CompletionState.InProgress, taskInternal.CompletionState); 112await step.CompleteAsync("Completed", CompletionState.Completed, CancellationToken.None); 136await step.CompleteAsync(completionText, isError ? CompletionState.CompletedWithError : CompletionState.Completed, CancellationToken.None); 140Assert.NotEqual(CompletionState.InProgress, stepInternal.CompletionState); 216await step.CompleteAsync("Completed", CompletionState.Completed, CancellationToken.None); 246Assert.Equal(CompletionState.Completed, taskInternal.CompletionState); 270await step.CompleteAsync("Completed", CompletionState.Completed, CancellationToken.None); 281[InlineData(CompletionState.Completed, "Pipeline completed successfully", false)] 282[InlineData(CompletionState.CompletedWithError, "Pipeline completed with errors", true)] 283[InlineData(CompletionState.CompletedWithWarning, "Pipeline completed with warnings", false)] 284public async Task CompletePublishAsync_EmitsCorrectActivity(CompletionState completionState, string expectedStatusText, bool expectedIsError) 300Assert.Equal(completionState == CompletionState.CompletedWithWarning, activity.Data.IsWarning); 311await reporter.CompletePublishAsync(expectedStatusText, CompletionState.CompletedWithError, CancellationToken.None); 336await step1.CompleteAsync("Step 1 completed", CompletionState.Completed, CancellationToken.None); 340await step2.CompleteAsync("Step 2 completed with warning", CompletionState.CompletedWithWarning, CancellationToken.None); 344await step3.CompleteAsync("Step 3 failed", CompletionState.CompletedWithError, CancellationToken.None); 400Assert.Equal(CompletionState.Completed, taskInternal.CompletionState); 413await task.CompleteAsync(null, CompletionState.Completed, cancellationToken: CancellationToken.None); 419await task.CompleteAsync("Error", CompletionState.CompletedWithError, cancellationToken: CancellationToken.None); 425Assert.Equal(CompletionState.Completed, taskInternal.CompletionState); // Original state is retained 449Assert.Equal(CompletionState.Completed, stepInternal.CompletionState); 462await step.CompleteAsync("Complete", CompletionState.Completed, cancellationToken: CancellationToken.None); 468await step.CompleteAsync("Error", CompletionState.CompletedWithError, cancellationToken: CancellationToken.None); 474Assert.Equal(CompletionState.Completed, stepInternal.CompletionState); // Original state is retained 491await step.CompleteAsync("Step completed", CompletionState.Completed, CancellationToken.None); 502await task.CompleteAsync("Error", CompletionState.CompletedWithError, cancellationToken: CancellationToken.None); // Should also not throw (noop) 645var aggregatedState = stepInternal.CalculateAggregatedState(); 648Assert.Equal(CompletionState.Completed, aggregatedState); 666Assert.Equal(CompletionState.Completed, stepInternal.CompletionState); 700Assert.Equal(CompletionState.Completed, stepInternal.CompletionState); 721await step.CompleteAsync("Step completed manually", CompletionState.Completed, CancellationToken.None); 732Assert.Equal(CompletionState.Completed, stepInternal.CompletionState); 756Assert.Equal(CompletionState.CompletedWithWarning, taskInternal.CompletionState); 791Assert.Equal(CompletionState.CompletedWithError, taskInternal.CompletionState); 807[InlineData(CompletionState.Completed, "Pipeline completed successfully", false)] 808[InlineData(CompletionState.CompletedWithError, "Pipeline completed with errors", true)] 809[InlineData(CompletionState.CompletedWithWarning, "Pipeline completed with warnings", false)] 810public async Task CompletePublishAsync_WithDeployFlag_EmitsCorrectActivity(CompletionState completionState, string expectedStatusText, bool expectedIsError) 826Assert.Equal(completionState == CompletionState.CompletedWithWarning, activity.Data.IsWarning); 837await reporter.CompletePublishAsync(expectedStatusText, CompletionState.CompletedWithError, CancellationToken.None); 936await step.CompleteAsync("Completed", CompletionState.Completed, CancellationToken.None); 986await task.CompleteAsync("Warning message", CompletionState.CompletedWithWarning, CancellationToken.None); 992await task.CompleteAsync("Different warning message", CompletionState.CompletedWithWarning, CancellationToken.None); 998Assert.Equal(CompletionState.CompletedWithWarning, taskInternal.CompletionState); 1011await task.CompleteAsync("Error message", CompletionState.CompletedWithError, CancellationToken.None); 1017await task.CompleteAsync("Different error message", CompletionState.CompletedWithError, CancellationToken.None); 1023Assert.Equal(CompletionState.CompletedWithError, taskInternal.CompletionState); 1035await step.CompleteAsync("Warning", CompletionState.CompletedWithWarning, CancellationToken.None); 1041await step.CompleteAsync("Different warning", CompletionState.CompletedWithWarning, CancellationToken.None); 1047Assert.Equal(CompletionState.CompletedWithWarning, stepInternal.CompletionState); 1059await step.CompleteAsync("Error", CompletionState.CompletedWithError, CancellationToken.None); 1065await step.CompleteAsync("Different error", CompletionState.CompletedWithError, CancellationToken.None); 1071Assert.Equal(CompletionState.CompletedWithError, stepInternal.CompletionState); 1075[InlineData(CompletionState.Completed, CompletionState.CompletedWithWarning)] 1076[InlineData(CompletionState.Completed, CompletionState.CompletedWithError)] 1077[InlineData(CompletionState.CompletedWithWarning, CompletionState.Completed)] 1078[InlineData(CompletionState.CompletedWithWarning, CompletionState.CompletedWithError)] 1079[InlineData(CompletionState.CompletedWithError, CompletionState.Completed)] 1080[InlineData(CompletionState.CompletedWithError, CompletionState.CompletedWithWarning)] 1081public async Task CompleteTaskAsync_IdempotentWhenTransitioningBetweenTerminalStates(CompletionState firstState, CompletionState secondState) 1106[InlineData(CompletionState.Completed, CompletionState.CompletedWithWarning)] 1107[InlineData(CompletionState.Completed, CompletionState.CompletedWithError)] 1108[InlineData(CompletionState.CompletedWithWarning, CompletionState.Completed)] 1109[InlineData(CompletionState.CompletedWithWarning, CompletionState.CompletedWithError)] 1110[InlineData(CompletionState.CompletedWithError, CompletionState.Completed)] 1111[InlineData(CompletionState.CompletedWithError, CompletionState.CompletedWithWarning)] 1112public async Task CompleteStepAsync_IdempotentWhenTransitioningBetweenTerminalStates(CompletionState firstState, CompletionState secondState)
Publishing\PublishingExtensionsTests.cs (5)
31Assert.Equal(CompletionState.InProgress, taskInternal.CompletionState); 48Assert.NotEqual(CompletionState.InProgress, stepInternal.CompletionState); 85Assert.Equal(CompletionState.Completed, taskInternal.CompletionState); 103Assert.Equal(CompletionState.CompletedWithWarning, taskInternal.CompletionState); 120Assert.Equal(CompletionState.CompletedWithError, taskInternal.CompletionState);
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,