perf(adminui): /deployments lists a projection, not 50 artifact blobs

This commit is contained in:
Joseph Doherty
2026-08-15 21:38:11 -04:00
parent c3970a2e5d
commit dbc9a132e2
@@ -66,7 +66,18 @@
</table>
@code {
private IReadOnlyList<Deployment> _deployments = Array.Empty<Deployment>();
// Blob-free projection: the Deployment entity carries a varbinary(max) ArtifactBlob (a whole-fleet
// gzip config snapshot), which materialising the full entity would drag across the wire 50 times
// over just to render six scalar columns.
private sealed record DeploymentRow(
Guid DeploymentId,
string RevisionHash,
DeploymentStatus Status,
string CreatedBy,
DateTime CreatedAtUtc,
DateTime? SealedAtUtc);
private IReadOnlyList<DeploymentRow> _deployments = Array.Empty<DeploymentRow>();
private bool _busy;
private bool _lastSuccess;
private string? _lastMessage;
@@ -83,6 +94,13 @@
_deployments = await db.Deployments
.AsNoTracking()
.OrderByDescending(d => d.CreatedAtUtc)
.Select(d => new DeploymentRow(
d.DeploymentId,
d.RevisionHash,
d.Status,
d.CreatedBy,
d.CreatedAtUtc,
d.SealedAtUtc))
.Take(50)
.ToListAsync();