release orchestrator v1 draft and build fixes

This commit is contained in:
master
2026-01-12 12:24:17 +02:00
parent f3de858c59
commit 9873f80830
1598 changed files with 240385 additions and 5944 deletions

View File

@@ -816,7 +816,7 @@ static void ConfigureEndpoints(WebApplication app)
.RequireAuthorization(NotifyPolicies.Viewer)
.RequireRateLimiting(NotifyRateLimitPolicies.DeliveryHistory);
apiGroup.MapPost("/digests", async ([FromBody] DigestUpsertRequest? request, IDigestRepository repository, HttpContext context, CancellationToken cancellationToken) =>
apiGroup.MapPost("/digests", async ([FromBody] DigestUpsertRequest? request, IDigestRepository repository, TimeProvider timeProvider, StellaOps.Determinism.IGuidProvider guidProvider, HttpContext context, CancellationToken cancellationToken) =>
{
if (!TryResolveTenant(context, tenantHeader, out var tenant, out var error))
{
@@ -843,11 +843,12 @@ static void ConfigureEndpoints(WebApplication app)
return Results.BadRequest(new { error = "digestKey is required." });
}
var collectUntil = request.CollectUntil ?? DateTimeOffset.UtcNow.AddHours(1);
var now = timeProvider.GetUtcNow();
var collectUntil = request.CollectUntil ?? now.AddHours(1);
var eventsJson = request.Events?.ToJsonString() ?? "[]";
var digest = new DigestEntity
{
Id = Guid.NewGuid(),
Id = guidProvider.NewGuid(),
TenantId = tenant,
ChannelId = channelIdGuid,
Recipient = request.Recipient,
@@ -857,8 +858,8 @@ static void ConfigureEndpoints(WebApplication app)
Status = DigestStatus.Collecting,
CollectUntil = collectUntil,
SentAt = null,
CreatedAt = DateTimeOffset.UtcNow,
UpdatedAt = DateTimeOffset.UtcNow
CreatedAt = now,
UpdatedAt = now
};
var saved = await repository.UpsertAsync(digest, cancellationToken).ConfigureAwait(false);
@@ -925,7 +926,7 @@ static void ConfigureEndpoints(WebApplication app)
})
.RequireAuthorization(NotifyPolicies.Operator);
apiGroup.MapPost("/audit", async ([FromBody] JsonNode? body, INotifyAuditRepository repository, HttpContext context, ClaimsPrincipal user, CancellationToken cancellationToken) =>
apiGroup.MapPost("/audit", async ([FromBody] JsonNode? body, INotifyAuditRepository repository, TimeProvider timeProvider, HttpContext context, ClaimsPrincipal user, CancellationToken cancellationToken) =>
{
if (!TryResolveTenant(context, tenantHeader, out var tenant, out var error))
{
@@ -952,7 +953,7 @@ static void ConfigureEndpoints(WebApplication app)
ResourceId = body["entityId"]?.GetValue<string>(),
Details = body["payload"]?.ToJsonString(),
CorrelationId = context.TraceIdentifier,
CreatedAt = DateTimeOffset.UtcNow
CreatedAt = timeProvider.GetUtcNow()
};
var id = await repository.CreateAsync(entry, cancellationToken).ConfigureAwait(false);

View File

@@ -17,6 +17,7 @@
<ItemGroup>
<ProjectReference Include="../../__Libraries/StellaOps.Configuration/StellaOps.Configuration.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.DependencyInjection/StellaOps.DependencyInjection.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Determinism.Abstractions/StellaOps.Determinism.Abstractions.csproj" />
<ProjectReference Include="../__Libraries/StellaOps.Notify.Models/StellaOps.Notify.Models.csproj" />
<ProjectReference Include="../__Libraries/StellaOps.Notify.Persistence/StellaOps.Notify.Persistence.csproj" />
<ProjectReference Include="../__Libraries/StellaOps.Notify.Engine/StellaOps.Notify.Engine.csproj" />