api: expose host.repo_status in /api/hosts JSON
CI / Test (rest) (pull_request) Successful in 11s
CI / Test (store) (pull_request) Successful in 10s
CI / Build (windows/amd64) (pull_request) Successful in 15s
CI / Lint (pull_request) Successful in 19s
CI / Build (linux/arm64) (pull_request) Successful in 7s
CI / Build (linux/amd64) (pull_request) Successful in 15s
CI / Test (server-http) (pull_request) Successful in 1m30s
e2e / Playwright vs docker-compose (pull_request) Failing after 6m36s

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.
This commit is contained in:
2026-05-08 22:06:22 +01:00
parent ccd7c2f2fd
commit 130b68226e
+2
View File
@@ -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,