release orchestrator v1 draft and build fixes
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
using System.Collections.Immutable;
|
||||
using Microsoft.AspNetCore.Http.HttpResults;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using StellaOps.Determinism;
|
||||
using StellaOps.OpsMemory.Models;
|
||||
using StellaOps.OpsMemory.Playbook;
|
||||
using StellaOps.OpsMemory.Storage;
|
||||
@@ -54,6 +55,8 @@ public static class OpsMemoryEndpoints
|
||||
private static async Task<Results<Created<RecordDecisionResponse>, BadRequest<ProblemDetails>>> RecordDecisionAsync(
|
||||
RecordDecisionRequest request,
|
||||
IOpsMemoryStore store,
|
||||
TimeProvider timeProvider,
|
||||
IGuidProvider guidProvider,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(request.TenantId))
|
||||
@@ -76,9 +79,9 @@ public static class OpsMemoryEndpoints
|
||||
|
||||
var record = new OpsMemoryRecord
|
||||
{
|
||||
MemoryId = Guid.NewGuid().ToString("N"),
|
||||
MemoryId = guidProvider.NewGuid().ToString("N"),
|
||||
TenantId = request.TenantId,
|
||||
RecordedAt = DateTimeOffset.UtcNow,
|
||||
RecordedAt = timeProvider.GetUtcNow(),
|
||||
Situation = new SituationContext
|
||||
{
|
||||
CveId = request.CveId,
|
||||
@@ -94,7 +97,7 @@ public static class OpsMemoryEndpoints
|
||||
Action = action,
|
||||
Rationale = request.Rationale ?? string.Empty,
|
||||
DecidedBy = request.DecidedBy ?? "unknown",
|
||||
DecidedAt = DateTimeOffset.UtcNow,
|
||||
DecidedAt = timeProvider.GetUtcNow(),
|
||||
PolicyReference = request.PolicyReference,
|
||||
Mitigation = !string.IsNullOrEmpty(request.MitigationType)
|
||||
? new MitigationDetails
|
||||
@@ -144,6 +147,7 @@ public static class OpsMemoryEndpoints
|
||||
string tenantId,
|
||||
RecordOutcomeRequest request,
|
||||
IOpsMemoryStore store,
|
||||
TimeProvider timeProvider,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
if (!Enum.TryParse<OutcomeStatus>(request.Status, ignoreCase: true, out var status))
|
||||
@@ -164,7 +168,7 @@ public static class OpsMemoryEndpoints
|
||||
ActualImpact = request.ActualImpact,
|
||||
LessonsLearned = request.LessonsLearned,
|
||||
RecordedBy = request.RecordedBy ?? "unknown",
|
||||
RecordedAt = DateTimeOffset.UtcNow
|
||||
RecordedAt = timeProvider.GetUtcNow()
|
||||
};
|
||||
|
||||
var updated = await store.RecordOutcomeAsync(memoryId, tenantId, outcome, cancellationToken);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\StellaOps.OpsMemory\StellaOps.OpsMemory.csproj" />
|
||||
<ProjectReference Include="..\..\__Libraries\StellaOps.Determinism.Abstractions\StellaOps.Determinism.Abstractions.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user