audit work, fixed StellaOps.sln warnings/errors, fixed tests, sprints work, new advisories
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading;
|
||||
@@ -68,7 +69,7 @@ internal sealed class GraphJobEventPublisher : IGraphJobCompletionPublisher, IAs
|
||||
new NameValueEntry("event", payload),
|
||||
new NameValueEntry("kind", envelope.Kind),
|
||||
new NameValueEntry("tenant", envelope.Tenant),
|
||||
new NameValueEntry("occurredAt", envelope.Timestamp.ToString("O")),
|
||||
new NameValueEntry("occurredAt", envelope.Timestamp.ToString("O", CultureInfo.InvariantCulture)),
|
||||
new NameValueEntry("jobId", notification.Job.Id),
|
||||
new NameValueEntry("status", notification.Status.ToString())
|
||||
};
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Globalization;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -70,7 +71,7 @@ internal sealed class MessagingGraphJobEventPublisher : IGraphJobCompletionPubli
|
||||
Headers = new Dictionary<string, string>
|
||||
{
|
||||
["kind"] = envelope.Kind,
|
||||
["occurredAt"] = envelope.Timestamp.ToString("O"),
|
||||
["occurredAt"] = envelope.Timestamp.ToString("O", CultureInfo.InvariantCulture),
|
||||
["jobId"] = notification.Job.Id,
|
||||
["status"] = notification.Status.ToString()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -198,7 +199,7 @@ internal static class ScheduleEndpoints
|
||||
ScheduleId: updated.Id,
|
||||
Metadata: new Dictionary<string, string>
|
||||
{
|
||||
["updatedAt"] = updated.UpdatedAt.ToString("O")
|
||||
["updatedAt"] = updated.UpdatedAt.ToString("O", CultureInfo.InvariantCulture)
|
||||
}),
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
// Task: SQC-009 - Implement HlcSchedulerEnqueueService
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
using System.Globalization;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -32,17 +33,20 @@ public sealed class HlcSchedulerEnqueueService : IHlcSchedulerEnqueueService
|
||||
private readonly ISchedulerLogRepository _logRepository;
|
||||
private readonly IChainHeadRepository _chainHeadRepository;
|
||||
private readonly ILogger<HlcSchedulerEnqueueService> _logger;
|
||||
private readonly TimeProvider _timeProvider;
|
||||
|
||||
public HlcSchedulerEnqueueService(
|
||||
IHybridLogicalClock hlc,
|
||||
ISchedulerLogRepository logRepository,
|
||||
IChainHeadRepository chainHeadRepository,
|
||||
ILogger<HlcSchedulerEnqueueService> logger)
|
||||
ILogger<HlcSchedulerEnqueueService> logger,
|
||||
TimeProvider? timeProvider = null)
|
||||
{
|
||||
_hlc = hlc ?? throw new ArgumentNullException(nameof(hlc));
|
||||
_logRepository = logRepository ?? throw new ArgumentNullException(nameof(logRepository));
|
||||
_chainHeadRepository = chainHeadRepository ?? throw new ArgumentNullException(nameof(chainHeadRepository));
|
||||
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
|
||||
_timeProvider = timeProvider ?? TimeProvider.System;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -80,7 +84,7 @@ public sealed class HlcSchedulerEnqueueService : IHlcSchedulerEnqueueService
|
||||
PayloadHash = payloadHash,
|
||||
PrevLink = prevLink,
|
||||
Link = link,
|
||||
CreatedAt = DateTimeOffset.UtcNow
|
||||
CreatedAt = _timeProvider.GetUtcNow()
|
||||
};
|
||||
|
||||
// 7. Insert log entry atomically with chain head update
|
||||
@@ -188,7 +192,7 @@ public sealed class HlcSchedulerEnqueueService : IHlcSchedulerEnqueueService
|
||||
PayloadHash = payloadHash,
|
||||
PrevLink = prevLink,
|
||||
Link = link,
|
||||
CreatedAt = DateTimeOffset.UtcNow
|
||||
CreatedAt = _timeProvider.GetUtcNow()
|
||||
};
|
||||
|
||||
entries.Add(entry);
|
||||
@@ -262,7 +266,7 @@ public sealed class HlcSchedulerEnqueueService : IHlcSchedulerEnqueueService
|
||||
["idempotencyKey"] = payload.IdempotencyKey,
|
||||
["correlationId"] = payload.CorrelationId,
|
||||
["maxAttempts"] = payload.MaxAttempts,
|
||||
["notBefore"] = payload.NotBefore?.ToString("O"),
|
||||
["notBefore"] = payload.NotBefore?.ToString("O", CultureInfo.InvariantCulture),
|
||||
["createdBy"] = payload.CreatedBy
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using StellaOps.Scheduler.Models;
|
||||
@@ -142,7 +143,7 @@ internal sealed class PlannerQueueDispatchService : IPlannerQueueDispatchService
|
||||
|
||||
if (impactSet.GeneratedAt != default)
|
||||
{
|
||||
map["impactGeneratedAt"] = impactSet.GeneratedAt.UtcDateTime.ToString("O");
|
||||
map["impactGeneratedAt"] = impactSet.GeneratedAt.UtcDateTime.ToString("O", CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(run.ScheduleId))
|
||||
|
||||
@@ -17,7 +17,4 @@
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="xunit.runner.visualstudio" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -7,10 +7,6 @@
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="xunit.runner.visualstudio" >
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" >
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="xunit.runner.visualstudio" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -7,10 +7,6 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" >
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user