release orchestrator v1 draft and build fixes
This commit is contained in:
@@ -8,6 +8,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using StellaOps.Determinism;
|
||||
|
||||
namespace StellaOps.Registry.TokenService.Admin;
|
||||
|
||||
@@ -20,11 +21,13 @@ public sealed class InMemoryPlanRuleStore : IPlanRuleStore
|
||||
private readonly ConcurrentDictionary<string, PlanRuleDto> _plans = new(StringComparer.OrdinalIgnoreCase);
|
||||
private readonly ConcurrentBag<PlanAuditEntry> _auditLog = [];
|
||||
private readonly TimeProvider _timeProvider;
|
||||
private readonly IGuidProvider _guidProvider;
|
||||
private int _auditIdCounter;
|
||||
|
||||
public InMemoryPlanRuleStore(TimeProvider timeProvider)
|
||||
public InMemoryPlanRuleStore(TimeProvider timeProvider, IGuidProvider? guidProvider = null)
|
||||
{
|
||||
_timeProvider = timeProvider ?? throw new ArgumentNullException(nameof(timeProvider));
|
||||
_guidProvider = guidProvider ?? SystemGuidProvider.Instance;
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<PlanRuleDto>> GetAllAsync(CancellationToken cancellationToken = default)
|
||||
@@ -219,8 +222,8 @@ public sealed class InMemoryPlanRuleStore : IPlanRuleStore
|
||||
_auditLog.Add(entry);
|
||||
}
|
||||
|
||||
private static string GenerateId()
|
||||
private string GenerateId()
|
||||
{
|
||||
return $"plan-{Guid.NewGuid():N}"[..16];
|
||||
return $"plan-{_guidProvider.NewGuid():N}"[..16];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user