71 references to Field
AnalyzeCiFailure (71)
AnalysisPublicationQueries.cs (6)
18
return new JsonArray(issues.Where(issue => CiFailureJson.
Field
(issue, "pull_request") is null)
63
var match = comments.Where(comment => CiFailureJson.Text(CiFailureJson.
Field
(CiFailureJson.
Field
(comment, "user"), "login")) == "github-actions[bot]" &&
64
(CiFailureJson.Text(CiFailureJson.
Field
(comment, "body")) ?? "").StartsWith("<!-- analyze-ci-failure -->\n", StringComparison.Ordinal))
65
.OrderBy(comment => GitHubJson.ReadRequiredId(CiFailureJson.
Field
(comment, "id")))
68
return match is null ? "" : CiFailureJson.GetValueText(CiFailureJson.
Field
(match, "id"));
AnalysisPublisher.cs (8)
150
replayed = (existing["occurrences"] as JsonArray ?? []).Any(o => ReadNormalizedNumber(
Field
(o, "run_id")) == ReadNormalizedNumber(runId));
354
var occurrence = ((JsonArray)history["occurrences"]!).First(o => ReadNormalizedNumber(
Field
(o, "run_id")) == ReadNormalizedNumber(runId))!;
423
.DistinctBy(o => (ReadNormalizedNumber(
Field
(o, "run_id")), Text(
Field
(o, "run_id"))))
424
.OrderBy(o => Text(
Field
(o, "observed_at")), StringComparer.Ordinal);
478
labels.Any(l => Text(
Field
(l, "name")) == "ci-failure-cause") &&
607
result = Text(
Field
(response, "html_url")) ?? "";
609
var validId = GitHubJson.TryReadId(
Field
(response, idField), out var id);
AnalysisPublisher.Overflow.cs (3)
46
Text(
Field
(existing["user"], "login")) != "github-actions[bot]" ||
63
Text(
Field
(comment["user"], "login")) == "github-actions[bot]"))
113
ReadNormalizedNumber(
Field
(value, "run_id")) == NormalizedJsonNumber.Parse(runId));
BranchHistoryReader.cs (14)
53
static bool HasValidWorkflowRunRows(JsonNode? page) => page is JsonObject &&
Field
(page, "workflow_runs") is JsonArray rows &&
54
rows.All(run => run is JsonObject && GitHubJson.TryReadId(
Field
(run, "id"), out _) &&
55
Text(
Field
(run, "created_at")) is not null && Text(
Field
(run, "head_sha")) is { Length: > 0 });
59
&& ReadNormalizedNumber(
Field
(first, "total_count")) is not null
60
&& double.TryParse(GetValueText(
Field
(first, "total_count")), CultureInfo.InvariantCulture, out var total)
126
if (pages is not JsonArray { Count: > 0 } array || Text(
Field
(array[0], "status")) != "ahead" ||
127
!IsPositiveInteger(
Field
(array[0], "total_commits")) ||
128
array.Any(p => p is not JsonObject ||
Field
(p, "commits") is not JsonArray) ||
131
c["commit"] is not JsonObject || Text(
Field
(c["commit"], "message")) is null || Text(c["html_url"]) is null))
167
Message = Text(
Field
(commit["commit"], "message")),
183
=> candidates.OfType<JsonObject>().Where(pr => Text(
Field
(
Field
(pr["base"], "repo"), "full_name")) == repository &&
184
Text(
Field
(pr["base"], "ref")) == _branchName && pr["merged_at"] is not null)
CauseIssueRenderer.cs (2)
317
.SelectMany(o => (
Field
(o, "tests") as JsonArray ?? []).OfType<JsonObject>()
318
.Select(test => (Test: test, Run: GetValueText(
Field
(o, "run_id")))))
CollectionProjection.cs (6)
29
Title = Text(metadata["title"]) ?? "", Author = Text(
Field
(metadata["user"], "login")) ?? "",
30
State = Text(metadata["state"]) ?? "", HeadBranch = Text(
Field
(metadata["head"], "ref")) ?? "",
31
BaseBranch = Text(
Field
(metadata["base"], "ref")) ?? "", Url = Text(metadata["html_url"]) ?? "",
50
Author = Text(
Field
(merge["user"], "login")) ?? "", State = Text(merge["state"]) ?? "",
51
HeadBranch = Text(
Field
(merge["head"], "ref")) ?? "", BaseBranch = Text(
Field
(merge["base"], "ref")) ?? "",
Infrastructure\AnalysisGitHubClient.cs (1)
29
var rows = property is null ? page : CiFailureJson.
Field
(page, property);
WorkflowRunEvidenceCollector.cs (24)
107
if (!(runMetadata is JsonObject && GitHubJson.ReadRequiredId(
Field
(runMetadata, "id")) == runId))
170
failed_or_interrupted = allJobs.Count(job => IsFailedOrInterrupted(
Field
(job, "conclusion"))),
346
Text(
Field
(
Field
(
Field
(pullRequest, "base"), "repo"), "url")) == $"https://api.github.com/repos/{_repository}")
347
.Select(pullRequest =>
Field
(pullRequest, "number")));
355
(subjectPrNumber, ambiguous) = SelectSinglePullRequestNumber(associatedPullRequests.Where(pullRequest => Text(
Field
(
Field
(
Field
(pullRequest, "base"), "repo"), "full_name")) == _repository)
356
.Select(pullRequest =>
Field
(pullRequest, "number")));
358
var headOwner = Text(
Field
(
Field
(run["head_repository"], "owner"), "login")) ?? "";
365
mismatchedHead = associatedPullRequests.Count > 0 && !associatedPullRequests.Any(pullRequest => Text(
Field
(
Field
(pullRequest, "head"), "sha")) == headSha);
366
(subjectPrNumber, ambiguous) = SelectSinglePullRequestNumber(associatedPullRequests.Where(pullRequest => Text(
Field
(
Field
(pullRequest, "head"), "sha")) == headSha).Select(pullRequest =>
Field
(pullRequest, "number")));
488
if ((job["steps"] as JsonArray ?? []).Any(step => Text(
Field
(step, "status")) == "in_progress") &&
582
new[] { "filename", "status", "additions", "deletions", "changes" }.Select(fieldName => KeyValuePair.Create(fieldName,
Field
(file, fieldName)?.DeepClone())))).ToArray()));
610
["user"] =
Field
(pullRequest["user"], "login")?.DeepClone(),
611
["head_branch"] =
Field
(pullRequest["head"], "ref")?.DeepClone(),
612
["base_branch"] =
Field
(pullRequest["base"], "ref")?.DeepClone(),
725
var artifactMetadata = artifacts.First(candidate => ReadNormalizedNumber(
Field
(candidate, "id")) == ReadNormalizedNumber(selection.Artifact.Id));
726
if (
Field
(artifactMetadata, "workflow_run") is JsonObject associatedRun)
Workflows\AspireCiWorkflowConventions.cs (7)
26
.FirstOrDefault(step => Text(
Field
(step, "conclusion")) is "failure" or "cancelled" or "timed_out");
28
return firstFailure is not null && AggregationStepNameRegex().IsMatch(Text(
Field
(firstFailure, "name")) ?? "");
39
var required = steps.Any(step => Text(
Field
(step, "name")) == ResultsUploadStep) ||
65
var interrupted = !steps.Any(step => Text(
Field
(step, "conclusion")) == "failure") ||
66
steps.Any(step => Text(
Field
(step, "status")) == "in_progress") ||
67
steps.Any(step => Text(
Field
(step, "name")) == ExtensionTestStep &&
68
Text(
Field
(step, "conclusion")) is "cancelled" or "timed_out");