up
Some checks failed
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
Mirror Thin Bundle Sign & Verify / mirror-sign (push) Has been cancelled
api-governance / spectral-lint (push) Has been cancelled
Some checks failed
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
Mirror Thin Bundle Sign & Verify / mirror-sign (push) Has been cancelled
api-governance / spectral-lint (push) Has been cancelled
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Text.Json;
|
||||
using Microsoft.AspNetCore.Http.HttpResults;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using StellaOps.Policy.Engine.Streaming;
|
||||
using StellaOps.Policy.Engine.Overlay;
|
||||
|
||||
namespace StellaOps.Policy.Engine.Endpoints;
|
||||
|
||||
@@ -19,6 +20,7 @@ public static class PathScopeSimulationEndpoint
|
||||
private static async Task<IResult> HandleAsync(
|
||||
[FromBody] PathScopeSimulationRequest request,
|
||||
PathScopeSimulationService service,
|
||||
PathScopeSimulationBridgeService bridge,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
try
|
||||
@@ -31,6 +33,19 @@ public static class PathScopeSimulationEndpoint
|
||||
responseBuilder.AppendLine(line);
|
||||
}
|
||||
|
||||
// Emit change event stub when run in what-if mode.
|
||||
if (request.Options.Deterministic && request.Options.IncludeTrace)
|
||||
{
|
||||
var bridgeRequest = new PathScopeSimulationBridgeRequest(
|
||||
Tenant: request.Tenant,
|
||||
Rules: Array.Empty<string>(),
|
||||
Overlays: null,
|
||||
Paths: new[] { request },
|
||||
Mode: "preview",
|
||||
Seed: null);
|
||||
await bridge.SimulateAsync(bridgeRequest, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
return Results.Text(responseBuilder.ToString(), "application/x-ndjson", Encoding.UTF8);
|
||||
}
|
||||
catch (PathScopeSimulationException ex)
|
||||
|
||||
Reference in New Issue
Block a user