UI work to fill SBOM sourcing management gap. UI planning remaining functionality exposure. Work on CI/Tests stabilization
Introduces CGS determinism test runs to CI workflows for Windows, macOS, Linux, Alpine, and Debian, fulfilling CGS-008 cross-platform requirements. Updates local-ci scripts to support new smoke steps, test timeouts, progress intervals, and project slicing for improved test isolation and diagnostics.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.Encodings.Web;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace StellaOps.Canonical.Json;
|
||||
@@ -19,6 +20,12 @@ namespace StellaOps.Canonical.Json;
|
||||
/// </remarks>
|
||||
public static class CanonJson
|
||||
{
|
||||
private static readonly JsonWriterOptions CanonWriterOptions = new()
|
||||
{
|
||||
Indented = false,
|
||||
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Serializes an object to a canonical JSON string.
|
||||
/// Object keys are recursively sorted using Ordinal comparison.
|
||||
@@ -58,12 +65,13 @@ public static class CanonJson
|
||||
var json = JsonSerializer.SerializeToUtf8Bytes(obj, new JsonSerializerOptions
|
||||
{
|
||||
WriteIndented = false,
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
|
||||
});
|
||||
|
||||
using var doc = JsonDocument.Parse(json);
|
||||
using var ms = new MemoryStream();
|
||||
using var writer = new Utf8JsonWriter(ms, new JsonWriterOptions { Indented = false });
|
||||
using var writer = new Utf8JsonWriter(ms, CanonWriterOptions);
|
||||
|
||||
WriteElementSorted(doc.RootElement, writer);
|
||||
writer.Flush();
|
||||
@@ -84,7 +92,7 @@ public static class CanonJson
|
||||
|
||||
using var doc = JsonDocument.Parse(json);
|
||||
using var ms = new MemoryStream();
|
||||
using var writer = new Utf8JsonWriter(ms, new JsonWriterOptions { Indented = false });
|
||||
using var writer = new Utf8JsonWriter(ms, CanonWriterOptions);
|
||||
|
||||
WriteElementSorted(doc.RootElement, writer);
|
||||
writer.Flush();
|
||||
@@ -101,7 +109,7 @@ public static class CanonJson
|
||||
{
|
||||
using var doc = JsonDocument.Parse(jsonBytes.ToArray());
|
||||
using var ms = new MemoryStream();
|
||||
using var writer = new Utf8JsonWriter(ms, new JsonWriterOptions { Indented = false });
|
||||
using var writer = new Utf8JsonWriter(ms, CanonWriterOptions);
|
||||
|
||||
WriteElementSorted(doc.RootElement, writer);
|
||||
writer.Flush();
|
||||
@@ -193,12 +201,13 @@ public static class CanonJson
|
||||
var json = JsonSerializer.SerializeToUtf8Bytes(obj, new JsonSerializerOptions
|
||||
{
|
||||
WriteIndented = false,
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
|
||||
});
|
||||
|
||||
using var doc = JsonDocument.Parse(json);
|
||||
using var ms = new MemoryStream();
|
||||
using var writer = new Utf8JsonWriter(ms, new JsonWriterOptions { Indented = false });
|
||||
using var writer = new Utf8JsonWriter(ms, CanonWriterOptions);
|
||||
|
||||
WriteElementVersioned(doc.RootElement, writer, version);
|
||||
writer.Flush();
|
||||
@@ -221,7 +230,7 @@ public static class CanonJson
|
||||
|
||||
using var doc = JsonDocument.Parse(json);
|
||||
using var ms = new MemoryStream();
|
||||
using var writer = new Utf8JsonWriter(ms, new JsonWriterOptions { Indented = false });
|
||||
using var writer = new Utf8JsonWriter(ms, CanonWriterOptions);
|
||||
|
||||
WriteElementVersioned(doc.RootElement, writer, version);
|
||||
writer.Flush();
|
||||
|
||||
Reference in New Issue
Block a user