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:
+11
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user