From 130b68226e46e462b556205b13a8caef8853c1a5 Mon Sep 17 00:00:00 2001 From: Steve Cliff Date: Fri, 8 May 2026 22:06:22 +0100 Subject: [PATCH] api: expose host.repo_status in /api/hosts JSON The dashboard renders init_running / init_failed / ready state based on host.repo_status, but the JSON endpoint dropped the field on its way out. The e2e test couldn't poll for repo readiness; reflect the same projection the UI uses. --- internal/server/http/hosts.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/server/http/hosts.go b/internal/server/http/hosts.go index d355626..e1855ba 100644 --- a/internal/server/http/hosts.go +++ b/internal/server/http/hosts.go @@ -25,6 +25,7 @@ type hostView struct { CurrentJobID *string `json:"current_job_id,omitempty"` LastBackupAt *string `json:"last_backup_at,omitempty"` LastBackupStatus *string `json:"last_backup_status,omitempty"` + RepoStatus string `json:"repo_status,omitempty"` RepoSizeBytes int64 `json:"repo_size_bytes"` SnapshotCount int `json:"snapshot_count"` OpenAlertCount int `json:"open_alert_count"` @@ -85,6 +86,7 @@ func hostToView(h store.Host) hostView { Tags: h.Tags, CurrentJobID: h.CurrentJobID, LastBackupStatus: h.LastBackupStatus, + RepoStatus: h.RepoStatus, RepoSizeBytes: h.RepoSizeBytes, SnapshotCount: h.SnapshotCount, OpenAlertCount: h.OpenAlertCount,