140 references to TransientJson
AnalyzeCiFailure (16)
AnalysisDiagnostics.cs (1)
173
var outcome = DiagnosticTextSanitizer.SanitizeJson(JsonNode.Parse(
TransientJson
.Write(progress.CreateOutcome(status))), limit: 500, multiline: true)!;
AnalysisPublisher.cs (1)
179
_ =
TransientJson
.ParseId(linked.Split('/')[^1]);
AnalysisRerunner.cs (2)
26
var output =
TransientJson
.ReadUtf8<WorkflowAgentOutput>(await File.ReadAllBytesAsync(outputPath, ct));
54
var request =
TransientJson
.Read<WorkflowRerunRequest>(requests[0].GetRawText());
EvidencePackageStore.cs (4)
14
TransientJson
.ReadUtf8<EvidenceBundle>(File.ReadAllBytes(paths.Bundle)),
15
TransientJson
.ReadUtf8<AnalysisProposal>(File.ReadAllBytes(Path.Combine(analysisDirectory, "proposal.json"))),
20
await File.WriteAllTextAsync(paths.Bundle,
TransientJson
.Write(input.Evidence), ct);
40
return File.WriteAllTextAsync(paths.Outcome,
TransientJson
.Write(outcome));
EvidencePreparation.cs (2)
90
var runId =
TransientJson
.ParseId(runIdText ?? "");
169
var bundle =
TransientJson
.ReadUtf8<EvidenceBundle>(await File.ReadAllBytesAsync(paths.Bundle, ct));
RecoveryCaptureWriter.cs (1)
26
await File.WriteAllTextAsync(Path.Combine(directory, "collection-outcome.json"),
TransientJson
.Write(progress.CreateOutcome(status)));
WorkflowFailureDiagnosisContextBuilder.cs (5)
21
AppendJson(summary,
TransientJson
.ToElement(bundle.Run));
39
AppendJson(summary,
TransientJson
.ToElement(bundle.Jobs));
82
AppendJson(summary,
TransientJson
.ToElement(new
91
AppendJson(summary, bundle.Run.Scope == RunScope.Main ?
TransientJson
.ToElement(bundle.MainContext) :
TransientJson
.ToElement(bundle.SubjectPr));
AnalyzeCiFailure.Tests (124)
AnalyzeCiFailureBestEffortTests.cs (2)
67
var reloaded =
TransientJson
.Read<EvidenceBundle>(
TransientJson
.Write(partial));
AnalyzeCiFailureCohesionTests.cs (4)
34
var outcome =
TransientJson
.Read<AnalysisOutcome>(await File.ReadAllTextAsync(invocation.Evidence.Outcome));
49
await File.WriteAllTextAsync(input.Bundle,
TransientJson
.Write(bundle));
55
var outcome =
TransientJson
.Read<AnalysisOutcome>(await File.ReadAllTextAsync(invocation.Replay.Outcome));
72
var json = JsonNode.Parse(
TransientJson
.Write(outcome))!.AsObject();
AnalyzeCiFailureCollectionTests.cs (1)
58
var bundle = AnalyzeCiFailure.
TransientJson
.Read<AnalyzeCiFailure.EvidenceBundle>(json);
AnalyzeCiFailureCSharpRerunTests.cs (2)
88
await File.WriteAllTextAsync(Path.Combine(data, "evidence.json"),
TransientJson
.Write(evidence));
89
await File.WriteAllTextAsync(Path.Combine(analysis, "proposal.json"),
TransientJson
.Write(proposal));
AnalyzeCiFailureDiagnosticsTests.cs (2)
22
var outcome =
TransientJson
.Read<AnalysisOutcome>(File.ReadAllText(Path.Combine(EvidenceDirectory, "collection-outcome.json")));
120
var outcome =
TransientJson
.Read<AnalysisOutcome>(File.ReadAllText(invocation.Evidence.Outcome));
AnalyzeCiFailureEvidenceTests.cs (5)
90
var node = JsonNode.Parse(
TransientJson
.Write(proposal))!;
92
var result = await RunStrictValidationAsync(
TransientJson
.Write(evidence), node.ToJsonString());
147
var text =
TransientJson
.Write(proposal);
168
var document = JsonNode.Parse(
TransientJson
.Write(evidence))!;
179
TransientJson
.Read<EvidenceBundle>(document.ToJsonString()),
AnalyzeCiFailureFixtures.cs (2)
243
File.WriteAllText(Path.Combine(workingDirectory, "ci-failure-analysis/evidence", "evidence.json"),
TransientJson
.Write(evidence));
244
File.WriteAllText(Path.Combine(workingDirectory, "ci-analysis-output", "proposal.json"),
TransientJson
.Write(proposal));
AnalyzeCiFailureInvocationTests.cs (4)
127
var evidence =
TransientJson
.Read<EvidenceBundle>(original);
136
var replayed =
TransientJson
.Read<EvidenceBundle>(await File.ReadAllTextAsync(output.Bundle));
139
Assert.Equal("degraded",
TransientJson
.Read<AnalysisOutcome>(await File.ReadAllTextAsync(output.Outcome)).Status);
174
var original = invalid ? "{}" :
TransientJson
.Write(AnalyzeCiFailureFixtures.CreateEvidence(RunScope.PullRequest));
AnalyzeCiFailureMigrationTests.cs (29)
74
var outcome =
TransientJson
.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine(root, "collection-outcome.json")));
87
Assert.Equal(0, (await RunStrictValidationAsync(
TransientJson
.Write(evidence),
TransientJson
.Write(proposal))).ExitCode);
89
var bytes = Encoding.UTF8.GetBytes(
TransientJson
.Write(proposal));
122
var bundle =
TransientJson
.Read<EvidenceBundle>(await File.ReadAllTextAsync(Path.Combine(root, "evidence.json")));
203
var outcome =
TransientJson
.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "collection-outcome.json")));
216
var bundle =
TransientJson
.Read<EvidenceBundle>(await File.ReadAllTextAsync(Path.Combine(root, "evidence.json")));
219
var outcome =
TransientJson
.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine(root, "collection-outcome.json")));
240
var before =
TransientJson
.Write(evidence);
247
Assert.Equal(before,
TransientJson
.Write(evidence));
281
var before =
TransientJson
.Write(evidence);
290
Assert.Equal(before,
TransientJson
.Write(evidence));
309
var outcome =
TransientJson
.Read<AnalysisOutcome>(await File.ReadAllTextAsync(paths.Outcome));
389
Assert.Equal(0, (await RunStrictValidationAsync(
TransientJson
.Write(evidence),
TransientJson
.Write(proposal))).ExitCode);
416
Assert.Equal(0, (await RunStrictValidationAsync(
TransientJson
.Write(evidence),
TransientJson
.Write(proposal))).ExitCode);
435
await File.WriteAllTextAsync(Path.Combine(EvidenceDirectory, "evidence.json"),
TransientJson
.Write(evidence));
436
await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "ci-analysis-output", "proposal.json"),
TransientJson
.Write(proposal));
466
Assert.Equal(0, (await RunStrictValidationAsync(
TransientJson
.Write(evidence),
TransientJson
.Write(proposal))).ExitCode);
477
TransientJson
.Write(evidence with { TestEvidence = evidence.TestEvidence with { State = EvidenceState.Unavailable, Failures = [] } }));
479
var rejectedText = rejection == "malformed" ? "not JSON" :
TransientJson
.Write(rejection == "identity"
515
var evidence =
TransientJson
.Read<EvidenceBundle>(await File.ReadAllTextAsync(Path.Combine(data, "evidence.json")));
534
await File.WriteAllTextAsync(Path.Combine(agent, "proposal.json"),
TransientJson
.Write(proposal));
597
var proposal =
TransientJson
.Read<AnalysisProposal>(examples[0]);
599
var newCause =
TransientJson
.Read<ProposedCause>(examples[1]);
619
var outcome =
TransientJson
.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine(root, "collection-outcome.json")));
690
var bundle =
TransientJson
.Read<EvidenceBundle>(await File.ReadAllTextAsync(Path.Combine(root, "evidence.json")));
AnalyzeCiFailurePreparationTests.cs (9)
88
var document = JsonNode.Parse(AnalyzeCiFailure.
TransientJson
.Write(evidence))!;
102
var rejected = await RunStrictValidationAsync(document.ToJsonString(), AnalyzeCiFailure.
TransientJson
.Write(proposal));
177
var document = JsonNode.Parse(AnalyzeCiFailure.
TransientJson
.Write(evidence))!;
186
var result = await RunStrictValidationAsync(document.ToJsonString(), AnalyzeCiFailure.
TransientJson
.Write(proposal));
265
await File.WriteAllTextAsync(paths.Bundle, AnalyzeCiFailure.
TransientJson
.Write(bundle));
607
var document = JsonNode.Parse(AnalyzeCiFailure.
TransientJson
.Write(proposal))!;
671
var result = await RunStrictValidationAsync(AnalyzeCiFailure.
TransientJson
.Write(evidence), document.ToJsonString());
720
AnalyzeCiFailure.
TransientJson
.Write(evidence),
721
AnalyzeCiFailure.
TransientJson
.Write(proposal with { Causes = causes }));
AnalyzeCiFailurePublicationTests.cs (3)
1112
var recoveryOutcome = AnalyzeCiFailure.
TransientJson
.Read<AnalyzeCiFailure.AnalysisOutcome>(
1175
var document = JsonNode.Parse(AnalyzeCiFailure.
TransientJson
.Write(proposal))!;
1189
var result = await RunStrictValidationAsync(AnalyzeCiFailure.
TransientJson
.Write(evidence), document.ToJsonString());
AnalyzeCiFailureRuleTests.cs (4)
47
var facts = JsonNode.Parse(
TransientJson
.Write(evidence))!;
48
var decisions = JsonNode.Parse(
TransientJson
.Write(proposal))!;
63
TransientJson
.Read<EvidenceBundle>(facts.ToJsonString()),
64
TransientJson
.Read<AnalysisProposal>(decisions.ToJsonString()),
AnalyzeCiFailureStorageTests.cs (6)
47
var outcome =
TransientJson
.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine(recovery, "collection-outcome.json")));
70
var outcome =
TransientJson
.Read<AnalysisOutcome>(await File.ReadAllTextAsync(new EvidencePaths(EvidenceDirectory).Outcome));
103
var outcome =
TransientJson
.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine(recovery, "collection-outcome.json")));
115
var outcome =
TransientJson
.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine(recovery, "collection-outcome.json")));
197
TransientJson
.Write(AnalyzeCiFailureFixtures.CreateEvidence(RunScope.PullRequest)));
241
var text = invalid ? "{}" :
TransientJson
.Write(AnalyzeCiFailureFixtures.CreateEvidence(RunScope.PullRequest));
AnalyzeCiFailureTextTests.cs (3)
176
Assert.Equal(expected, AnalyzeCiFailure.
TransientJson
.Read<AnalyzeCiFailure.ProposedJobDecision>(document.ToJsonString()).Reason);
181
AnalyzeCiFailure.
TransientJson
.Read<AnalyzeCiFailure.ProposedJobDecision>(document.ToJsonString()));
202
Assert.Throws<AnalyzeCiFailure.ValidationException>(() => AnalyzeCiFailure.
TransientJson
.Read<AnalyzeCiFailure.CollectedSubjectPr>(
AnalyzeCiFailureTransientContractTests.cs (18)
38
var json = JsonNode.Parse(
TransientJson
.Write(AnalyzeCiFailureFixtures.CreateInfrastructureProposal(evidence)))!;
41
var proposal =
TransientJson
.Read<AnalysisProposal>(json.ToJsonString());
63
var proposal =
TransientJson
.Read<AnalysisProposal>(Proposal);
68
var originalEvidence =
TransientJson
.Write(evidence);
69
var originalProposal =
TransientJson
.Write(proposal);
82
Assert.Equal(originalEvidence,
TransientJson
.Write(evidence));
83
Assert.Equal(originalProposal,
TransientJson
.Write(proposal));
108
var proposal =
TransientJson
.Read<AnalysisProposal>(Proposal) with
133
var proposal =
TransientJson
.Read<AnalysisProposal>(Proposal);
163
var proposal =
TransientJson
.Read<AnalysisProposal>(Proposal) with
185
var proposal =
TransientJson
.Read<AnalysisProposal>(Proposal);
200
var proposal =
TransientJson
.Read<AnalysisProposal>(Proposal);
256
var proposal =
TransientJson
.Read<AnalysisProposal>(Proposal);
259
Assert.Equal(proposal,
TransientJson
.Read<AnalysisProposal>(
TransientJson
.Write(proposal)) with { Jobs = proposal.Jobs, Tests = proposal.Tests, Causes = proposal.Causes });
273
Assert.Throws<ValidationException>(() =>
TransientJson
.ParseId(id));
292
Assert.Throws<ValidationException>(() =>
TransientJson
.Read<AnalysisProposal>(Proposal.Replace(original, replacement, StringComparison.Ordinal)));
299
var error = Assert.Throws<ValidationException>(() =>
TransientJson
.Read<AnalysisProposal>(text));
AnalyzeCiFailureWorkflowCommandsTests.cs (4)
81
var outcome =
TransientJson
.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "collection-outcome.json")));
116
await File.WriteAllTextAsync(paths.Outcome,
TransientJson
.Write(outcome));
125
var failed =
TransientJson
.Read<AnalysisOutcome>(await File.ReadAllTextAsync(paths.Outcome));
129
var recovery =
TransientJson
.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine(
AnalyzeCiFailureWorkflowTests.cs (26)
65
var text = AnalyzeCiFailure.
TransientJson
.Write(evidence);
68
var result = await RunStrictValidationAsync(text, AnalyzeCiFailure.
TransientJson
.Write(proposal));
89
var trusted = System.Text.Json.Nodes.JsonNode.Parse(AnalyzeCiFailure.
TransientJson
.Write(evidence))!;
90
var decision = System.Text.Json.Nodes.JsonNode.Parse(AnalyzeCiFailure.
TransientJson
.Write(proposal))!;
136
var text = AnalyzeCiFailure.
TransientJson
.Write(proposal).TrimEnd();
138
var result = await RunStrictValidationAsync(AnalyzeCiFailure.
TransientJson
.Write(evidence), text);
484
var node = System.Text.Json.Nodes.JsonNode.Parse(AnalyzeCiFailure.
TransientJson
.Write(proposal))!;
491
var result = await RunStrictValidationAsync(AnalyzeCiFailure.
TransientJson
.Write(evidence), text);
582
var result = await RunStrictValidationAsync(AnalyzeCiFailure.
TransientJson
.Write(evidence), AnalyzeCiFailure.
TransientJson
.Write(proposal));
633
var node = System.Text.Json.Nodes.JsonNode.Parse(AnalyzeCiFailure.
TransientJson
.Write(proposal))!;
635
var result = await RunStrictValidationAsync(AnalyzeCiFailure.
TransientJson
.Write(evidence), node.ToJsonString());
664
var node = System.Text.Json.Nodes.JsonNode.Parse(AnalyzeCiFailure.
TransientJson
.Write(proposal))!;
666
result = await RunStrictValidationAsync(AnalyzeCiFailure.
TransientJson
.Write(evidence), node.ToJsonString());
712
var result = await RunStrictValidationAsync(AnalyzeCiFailure.
TransientJson
.Write(evidence), AnalyzeCiFailure.
TransientJson
.Write(proposal));
1313
var facts = System.Text.Json.Nodes.JsonNode.Parse(AnalyzeCiFailure.
TransientJson
.Write(evidence))!;
1314
var decisions = System.Text.Json.Nodes.JsonNode.Parse(AnalyzeCiFailure.
TransientJson
.Write(proposal))!;
1366
var facts = System.Text.Json.Nodes.JsonNode.Parse(AnalyzeCiFailure.
TransientJson
.Write(evidence))!;
1367
var decisions = System.Text.Json.Nodes.JsonNode.Parse(AnalyzeCiFailure.
TransientJson
.Write(proposal))!;
1599
var node = System.Text.Json.Nodes.JsonNode.Parse(AnalyzeCiFailure.
TransientJson
.Write(proposal))!;
1601
result = await RunStrictValidationAsync(AnalyzeCiFailure.
TransientJson
.Write(evidence), node.ToJsonString());
1700
var node = System.Text.Json.Nodes.JsonNode.Parse(AnalyzeCiFailure.
TransientJson
.Write(proposal))!;
1702
var result = await RunStrictValidationAsync(AnalyzeCiFailure.
TransientJson
.Write(evidence), node.ToJsonString());
1795
var node = System.Text.Json.Nodes.JsonNode.Parse(AnalyzeCiFailure.
TransientJson
.Write(proposal))!;
1797
var result = await RunStrictValidationAsync(AnalyzeCiFailure.
TransientJson
.Write(evidence), node.ToJsonString());