Support "validation" status with progress pings

Treat the new "validation" status like an in-progress ping similar to "configuring": add "validation" to status counts in dashboard and PBClient analysis, include it in stuck/installing logic, and prevent creating ghost records in UpsertTelemetry by skipping new record creation when payload.Status is "validation" or "configuring". Also add "validation" to allowedStatus and improve the warning log to include the actual status.
This commit is contained in:
CanbiZ (MickLesk)
2026-02-23 16:59:38 +01:00
parent 7f5c65c4c7
commit 56192f09bd
2 changed files with 11 additions and 11 deletions
+5 -5
View File
@@ -457,7 +457,7 @@ func aggregateRecords(records []TelemetryRecord, knownScripts map[string]ScriptI
st.Failed++
case "aborted":
st.Aborted++
case "installing", "configuring":
case "installing", "validation", "configuring":
st.Installing++
}
}
@@ -623,7 +623,7 @@ func (s *ScriptStatsStore) IncrementalUpdate(ctx context.Context, repoSource str
st.Failed++
case "aborted":
st.Aborted++
case "installing", "configuring":
case "installing", "validation", "configuring":
st.Installing++
}
added++
@@ -890,7 +890,7 @@ func (p *PBClient) FetchScriptAnalysisData(ctx context.Context, days int, repoSo
a.failed++
case "aborted":
a.aborted++
case "installing", "configuring":
case "installing", "validation", "configuring":
a.installing++
}
@@ -1051,7 +1051,7 @@ func (p *PBClient) FetchErrorAnalysisData(ctx context.Context, days int, repoSou
r.Status = "success"
}
if r.Status == "installing" || r.Status == "configuring" {
if r.Status == "installing" || r.Status == "validation" || r.Status == "configuring" {
stuckCount++
continue
}
@@ -1696,7 +1696,7 @@ func (p *PBClient) FetchDashboardData(ctx context.Context, days int, repoSource
}
case "aborted":
data.AbortedCount++
case "installing", "configuring":
case "installing", "validation", "configuring":
data.InstallingCount++
}
+6 -6
View File
@@ -500,12 +500,12 @@ func (p *PBClient) UpsertTelemetry(ctx context.Context, payload TelemetryOut) er
}
if recordID == "" {
// "configuring" is just a progress ping — never create a new record for it.
// Progress pings (validation/configuring) — never create a new record.
// This prevents ghost records (ct_type=0, all zeros, repo_source=N/A) when
// the container sends "configuring" before the host's "installing" was written.
if payload.Status == "configuring" {
log.Printf("[WARN] configuring update for %s (exec=%s) but no existing record found, skipping",
payload.NSAPP, payload.ExecutionID)
// the ping arrives before the host's "installing" record was written.
if payload.Status == "configuring" || payload.Status == "validation" {
log.Printf("[WARN] %s update for %s (exec=%s) but no existing record found, skipping",
payload.Status, payload.NSAPP, payload.ExecutionID)
return nil
}
// For final states (failed/success/aborted) — create as fallback.
@@ -685,7 +685,7 @@ var (
allowedType = map[string]bool{"lxc": true, "vm": true, "pve": true, "addon": true, "tool": true}
// Allowed values for 'status' field
allowedStatus = map[string]bool{"installing": true, "configuring": true, "success": true, "failed": true, "aborted": true, "unknown": true}
allowedStatus = map[string]bool{"installing": true, "validation": true, "configuring": true, "success": true, "failed": true, "aborted": true, "unknown": true}
// Allowed values for 'os_type' field
allowedOsType = map[string]bool{