151 references to CompletionState
Aspire.Hosting (72)
DistributedApplicationRunner.cs (1)
65
await activityReporter.CompletePublishAsync(completionMessage: ex.Message, completionState:
CompletionState
.CompletedWithError, isDeploy: publishingOptions.Value.Deploy, cancellationToken: stoppingToken).ConfigureAwait(false);
Pipelines\IPipelineActivityReporter.cs (1)
29
Task CompletePublishAsync(string? completionMessage = null,
CompletionState
? completionState = null, bool isDeploy = false, CancellationToken cancellationToken = default);
Pipelines\IReportingStep.cs (2)
28
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)
23
public Task CompletePublishAsync(string? completionMessage = null,
CompletionState
? completionState = null, bool isDeploy = false, CancellationToken cancellationToken = default)
37
public Task CompleteAsync(string completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
56
public Task CompleteAsync(string? completionMessage = null,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
Pipelines\PipelineActivityReporter.cs (27)
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),
159
public async Task CompleteTaskAsync(ReportingTask task,
CompletionState
completionState, string? completionMessage, CancellationToken cancellationToken)
166
if (task.CompletionState !=
CompletionState
.InProgress)
173
if (parentStep.CompletionState !=
CompletionState
.InProgress)
198
public async Task CompletePublishAsync(string? completionMessage = null,
CompletionState
? completionState = null, bool isDeploy = false, CancellationToken cancellationToken = default)
201
var
finalState = completionState ?? CalculateOverallAggregatedState();
212
CompletionState
.Completed => $"{operationName} completed successfully",
213
CompletionState
.CompletedWithWarning => $"{operationName} completed with warnings",
214
CompletionState
.CompletedWithError => $"{operationName} completed with errors",
227
private
CompletionState
CalculateOverallAggregatedState()
231
return
CompletionState
.Completed;
234
var
maxState =
CompletionState
.InProgress;
237
var
stepState = step.CompletionState;
295
CompletionState = ToBackchannelCompletionState(
CompletionState
.InProgress),
326
CompletionState = ToBackchannelCompletionState(
CompletionState
.InProgress),
Pipelines\ReportingStep.cs (14)
40
public
CompletionState
CompletionState
46
private
CompletionState
_completionState =
CompletionState
.InProgress;
74
internal
CompletionState
CalculateAggregatedState()
78
return
CompletionState
.Completed;
81
var
maxState =
CompletionState
.InProgress;
114
public async Task CompleteAsync(string completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
135
if (CompletionState !=
CompletionState
.InProgress)
141
var
finalState = CalculateAggregatedState();
147
CompletionState
.Completed => $"{Title} completed successfully",
148
CompletionState
.CompletedWithWarning => $"{Title} completed with warnings",
149
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\Publisher.cs (7)
84
CompletionState
state;
95
state =
CompletionState
.CompletedWithError;
100
state =
CompletionState
.Completed;
110
state =
CompletionState
.CompletedWithError;
115
state =
CompletionState
.Completed;
138
CompletionState
.Completed,
144
if (state ==
CompletionState
.CompletedWithError)
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);
Publishing\ResourceContainerImageBuilder.cs (2)
173
await step.CompleteAsync("Building container images failed",
CompletionState
.CompletedWithError, cancellationToken).ConfigureAwait(false);
189
await step.CompleteAsync("Building container images completed",
CompletionState
.Completed, cancellationToken).ConfigureAwait(false);
Aspire.Hosting.Azure (15)
AzureEnvironmentResource.cs (13)
155
CompletionState
.Completed,
162
CompletionState
.CompletedWithError,
227
CompletionState
.Completed,
238
CompletionState
.Completed,
252
CompletionState
.CompletedWithError,
378
CompletionState
.Completed,
385
CompletionState
.CompletedWithWarning,
393
CompletionState
.Completed,
407
CompletionState
.CompletedWithError,
489
await loginTask.CompleteAsync($"Successfully logged in to {registryName}",
CompletionState
.Completed, cancellationToken).ConfigureAwait(false);
536
await pushTask.CompleteAsync($"Successfully pushed {resource.Name} to {targetTag}",
CompletionState
.Completed, context.CancellationToken).ConfigureAwait(false);
540
await pushTask.CompleteAsync($"Failed to push {resource.Name}: {ex.Message}",
CompletionState
.CompletedWithError, context.CancellationToken).ConfigureAwait(false);
674
CompletionState
.Completed,
AzurePublishingContext.cs (2)
285
0 => ("No azure compute environments found in the model.",
CompletionState
.CompletedWithWarning),
286
_ => ($"Found {computeEnvironments.Count} compute environment(s) in the model.",
CompletionState
.Completed)
Aspire.Hosting.Azure.Tests (7)
AzureDeployerTests.cs (7)
1204
public List<(string StepTitle, string CompletionText,
CompletionState
CompletionState)> CompletedSteps { get; } = [];
1205
public List<(string TaskStatusText, string? CompletionMessage,
CompletionState
CompletionState)> CompletedTasks { get; } = [];
1208
public Task CompletePublishAsync(string? completionMessage = null,
CompletionState
? completionState = null, bool isDeploy = false, CancellationToken cancellationToken = default)
1234
public Task CompleteAsync(string completionText,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
1260
public Task CompleteAsync(string? completionMessage = null,
CompletionState
completionState =
CompletionState
.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Tests (38)
Publishing\PipelineActivityReporterTests.cs (33)
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, "Publishing completed successfully", false)]
282
[InlineData(
CompletionState
.CompletedWithError, "Publishing completed with errors", true)]
283
[InlineData(
CompletionState
.CompletedWithWarning, "Publishing 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, isDeploy: false, 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);
430
await step.CompleteAsync("Step completed",
CompletionState
.Completed, CancellationToken.None);
585
var
aggregatedState = stepInternal.CalculateAggregatedState();
588
Assert.Equal(
CompletionState
.Completed, aggregatedState);
606
Assert.Equal(
CompletionState
.Completed, stepInternal.CompletionState);
640
Assert.Equal(
CompletionState
.Completed, stepInternal.CompletionState);
661
await step.CompleteAsync("Step completed manually",
CompletionState
.Completed, CancellationToken.None);
672
Assert.Equal(
CompletionState
.Completed, stepInternal.CompletionState);
696
Assert.Equal(
CompletionState
.CompletedWithWarning, taskInternal.CompletionState);
731
Assert.Equal(
CompletionState
.CompletedWithError, taskInternal.CompletionState);
747
[InlineData(
CompletionState
.Completed, "Deployment completed successfully", false)]
748
[InlineData(
CompletionState
.CompletedWithError, "Deployment completed with errors", true)]
749
[InlineData(
CompletionState
.CompletedWithWarning, "Deployment completed with warnings", false)]
750
public async Task CompletePublishAsync_WithDeployFlag_EmitsCorrectActivity(
CompletionState
completionState, string expectedStatusText, bool expectedIsError)
766
Assert.Equal(completionState ==
CompletionState
.CompletedWithWarning, activity.Data.IsWarning);
777
await reporter.CompletePublishAsync(expectedStatusText,
CompletionState
.CompletedWithError, isDeploy: true, CancellationToken.None);
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)
90
CompletionState
.CompletedWithWarning,
105
CompletionState
.CompletedWithWarning,
125
CompletionState
.CompletedWithWarning,
140
CompletionState
.CompletedWithWarning,
160
CompletionState
.CompletedWithWarning,
175
CompletionState
.CompletedWithWarning,
198
CompletionState
.CompletedWithWarning,
210
CompletionState
.CompletedWithWarning,
217
CompletionState
.Completed,
224
CompletionState
.CompletedWithWarning,
276
CompletionState
.CompletedWithWarning,
321
CompletionState
.Completed,
Pipelines.Library (7)
DistributedApplicationPipelineExtensions.cs (7)
90
CompletionState
.CompletedWithError,
102
CompletionState
.CompletedWithError,
109
CompletionState
.Completed,
121
CompletionState
.Completed,
139
CompletionState
.CompletedWithError,
165
CompletionState
.CompletedWithError,
172
CompletionState
.Completed,