13 instantiations of InternalMicrosoftProbeResult
aspire (3)
src\Shared\Telemetry\InternalMicrosoftDetector.cs (3)
1771
return new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: NormalizeAlias(alias), Domain: NormalizeAdDomainName(domain));
1940
public static InternalMicrosoftProbeResult NotDetected { get; } =
new
(IsInternalMicrosoft: false, Alias: null, Domain: null);
1943
=>
new
(IsInternalMicrosoft: false, Alias: null, Domain: null, Failure: failure);
Aspire.Cli.Tests (10)
Telemetry\InternalMicrosoftDetectorTests.cs (10)
147
[new InternalMicrosoftProbe("positive", _ => Task.FromResult(new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "stale.alias", Domain: "STALE")))]
185
return Task.FromResult(new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "stage.alias", Domain: "STAGE"));
190
return Task.FromResult(new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "unused.alias", Domain: "UNUSED"));
217
return new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "positive.alias", Domain: "POSITIVE");
263
return new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "late.alias", Domain: "LATE");
300
return new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: null, Domain: null);
312
return new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "strong.alias", Domain: "STRONG");
333
[new InternalMicrosoftProbe("positive", _ => Task.FromResult(new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "later.alias", Domain: "LATER")))]
508
return Task.FromResult(new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "current.alias", Domain: "CURRENT"));
545
return Task.FromResult(new
InternalMicrosoftProbeResult
(IsInternalMicrosoft: true, Alias: "local.alias", Domain: null));
119 references to InternalMicrosoftProbeResult
aspire (71)
src\Shared\Telemetry\InternalMicrosoftDetector.cs (71)
374
var
result = await probe.DetectAsync(cancellationToken).ConfigureAwait(false);
396
InternalMicrosoftProbeResult
.NotDetected,
410
InternalMicrosoftProbeResult
.NotDetected,
442
private static int GetProbeResultScore(
InternalMicrosoftProbeResult
result)
598
internal Task<
InternalMicrosoftProbeResult
> CheckWindowsUserDnsDomainAsync(CancellationToken cancellationToken)
605
:
InternalMicrosoftProbeResult
.NotDetected);
608
private async Task<
InternalMicrosoftProbeResult
> CheckWslWindowsUserDnsDomainAsync(CancellationToken cancellationToken)
612
return
InternalMicrosoftProbeResult
.NotDetected;
627
:
InternalMicrosoftProbeResult
.NotDetected;
631
private async Task<
InternalMicrosoftProbeResult
> CheckVisualStudioMicrosoftTenantAsync(CancellationToken cancellationToken)
636
return
InternalMicrosoftProbeResult
.NotDetected;
642
return
InternalMicrosoftProbeResult
.NotDetected;
652
return
InternalMicrosoftProbeResult
.Failed(new(
659
private async Task<
InternalMicrosoftProbeResult
> CheckWslVisualStudioMicrosoftTenantAsync(CancellationToken cancellationToken)
663
return
InternalMicrosoftProbeResult
.NotDetected;
678
internal async Task<
InternalMicrosoftProbeResult
> CheckMacPlatformSsoAsync(CancellationToken cancellationToken)
696
internal static
InternalMicrosoftProbeResult
EvaluateMacPlatformSso(string output)
797
private static
InternalMicrosoftProbeResult
PlatformSsoFailure(string code, string stage)
798
=>
InternalMicrosoftProbeResult
.Failed(new(code, stage));
800
internal async Task<
InternalMicrosoftProbeResult
> CheckWindowsWorkplaceJoinAsync(CancellationToken cancellationToken)
804
return
InternalMicrosoftProbeResult
.NotDetected;
818
private async Task<
InternalMicrosoftProbeResult
> CheckWslWindowsWorkplaceJoinAsync(CancellationToken cancellationToken)
822
return
InternalMicrosoftProbeResult
.NotDetected;
834
private Task<
InternalMicrosoftProbeResult
> CheckGhCliAsync(CancellationToken cancellationToken)
837
private Task<
InternalMicrosoftProbeResult
> CheckWslWindowsGhCliAsync(CancellationToken cancellationToken)
840
internal async Task<
InternalMicrosoftProbeResult
> CheckGhCliExecutableAsync(string executable, CancellationToken cancellationToken)
844
return
InternalMicrosoftProbeResult
.NotDetected;
849
return
InternalMicrosoftProbeResult
.NotDetected;
864
return
InternalMicrosoftProbeResult
.NotDetected;
871
private async Task<
InternalMicrosoftProbeResult
> CheckEnvironmentGitHubTokenAsync(CancellationToken cancellationToken)
875
return
InternalMicrosoftProbeResult
.NotDetected;
881
return
InternalMicrosoftProbeResult
.NotDetected;
887
internal async Task<
InternalMicrosoftProbeResult
> CheckCopilotCliAsync(CancellationToken cancellationToken)
891
return
InternalMicrosoftProbeResult
.NotDetected;
914
return
InternalMicrosoftProbeResult
.NotDetected;
1025
internal async Task<
InternalMicrosoftProbeResult
> CheckGitHubMembershipWithTokenResultForTestingAsync(string token, CancellationToken cancellationToken)
1085
private static
InternalMicrosoftProbeResult
ToProbeResult(GitHubMembershipCheckResult result)
1089
?
InternalMicrosoftProbeResult
.Failed(result.Failure)
1090
:
InternalMicrosoftProbeResult
.NotDetected;
1201
private static
InternalMicrosoftProbeResult
? GetProcessFailure(ProcessResult result, bool treatNonZeroExitAsFailure)
1205
return
InternalMicrosoftProbeResult
.Failed(result.Failure);
1209
?
InternalMicrosoftProbeResult
.Failed(new(
1216
private static
InternalMicrosoftProbeResult
EvaluateWindowsWorkplaceJoin(string output, string? fallbackDomain)
1220
return
InternalMicrosoftProbeResult
.NotDetected;
1232
:
InternalMicrosoftProbeResult
.NotDetected;
1267
private static
InternalMicrosoftProbeResult
DetectVisualStudioMicrosoftTenant(string? text, CancellationToken cancellationToken)
1271
return
InternalMicrosoftProbeResult
.NotDetected;
1282
var personalizationResults = new List<
InternalMicrosoftProbeResult
>();
1283
var fallbackResults = new List<
InternalMicrosoftProbeResult
>();
1286
InternalMicrosoftProbeResult
? failure = null;
1291
var
result = TryDetectVisualStudioMicrosoftTenantAccount(account);
1337
return failure ??
InternalMicrosoftProbeResult
.NotDetected;
1341
return
InternalMicrosoftProbeResult
.Failed(new(
1356
private static
InternalMicrosoftProbeResult
SelectUnambiguousIdentity(IReadOnlyList<
InternalMicrosoftProbeResult
> candidates)
1358
var
first = candidates[0];
1366
private static
InternalMicrosoftProbeResult
TryDetectVisualStudioMicrosoftTenantAccount(JsonElement account)
1393
return
InternalMicrosoftProbeResult
.NotDetected;
1409
return
InternalMicrosoftProbeResult
.NotDetected;
1419
return
InternalMicrosoftProbeResult
.NotDetected;
1443
return
InternalMicrosoftProbeResult
.NotDetected;
1453
return
InternalMicrosoftProbeResult
.NotDetected;
1465
return
InternalMicrosoftProbeResult
.Failed(new(
1472
private static
InternalMicrosoftProbeResult
JsonShapeFailure(string stage)
1473
=>
InternalMicrosoftProbeResult
.Failed(new(InternalMicrosoftProbeFailureCode.JsonShape, stage));
1475
internal static
InternalMicrosoftProbeResult
DetectVisualStudioMicrosoftTenantForTesting(string text, CancellationToken cancellationToken)
1769
private static
InternalMicrosoftProbeResult
Detected(string? alias, string? domain = null)
1930
private sealed record InternalMicrosoftProbeRunResult(InternalMicrosoftProbe Probe, string Source,
InternalMicrosoftProbeResult
Result, InternalMicrosoftProbeDiagnostic Diagnostic, long CompletionTimestamp);
1935
Func<CancellationToken, Task<
InternalMicrosoftProbeResult
>> DetectAsync,
1940
public static
InternalMicrosoftProbeResult
NotDetected { get; } = new(IsInternalMicrosoft: false, Alias: null, Domain: null);
1942
public static
InternalMicrosoftProbeResult
Failed(InternalMicrosoftProbeFailure failure)
Aspire.Cli.Tests (48)
Telemetry\InternalMicrosoftDetectorTests.cs (48)
65
return Task.FromResult(
InternalMicrosoftProbeResult
.NotDetected);
94
return
InternalMicrosoftProbeResult
.NotDetected;
180
return Task.FromResult(
InternalMicrosoftProbeResult
.NotDetected);
232
return
InternalMicrosoftProbeResult
.NotDetected;
358
[[new InternalMicrosoftProbe("negative", _ => Task.FromResult(
InternalMicrosoftProbeResult
.NotDetected))]]);
423
new InternalMicrosoftProbe("negative", _ => Task.FromResult(
InternalMicrosoftProbeResult
.NotDetected)),
424
new InternalMicrosoftProbe("failed", _ => Task.FromResult(
InternalMicrosoftProbeResult
.Failed(new(
448
return
InternalMicrosoftProbeResult
.NotDetected;
472
return
InternalMicrosoftProbeResult
.NotDetected;
528
[[new InternalMicrosoftProbe("CI negative", _ => Task.FromResult(
InternalMicrosoftProbeResult
.NotDetected))]],
598
var
result = await detector.CheckWindowsUserDnsDomainAsync(CancellationToken.None);
619
var
result = await detector.CheckWindowsUserDnsDomainAsync(CancellationToken.None);
654
var
result = await detector.CheckWindowsWorkplaceJoinAsync(CancellationToken.None);
691
var
result = await detector.CheckWindowsWorkplaceJoinAsync(CancellationToken.None);
722
var
result = await detector.CheckWindowsWorkplaceJoinAsync(CancellationToken.None);
742
var
result = InternalMicrosoftDetector.EvaluateMacPlatformSso(output);
758
var
result = InternalMicrosoftDetector.EvaluateMacPlatformSso(output);
773
var
result = InternalMicrosoftDetector.EvaluateMacPlatformSso(output);
788
var
result = InternalMicrosoftDetector.EvaluateMacPlatformSso(output);
803
var
result = InternalMicrosoftDetector.EvaluateMacPlatformSso(output);
817
var
result = InternalMicrosoftDetector.EvaluateMacPlatformSso(output);
838
var
result = InternalMicrosoftDetector.EvaluateMacPlatformSso(output);
877
var
result = await detector.CheckMacPlatformSsoAsync(CancellationToken.None);
928
var
result = await detector.CheckMacPlatformSsoAsync(TestContext.Current.CancellationToken);
946
var
result = await detector.CheckMacPlatformSsoAsync(CancellationToken.None);
993
var
probeResult = await detector.CheckMacPlatformSsoAsync(CancellationToken.None);
1058
var
result = InternalMicrosoftDetector.EvaluateMacPlatformSso($"{stdout}{Environment.NewLine}{stderr}");
1077
InternalMicrosoftProbeResult
.Failed(new(
1112
var
result = await detector.CheckWindowsWorkplaceJoinAsync(CancellationToken.None);
1142
var
result = await detector.CheckGhCliExecutableAsync(executable, CancellationToken.None);
1173
var
result = await detector.CheckGhCliExecutableAsync(executable, CancellationToken.None);
1196
var
result = await detector.CheckGitHubMembershipWithTokenResultForTestingAsync(CreateGitHubToken(1), CancellationToken.None);
1221
var
result = await detector.CheckGitHubMembershipWithTokenResultForTestingAsync(CreateGitHubToken(1), CancellationToken.None);
1269
var
result = await detector.CheckGitHubMembershipWithTokenResultForTestingAsync(CreateGitHubToken(1), CancellationToken.None);
1370
var
result = await detector.CheckCopilotCliAsync(CancellationToken.None);
1397
var
result = await detector.CheckCopilotCliAsync(CancellationToken.None);
1426
var
result = await detector.CheckCopilotCliAsync(CancellationToken.None);
1439
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(
1450
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(
1467
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(
1483
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(
1500
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(
1516
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(
1551
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(
1590
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(store, CancellationToken.None);
1601
var
result = InternalMicrosoftDetector.DetectVisualStudioMicrosoftTenantForTesting(
1638
var
result = await detector.CheckCopilotCliAsync(CancellationToken.None);
1697
var
result = await checkTask.WaitAsync(safetyTimeout.Token);