feat(deploy): PendingUpdatesEvaluator — one fleet snapshot of stale instances and stale-artifact sites
One scoped read that answers "is anything waiting to be deployed?" for the whole fleet: each site's stored artifact revision hash compared against what a deploy would send right now (NeverDeployed / Current / OutOfDate), plus per-site deployed/stale/unknown instance tallies from the batched staleness evaluation. NeverDeployed is deliberately NOT a pending update — the operator has not deployed yet — and exceptions propagate so the caller's single-flight cache can render "unavailable" rather than invent an "up to date". Adds the validated PendingUpdatesCacheTtl (60 s) that TTL will key off. Claude-Session: https://claude.ai/code/session_01Y5ef34iUUMjmwnMpL9xgmB
This commit is contained in:
+22
@@ -72,4 +72,26 @@ public class DeploymentManagerOptionsValidatorTests
|
||||
Assert.True(result.Failed);
|
||||
Assert.Contains("SiteDeploymentReconcileTimeout", result.FailureMessage);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ZeroPendingUpdatesCacheTtl_IsRejected()
|
||||
{
|
||||
// A zero TTL makes every Deployer/Administrator circuit's poll a cache miss,
|
||||
// so the whole fleet is re-flattened on each one — the exact cost the cache
|
||||
// exists to avoid.
|
||||
var result = Validate(new DeploymentManagerOptions { PendingUpdatesCacheTtl = TimeSpan.Zero });
|
||||
Assert.True(result.Failed);
|
||||
Assert.Contains("PendingUpdatesCacheTtl", result.FailureMessage);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NegativePendingUpdatesCacheTtl_IsRejected()
|
||||
{
|
||||
var result = Validate(new DeploymentManagerOptions
|
||||
{
|
||||
PendingUpdatesCacheTtl = TimeSpan.FromSeconds(-1)
|
||||
});
|
||||
Assert.True(result.Failed);
|
||||
Assert.Contains("PendingUpdatesCacheTtl", result.FailureMessage);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user