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