feat(sites): record the artifact revision last deployed to a site

Site.ArtifactRevisionHash / ArtifactsDeployedAt (nullable, migration
AddSiteArtifactRevision) so the Sites page can tell whether a site's
system-wide artifacts are current. Not transported. Adds the
GetDeployedRevisionHashesAsync projection for the fleet-wide staleness batch.

Claude-Session: https://claude.ai/code/session_01Y5ef34iUUMjmwnMpL9xgmB
This commit is contained in:
Joseph Doherty
2026-09-14 13:33:59 -04:00
parent 0762d69132
commit dd202e5dde
9 changed files with 2333 additions and 4 deletions
@@ -294,6 +294,17 @@ public class DeploymentManagerRepository : IDeploymentManagerRepository
.FirstOrDefaultAsync(s => s.InstanceId == instanceId, cancellationToken);
}
/// <inheritdoc />
public async Task<IReadOnlyDictionary<int, string>> GetDeployedRevisionHashesAsync(CancellationToken cancellationToken = default)
{
// Projection only: ConfigurationJson is never materialised, so this stays cheap enough to
// read for the whole fleet in one round trip.
return await _dbContext.Set<DeployedConfigSnapshot>()
.AsNoTracking()
.Select(s => new { s.InstanceId, s.RevisionHash })
.ToDictionaryAsync(s => s.InstanceId, s => s.RevisionHash, cancellationToken);
}
/// <inheritdoc />
public async Task AddDeployedSnapshotAsync(DeployedConfigSnapshot snapshot, CancellationToken cancellationToken = default)
{