237 references to CompletionState
Aspire.Hosting (70)
Pipelines\IPipelineActivityReporter.cs (1)
36Task 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)
31public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 50public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 69public 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) 235var finalState = options?.CompletionState ?? CalculateOverallAggregatedState(); 245CompletionState.Completed => "Pipeline completed successfully", 246CompletionState.CompletedWithWarning => "Pipeline completed with warnings", 247CompletionState.CompletedWithError => "Pipeline completed with errors", 259public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 271private CompletionState CalculateOverallAggregatedState() 275return CompletionState.Completed; 278var maxState = CompletionState.InProgress; 281var stepState = step.CompletionState; 339CompletionState = ToBackchannelCompletionState(CompletionState.InProgress), 370CompletionState = 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 (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)
84await activityReporter.CompletePublishAsync(new PublishCompletionOptions { CompletionMessage = ex.Message, CompletionState = CompletionState.CompletedWithError }, 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 (7)
AzureBicepResource.cs (3)
334CompletionState.Completed, 345CompletionState.Completed, 360CompletionState.CompletedWithError,
AzureEnvironmentResource.cs (2)
176CompletionState.Completed, 183CompletionState.CompletedWithError,
AzurePublishingContext.cs (2)
2830 => ("No azure compute environments found in the model.", CompletionState.CompletedWithWarning), 284_ => ($"Found {computeEnvironments.Count} compute environment(s) in the model.", CompletionState.Completed)
Aspire.Hosting.Azure.AppContainers (1)
AzureContainerAppEnvironmentResource.cs (1)
137CompletionState.Completed,
Aspire.Hosting.Azure.AppService (4)
AzureAppServiceEnvironmentResource.cs (4)
150CompletionState.Completed, 161CompletionState.Completed, 202CompletionState.CompletedWithError, 211CompletionState.Completed,
Aspire.Hosting.Azure.ContainerRegistry (1)
AzureContainerRegistryHelpers.cs (1)
52await loginTask.CompleteAsync($"Successfully logged in to **{registryEndpoint}**", CompletionState.Completed, context.CancellationToken).ConfigureAwait(false);
Aspire.Hosting.Azure.Tests (20)
AzureAppServiceTests.cs (2)
111step.CompletionState == CompletionState.CompletedWithError); 149step.CompletionState == CompletionState.Completed);
AzureDeployerTests.cs (9)
176Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 231Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 287Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 348Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 415Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 511Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 720Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 783Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState); 994Assert.NotEqual(CompletionState.CompletedWithError, mockActivityReporter.ResultCompletionState);
tests\Shared\TestPipelineActivityReporter.cs (9)
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) 223public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Docker (4)
DockerComposeEnvironmentResource.cs (4)
266await deployTask.CompleteAsync($"Service **{Name}** is now running with Docker Compose locally", CompletionState.Completed, context.CancellationToken).ConfigureAwait(false); 272await deployTask.CompleteAsync($"Docker Compose deployment failed: {ex.Message}", CompletionState.CompletedWithError, context.CancellationToken).ConfigureAwait(false); 320await deployTask.CompleteAsync($"Docker Compose shutdown complete for **{Name}**", CompletionState.Completed, context.CancellationToken).ConfigureAwait(false); 326await deployTask.CompleteAsync($"Docker Compose shutdown failed: {ex.Message}", CompletionState.CompletedWithError, context.CancellationToken).ConfigureAwait(false);
Aspire.Hosting.Docker.Tests (9)
tests\Shared\TestPipelineActivityReporter.cs (9)
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) 223public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Tests (102)
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 (1)
135public Task CompleteAsync(string statusText, CompletionState completionState, CancellationToken cancellationToken = default)
Publishing\PipelineActivityReporterTests.cs (85)
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(new PublishCompletionOptions { CompletionMessage = expectedStatusText, CompletionState = 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(new PublishCompletionOptions { CompletionMessage = expectedStatusText, CompletionState = CompletionState.CompletedWithError }, CancellationToken.None); 863await reporter.CompletePublishAsync(new PublishCompletionOptions { CompletionState = CompletionState.Completed, PipelineSummary = pipelineSummary }, CancellationToken.None); 886await reporter.CompletePublishAsync(new PublishCompletionOptions { CompletionState = CompletionState.Completed }, CancellationToken.None); 983await step.CompleteAsync("Completed", CompletionState.Completed, CancellationToken.None); 1033await task.CompleteAsync("Warning message", CompletionState.CompletedWithWarning, CancellationToken.None); 1039await task.CompleteAsync("Different warning message", CompletionState.CompletedWithWarning, CancellationToken.None); 1045Assert.Equal(CompletionState.CompletedWithWarning, taskInternal.CompletionState); 1058await task.CompleteAsync("Error message", CompletionState.CompletedWithError, CancellationToken.None); 1064await task.CompleteAsync("Different error message", CompletionState.CompletedWithError, CancellationToken.None); 1070Assert.Equal(CompletionState.CompletedWithError, taskInternal.CompletionState); 1082await step.CompleteAsync("Warning", CompletionState.CompletedWithWarning, CancellationToken.None); 1088await step.CompleteAsync("Different warning", CompletionState.CompletedWithWarning, CancellationToken.None); 1094Assert.Equal(CompletionState.CompletedWithWarning, stepInternal.CompletionState); 1106await step.CompleteAsync("Error", CompletionState.CompletedWithError, CancellationToken.None); 1112await step.CompleteAsync("Different error", CompletionState.CompletedWithError, CancellationToken.None); 1118Assert.Equal(CompletionState.CompletedWithError, stepInternal.CompletionState); 1122[InlineData(CompletionState.Completed, CompletionState.CompletedWithWarning)] 1123[InlineData(CompletionState.Completed, CompletionState.CompletedWithError)] 1124[InlineData(CompletionState.CompletedWithWarning, CompletionState.Completed)] 1125[InlineData(CompletionState.CompletedWithWarning, CompletionState.CompletedWithError)] 1126[InlineData(CompletionState.CompletedWithError, CompletionState.Completed)] 1127[InlineData(CompletionState.CompletedWithError, CompletionState.CompletedWithWarning)] 1128public async Task CompleteTaskAsync_IdempotentWhenTransitioningBetweenTerminalStates(CompletionState firstState, CompletionState secondState) 1153[InlineData(CompletionState.Completed, CompletionState.CompletedWithWarning)] 1154[InlineData(CompletionState.Completed, CompletionState.CompletedWithError)] 1155[InlineData(CompletionState.CompletedWithWarning, CompletionState.Completed)] 1156[InlineData(CompletionState.CompletedWithWarning, CompletionState.CompletedWithError)] 1157[InlineData(CompletionState.CompletedWithError, CompletionState.Completed)] 1158[InlineData(CompletionState.CompletedWithError, CompletionState.CompletedWithWarning)] 1159public 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);
tests\Shared\TestPipelineActivityReporter.cs (9)
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) 223public Task CompleteAsync(string? completionMessage = null, 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,