fix(deployment): pending-updates tick uses a slim instance projection, hash-only flatten, one untracked mismatch snapshot read and a per-tick secret lookup memo (review 2026-10-21 04/P2)

This commit is contained in:
Joseph Doherty
2026-10-22 06:39:45 -04:00
parent 971a9886b8
commit df67fabe68
17 changed files with 443 additions and 128 deletions
@@ -299,4 +299,28 @@ public class ReconcileRepositoryTests : IDisposable
Assert.NotNull(await _repository.GetPendingDeploymentByIdAsync("dep-good"));
Assert.Null(await _repository.GetPendingDeploymentByIdAsync("dep-gone"));
}
/// <summary>
/// review 2026-10-21 04/P2: the pending-updates instance list is a slim, untracked projection
/// of the deployed (non-NotDeployed) instances.
/// </summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task GetDeployedInstanceSummaries_ExcludesNotDeployed_Untracked()
{
var siteId = await SeedSiteAsync("SiteSlim");
var enabled = await SeedInstanceAsync("SlimEnabled", siteId, InstanceState.Enabled);
var disabled = await SeedInstanceAsync("SlimDisabled", siteId, InstanceState.Disabled);
await SeedInstanceAsync("SlimNotDeployed", siteId, InstanceState.NotDeployed);
_context.ChangeTracker.Clear();
var summaries = await _repository.GetDeployedInstanceSummariesAsync();
Assert.Equal(new[] { enabled, disabled }.Order(), summaries.Select(i => i.Id).Order());
var e = summaries.Single(i => i.Id == enabled);
Assert.Equal(siteId, e.SiteId);
Assert.Equal(InstanceState.Enabled, e.State);
Assert.Equal("SlimEnabled", e.UniqueName);
Assert.Empty(_context.ChangeTracker.Entries<Instance>());
}
}