13 instantiations of InternalMicrosoftProbeResult
aspire (3)
Telemetry\InternalMicrosoftDetector.cs (3)
1753
return new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: NormalizeAlias(alias), Domain: NormalizeAdDomainName(domain));
1922
public static InternalMicrosoftProbeResult NotDetected { get; } =
new
(IsInternalMicrosoft: false, Alias: null, Domain: null);
1925
=>
new
(IsInternalMicrosoft: false, Alias: null, Domain: null, Failure: failure);
Aspire.Cli.Tests (10)
Telemetry\InternalMicrosoftDetectorTests.cs (10)
148
[new InternalMicrosoftProbe("positive", _ => Task.FromResult(new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "stale.alias", Domain: "STALE")))]
186
return Task.FromResult(new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "stage.alias", Domain: "STAGE"));
191
return Task.FromResult(new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "unused.alias", Domain: "UNUSED"));
218
return new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "positive.alias", Domain: "POSITIVE");
264
return new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "late.alias", Domain: "LATE");
301
return new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: null, Domain: null);
313
return new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "strong.alias", Domain: "STRONG");
334
[new InternalMicrosoftProbe("positive", _ => Task.FromResult(new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "later.alias", Domain: "LATER")))]
509
return Task.FromResult(new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "current.alias", Domain: "CURRENT"));
546
return Task.FromResult(new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "local.alias", Domain: null));
118 references to InternalMicrosoftProbeResult
aspire (71)
Telemetry\InternalMicrosoftDetector.cs (71)
370
var
result = await probe.DetectAsync(cancellationToken).ConfigureAwait(false);
392
InternalMicrosoftProbeResult
.NotDetected,
406
InternalMicrosoftProbeResult
.NotDetected,
438
private static int GetProbeResultScore(
InternalMicrosoftProbeResult
result)
587
internal Task<
InternalMicrosoftProbeResult
> CheckWindowsUserDnsDomainAsync(CancellationToken cancellationToken)
594
:
InternalMicrosoftProbeResult
.NotDetected);
597
private async Task<
InternalMicrosoftProbeResult
> CheckWslWindowsUserDnsDomainAsync(CancellationToken cancellationToken)
601
return
InternalMicrosoftProbeResult
.NotDetected;
616
:
InternalMicrosoftProbeResult
.NotDetected;
620
private async Task<
InternalMicrosoftProbeResult
> CheckVisualStudioMicrosoftTenantAsync(CancellationToken cancellationToken)
625
return
InternalMicrosoftProbeResult
.NotDetected;
631
return
InternalMicrosoftProbeResult
.NotDetected;
641
return
InternalMicrosoftProbeResult
.Failed(new(
648
private async Task<
InternalMicrosoftProbeResult
> CheckWslVisualStudioMicrosoftTenantAsync(CancellationToken cancellationToken)
652
return
InternalMicrosoftProbeResult
.NotDetected;
667
internal async Task<
InternalMicrosoftProbeResult
> CheckMacPlatformSsoAsync(CancellationToken cancellationToken)
685
internal static
InternalMicrosoftProbeResult
EvaluateMacPlatformSso(string output)
786
private static
InternalMicrosoftProbeResult
PlatformSsoFailure(string code, string stage)
787
=>
InternalMicrosoftProbeResult
.Failed(new(code, stage));
789
internal async Task<
InternalMicrosoftProbeResult
> CheckWindowsWorkplaceJoinAsync(CancellationToken cancellationToken)
793
return
InternalMicrosoftProbeResult
.NotDetected;
807
private async Task<
InternalMicrosoftProbeResult
> CheckWslWindowsWorkplaceJoinAsync(CancellationToken cancellationToken)
811
return
InternalMicrosoftProbeResult
.NotDetected;
823
private Task<
InternalMicrosoftProbeResult
> CheckGhCliAsync(CancellationToken cancellationToken)
826
private Task<
InternalMicrosoftProbeResult
> CheckWslWindowsGhCliAsync(CancellationToken cancellationToken)
829
internal async Task<
InternalMicrosoftProbeResult
> CheckGhCliExecutableAsync(string executable, CancellationToken cancellationToken)
833
return
InternalMicrosoftProbeResult
.NotDetected;
838
return
InternalMicrosoftProbeResult
.NotDetected;
853
return
InternalMicrosoftProbeResult
.NotDetected;
860
private async Task<
InternalMicrosoftProbeResult
> CheckEnvironmentGitHubTokenAsync(CancellationToken cancellationToken)
864
return
InternalMicrosoftProbeResult
.NotDetected;
870
return
InternalMicrosoftProbeResult
.NotDetected;
876
internal async Task<
InternalMicrosoftProbeResult
> CheckCopilotCliAsync(CancellationToken cancellationToken)
880
return
InternalMicrosoftProbeResult
.NotDetected;
903
return
InternalMicrosoftProbeResult
.NotDetected;
1014
internal async Task<
InternalMicrosoftProbeResult
> CheckGitHubMembershipWithTokenResultForTestingAsync(string token, CancellationToken cancellationToken)
1074
private static
InternalMicrosoftProbeResult
ToProbeResult(GitHubMembershipCheckResult result)
1078
?
InternalMicrosoftProbeResult
.Failed(result.Failure)
1079
:
InternalMicrosoftProbeResult
.NotDetected;
1183
private static
InternalMicrosoftProbeResult
? GetProcessFailure(ProcessResult result, bool treatNonZeroExitAsFailure)
1187
return
InternalMicrosoftProbeResult
.Failed(result.Failure);
1191
?
InternalMicrosoftProbeResult
.Failed(new(
1198
private static
InternalMicrosoftProbeResult
EvaluateWindowsWorkplaceJoin(string output, string? fallbackDomain)
1202
return
InternalMicrosoftProbeResult
.NotDetected;
1214
:
InternalMicrosoftProbeResult
.NotDetected;
1249
private static
InternalMicrosoftProbeResult
DetectVisualStudioMicrosoftTenant(string? text, CancellationToken cancellationToken)
1253
return
InternalMicrosoftProbeResult
.NotDetected;
1264
var personalizationResults = new List<
InternalMicrosoftProbeResult
>();
1265
var fallbackResults = new List<
InternalMicrosoftProbeResult
>();
1268
InternalMicrosoftProbeResult
? failure = null;
1273
var
result = TryDetectVisualStudioMicrosoftTenantAccount(account);
1319
return failure ??
InternalMicrosoftProbeResult
.NotDetected;
1323
return
InternalMicrosoftProbeResult
.Failed(new(
1338
private static
InternalMicrosoftProbeResult
SelectUnambiguousIdentity(IReadOnlyList<
InternalMicrosoftProbeResult
> candidates)
1340
var
first = candidates[0];
1348
private static
InternalMicrosoftProbeResult
TryDetectVisualStudioMicrosoftTenantAccount(JsonElement account)
1375
return
InternalMicrosoftProbeResult
.NotDetected;
1391
return
InternalMicrosoftProbeResult
.NotDetected;
1401
return
InternalMicrosoftProbeResult
.NotDetected;
1425
return
InternalMicrosoftProbeResult
.NotDetected;
1435
return
InternalMicrosoftProbeResult
.NotDetected;
1447
return
InternalMicrosoftProbeResult
.Failed(new(
1454
private static
InternalMicrosoftProbeResult
JsonShapeFailure(string stage)
1455
=>
InternalMicrosoftProbeResult
.Failed(new(InternalMicrosoftProbeFailureCode.JsonShape, stage));
1457
internal static
InternalMicrosoftProbeResult
DetectVisualStudioMicrosoftTenantForTesting(string text, CancellationToken cancellationToken)
1751
private static
InternalMicrosoftProbeResult
Detected(string? alias, string? domain = null)
1912
private sealed record InternalMicrosoftProbeRunResult(InternalMicrosoftProbe Probe, string Source,
InternalMicrosoftProbeResult
Result, InternalMicrosoftProbeDiagnostic Diagnostic, long CompletionTimestamp);
1917
Func<CancellationToken, Task<
InternalMicrosoftProbeResult
>> DetectAsync,
1922
public static
InternalMicrosoftProbeResult
NotDetected { get; } = new(IsInternalMicrosoft: false, Alias: null, Domain: null);
1924
public static
InternalMicrosoftProbeResult
Failed(InternalMicrosoftProbeFailure failure)
Aspire.Cli.Tests (47)
Telemetry\InternalMicrosoftDetectorTests.cs (47)
66
return Task.FromResult(
InternalMicrosoftProbeResult
.NotDetected);
95
return
InternalMicrosoftProbeResult
.NotDetected;
181
return Task.FromResult(
InternalMicrosoftProbeResult
.NotDetected);
233
return
InternalMicrosoftProbeResult
.NotDetected;
359
[[new InternalMicrosoftProbe("negative", _ => Task.FromResult(
InternalMicrosoftProbeResult
.NotDetected))]]);
424
new InternalMicrosoftProbe("negative", _ => Task.FromResult(
InternalMicrosoftProbeResult
.NotDetected)),
425
new InternalMicrosoftProbe("failed", _ => Task.FromResult(
InternalMicrosoftProbeResult
.Failed(new(
449
return
InternalMicrosoftProbeResult
.NotDetected;
473
return
InternalMicrosoftProbeResult
.NotDetected;
529
[[new InternalMicrosoftProbe("CI negative", _ => Task.FromResult(
InternalMicrosoftProbeResult
.NotDetected))]],
599
var
result = await detector.CheckWindowsUserDnsDomainAsync(CancellationToken.None);
620
var
result = await detector.CheckWindowsUserDnsDomainAsync(CancellationToken.None);
655
var
result = await detector.CheckWindowsWorkplaceJoinAsync(CancellationToken.None);
692
var
result = await detector.CheckWindowsWorkplaceJoinAsync(CancellationToken.None);
723
var
result = await detector.CheckWindowsWorkplaceJoinAsync(CancellationToken.None);
743
var
result = InternalMicrosoftDetector.EvaluateMacPlatformSso(output);
759
var
result = InternalMicrosoftDetector.EvaluateMacPlatformSso(output);
774
var
result = InternalMicrosoftDetector.EvaluateMacPlatformSso(output);
789
var
result = InternalMicrosoftDetector.EvaluateMacPlatformSso(output);
804
var
result = InternalMicrosoftDetector.EvaluateMacPlatformSso(output);
818
var
result = InternalMicrosoftDetector.EvaluateMacPlatformSso(output);
839
var
result = InternalMicrosoftDetector.EvaluateMacPlatformSso(output);
878
var
result = await detector.CheckMacPlatformSsoAsync(CancellationToken.None);
896
var
result = await detector.CheckMacPlatformSsoAsync(CancellationToken.None);
943
var
probeResult = await detector.CheckMacPlatformSsoAsync(CancellationToken.None);
1008
var
result = InternalMicrosoftDetector.EvaluateMacPlatformSso($"{stdout}{Environment.NewLine}{stderr}");
1027
InternalMicrosoftProbeResult
.Failed(new(
1062
var
result = await detector.CheckWindowsWorkplaceJoinAsync(CancellationToken.None);
1092
var
result = await detector.CheckGhCliExecutableAsync(executable, CancellationToken.None);
1123
var
result = await detector.CheckGhCliExecutableAsync(executable, CancellationToken.None);
1146
var
result = await detector.CheckGitHubMembershipWithTokenResultForTestingAsync(CreateGitHubToken(1), CancellationToken.None);
1171
var
result = await detector.CheckGitHubMembershipWithTokenResultForTestingAsync(CreateGitHubToken(1), CancellationToken.None);
1219
var
result = await detector.CheckGitHubMembershipWithTokenResultForTestingAsync(CreateGitHubToken(1), CancellationToken.None);
1320
var
result = await detector.CheckCopilotCliAsync(CancellationToken.None);
1347
var
result = await detector.CheckCopilotCliAsync(CancellationToken.None);
1372
var
result = await detector.CheckCopilotCliAsync(CancellationToken.None);
1385
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(
1396
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(
1413
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(
1429
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(
1446
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(
1462
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(
1497
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(
1536
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(store, CancellationToken.None);
1547
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(
1584
var
result = await detector.CheckCopilotCliAsync(CancellationToken.None);
1643
var
result = await checkTask.WaitAsync(safetyTimeout.Token);