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