123 references to CompletionState
Aspire.Hosting (67)
DistributedApplicationRunner.cs (1)
63await activityReporter.CompletePublishAsync(CompletionState.CompletedWithError, stoppingToken).ConfigureAwait(false);
Publishing\NullPublishingActivityProgressReporter.cs (3)
45public Task CompleteStepAsync(PublishingStep step, string completionText, CompletionState completionState, CancellationToken cancellationToken = default) 60public Task CompleteTaskAsync(PublishingTask task, CompletionState completionState, string? completionMessage = null, CancellationToken cancellationToken = default) 68public Task CompletePublishAsync(CompletionState? completionState = null, CancellationToken cancellationToken = default)
Publishing\Publisher.cs (6)
58(string Message, CompletionState State) taskInfo; 640 => ("No resources in the distributed application model support deployment.", CompletionState.CompletedWithError), 65_ => ($"Found {deployingResources.Count} resources that support deployment. ({string.Join(", ", deployingResources.Select(r => r.GetType().Name))})", CompletionState.Completed) 720 => ("No resources in the distributed application model support publishing.", CompletionState.CompletedWithError), 73_ => ($"Found {publishingResources.Count} resources that support publishing. ({string.Join(", ", publishingResources.Select(r => r.GetType().Name))})", CompletionState.Completed) 92if (taskInfo.State == CompletionState.CompletedWithError)
Publishing\PublishingActivityProgressReporter.cs (47)
71public CompletionState CompletionState 77private CompletionState _completionState = CompletionState.InProgress; 105internal CompletionState CalculateAggregatedState() 109return CompletionState.Completed; 112var maxState = CompletionState.InProgress; 150if (CompletionState != CompletionState.InProgress) 156var finalState = CalculateAggregatedState(); 162CompletionState.Completed => $"{Title} completed successfully", 163CompletionState.CompletedWithWarning => $"{Title} completed with warnings", 164CompletionState.CompletedWithError => $"{Title} completed with errors", 209public CompletionState CompletionState { get; internal set; } = CompletionState.InProgress; 248await Reporter.CompleteTaskAsync(this, CompletionState.Completed, completionMessage, cancellationToken).ConfigureAwait(false); 263await Reporter.CompleteTaskAsync(this, CompletionState.CompletedWithWarning, completionMessage, cancellationToken).ConfigureAwait(false); 278await Reporter.CompleteTaskAsync(this, CompletionState.CompletedWithError, completionMessage, cancellationToken).ConfigureAwait(false); 286if (Reporter is null || CompletionState != CompletionState.InProgress) 328Task CompleteStepAsync(PublishingStep step, string completionText, CompletionState completionState, CancellationToken cancellationToken = default); 347Task CompleteTaskAsync(PublishingTask task, CompletionState completionState, string? completionMessage = null, CancellationToken cancellationToken = default); 354Task CompletePublishAsync(CompletionState? completionState = null, CancellationToken cancellationToken = default); 370private static string ToBackchannelCompletionState(CompletionState state) => state switch 372CompletionState.InProgress => CompletionStates.InProgress, 373CompletionState.Completed => CompletionStates.Completed, 374CompletionState.CompletedWithWarning => CompletionStates.CompletedWithWarning, 375CompletionState.CompletedWithError => CompletionStates.CompletedWithError, 394CompletionState = ToBackchannelCompletionState(CompletionState.InProgress), 412if (parentStep.CompletionState != CompletionState.InProgress) 433CompletionState = ToBackchannelCompletionState(CompletionState.InProgress), 442public async Task CompleteStepAsync(PublishingStep step, string completionText, CompletionState completionState, CancellationToken cancellationToken = default) 474if (parentStep.CompletionState != CompletionState.InProgress) 489CompletionState = ToBackchannelCompletionState(CompletionState.InProgress), 497public async Task CompleteTaskAsync(PublishingTask task, CompletionState completionState, string? completionMessage = null, CancellationToken cancellationToken = default) 504if (task.CompletionState != CompletionState.InProgress) 511if (parentStep.CompletionState != CompletionState.InProgress) 536public async Task CompletePublishAsync(CompletionState? completionState = null, CancellationToken cancellationToken = default) 539var finalState = completionState ?? CalculateOverallAggregatedState(); 549CompletionState.Completed => "Publishing completed successfully", 550CompletionState.CompletedWithWarning => "Publishing completed with warnings", 551CompletionState.CompletedWithError => "Publishing completed with errors", 564private CompletionState CalculateOverallAggregatedState() 568return CompletionState.Completed; 571var maxState = CompletionState.InProgress; 574var stepState = step.CompletionState; 603return _steps.Any(step => step.Value.CompletionState == CompletionState.InProgress); 647CompletionState = ToBackchannelCompletionState(CompletionState.InProgress),
Publishing\PublishingExtensions.cs (6)
35await step.Reporter.CompleteStepAsync(step, completionText, CompletionState.Completed, cancellationToken).ConfigureAwait(false); 58await step.Reporter.CompleteStepAsync(step, completionText, CompletionState.CompletedWithWarning, cancellationToken).ConfigureAwait(false); 81await step.Reporter.CompleteStepAsync(step, completionText, CompletionState.CompletedWithError, cancellationToken).ConfigureAwait(false); 125await task.Reporter.CompleteTaskAsync(task, CompletionState.Completed, message, cancellationToken).ConfigureAwait(false); 147await task.Reporter.CompleteTaskAsync(task, CompletionState.CompletedWithWarning, message, cancellationToken).ConfigureAwait(false); 169await task.Reporter.CompleteTaskAsync(task, CompletionState.CompletedWithError, errorMessage, cancellationToken).ConfigureAwait(false);
Publishing\ResourceContainerImageBuilder.cs (4)
73CompletionState.CompletedWithError, 77await activityReporter.CompleteStepAsync(step, "Building container images failed", CompletionState.CompletedWithError, cancellationToken: cancellationToken).ConfigureAwait(false); 83containerRuntimeHealthy ? CompletionState.Completed : CompletionState.CompletedWithError,
Aspire.Hosting.Azure (2)
AzurePublishingContext.cs (2)
2670 => ("No azure compute environments found in the model.", CompletionState.CompletedWithWarning), 268_ => ($"Found {computeEnvironments.Count} compute environment(s) in the model.", CompletionState.Completed)
Aspire.Hosting.Tests (54)
Publishing\NullPublishingActivityProgressReporterTests.cs (3)
18await reporter.CompleteStepAsync(step, "step completed", CompletionState.Completed, default); 21Assert.True(step.CompletionState != CompletionState.InProgress); 30await reporter.CompleteTaskAsync(task, CompletionState.Completed, "task completed", default);
Publishing\PublishingActivityProgressReporterTests.cs (45)
34Assert.Equal(CompletionState.InProgress, step.CompletionState); 71Assert.Equal(CompletionState.InProgress, task.CompletionState); 108await reporter.CompleteStepAsync(step, "Completed", CompletionState.Completed, cancellationToken: CancellationToken.None); 131await reporter.CompleteStepAsync(step, completionText, isError ? CompletionState.CompletedWithError : CompletionState.Completed, CancellationToken.None); 134Assert.True(step.CompletionState != CompletionState.InProgress); 206await reporter.CompleteStepAsync(step, "Completed", CompletionState.Completed, cancellationToken: CancellationToken.None); 216[InlineData(CompletionState.Completed, false, false)] 217[InlineData(CompletionState.CompletedWithWarning, false, true)] 218[InlineData(CompletionState.CompletedWithError, true, false)] 220CompletionState completionState, bool expectedIsError, bool expectedIsWarning) 260await reporter.CompleteStepAsync(step, "Completed", CompletionState.Completed, cancellationToken: CancellationToken.None); 264() => reporter.CompleteTaskAsync(task, CompletionState.Completed, null, CancellationToken.None)); 270[InlineData(CompletionState.Completed, "Publishing completed successfully", false)] 271[InlineData(CompletionState.CompletedWithError, "Publishing completed with errors", true)] 272[InlineData(CompletionState.CompletedWithWarning, "Publishing completed with warnings", false)] 273public async Task CompletePublishAsync_EmitsCorrectActivity(CompletionState completionState, string expectedStatusText, bool expectedIsError) 289Assert.Equal(completionState == CompletionState.CompletedWithWarning, activity.Data.IsWarning); 304await reporter.CompleteTaskAsync(task1, CompletionState.Completed, null, CancellationToken.None); 305await reporter.CompleteStepAsync(step1, "Step 1 completed", CompletionState.Completed, CancellationToken.None); 308await reporter.CompleteTaskAsync(task2, CompletionState.CompletedWithWarning, null, CancellationToken.None); 309await reporter.CompleteStepAsync(step2, "Step 2 completed with warning", CompletionState.CompletedWithWarning, CancellationToken.None); 312await reporter.CompleteTaskAsync(task3, CompletionState.CompletedWithError, null, CancellationToken.None); 313await reporter.CompleteStepAsync(step3, "Step 3 failed", CompletionState.CompletedWithError, CancellationToken.None); 352await reporter.CompleteTaskAsync(task, CompletionState.Completed, null, CancellationToken.None); 365await reporter.CompleteStepAsync(step, $"Step {i} completed", CompletionState.Completed, cancellationToken: CancellationToken.None); 377Assert.True(result.Step.CompletionState != CompletionState.InProgress); 383Assert.Equal(CompletionState.Completed, task.CompletionState); 411await reporter.CompleteTaskAsync(task, CompletionState.Completed, null, CancellationToken.None); 427await reporter.CompleteTaskAsync(task, CompletionState.Completed, null, CancellationToken.None); 431() => reporter.CompleteTaskAsync(task, CompletionState.Completed, null, CancellationToken.None)); 446await reporter.CompleteTaskAsync(task, CompletionState.Completed, null, CancellationToken.None); 449await reporter.CompleteStepAsync(step, "Step completed", CompletionState.Completed, cancellationToken: CancellationToken.None); 459() => reporter.CompleteTaskAsync(task, CompletionState.Completed, null, CancellationToken.None)); 484await reporter.CompleteStepAsync(step, "Completed", CompletionState.Completed, CancellationToken.None); 528Assert.Equal(CompletionState.Completed, aggregatedState); 545Assert.Equal(CompletionState.Completed, step.CompletionState); 568await reporter.CompleteTaskAsync(task1, CompletionState.Completed, null, CancellationToken.None); 569await reporter.CompleteTaskAsync(task2, CompletionState.Completed, null, CancellationToken.None); 578Assert.Equal(CompletionState.Completed, step.CompletionState); 599await reporter.CompleteStepAsync(step, "Step completed manually", CompletionState.Completed, CancellationToken.None); 609Assert.Equal(CompletionState.Completed, step.CompletionState); 623await reporter.CompleteTaskAsync(task1, CompletionState.Completed, null, CancellationToken.None); 624await reporter.CompleteTaskAsync(task2, CompletionState.CompletedWithWarning, null, CancellationToken.None); 633Assert.Equal(CompletionState.CompletedWithWarning, step.CompletionState);
Publishing\PublishingExtensionsTests.cs (6)
29Assert.Equal(CompletionState.InProgress, task.CompletionState); 58Assert.Equal(CompletionState.InProgress, task.CompletionState); 73Assert.True(step.CompletionState != CompletionState.InProgress); 106Assert.Equal(CompletionState.Completed, task.CompletionState); 123Assert.Equal(CompletionState.CompletedWithWarning, task.CompletionState); 139Assert.Equal(CompletionState.CompletedWithError, task.CompletionState);