Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Downgrade legacy Patrol healthy badges to completed
rcourtman58112a68768f
diff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.mdindex 84b0891924..25d52495ff 100644--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md@@ -292,6 +292,10 @@ flattening the run into a plain healthy-looking summary.That same caveat belongs in collapsed run-history rows. Legacy runs withoutfindings snapshot ids must carry an explicit snapshot-unavailable marker in thetop row instead of looking like a clean zero-findings run until expanded.+That same rule applies to run-status badges. A legacy run without findings+snapshot ids must not keep a green `healthy` badge when the surrounding UI is+saying findings verification is unavailable; the canonical run-status+presentation should downgrade that state to a neutral `completed` badge.That same findings surface should keep its section chrome functional ratherthan promotional. Inside the Patrol findings tab, the selected tab alreadynames the surface, so the findings card should not add another in-card productdiff --git a/frontend-modern/src/components/patrol/PatrolStatusBar.tsx b/frontend-modern/src/components/patrol/PatrolStatusBar.tsxindex 2de948b98c..822cb758db 100644--- a/frontend-modern/src/components/patrol/PatrolStatusBar.tsx+++ b/frontend-modern/src/components/patrol/PatrolStatusBar.tsx@@ -52,6 +52,7 @@ export const PatrolStatusBar: Component<PatrolStatusBarProps> = (props) => {const lastRunStatus = getPatrolRunStatusPresentation(lastRun?.status ?? 'unknown',lastRun?.error_count ?? 0,+ lastRun?.finding_ids !== undefined,);return {lastRun,diff --git a/frontend-modern/src/components/patrol/RunHistoryEntry.tsx b/frontend-modern/src/components/patrol/RunHistoryEntry.tsxindex c99a5eb250..4b87ce5189 100644--- a/frontend-modern/src/components/patrol/RunHistoryEntry.tsx+++ b/frontend-modern/src/components/patrol/RunHistoryEntry.tsx@@ -148,11 +148,11 @@ export function RunHistoryEntry(props: RunHistoryEntryProps) {const run = props.run;const scopeSummary = formatScope(run);const duration = formatDurationMs(run.duration_ms);- const runStatus = getPatrolRunStatusPresentation(run.status, run.error_count);const canonicalScopeResourceIds = getCanonicalScopeResourceIds(run);const runIsHealthy = isPatrolRunHealthy(run.status, run.error_count);const coverageSummary = getPatrolRunCoverageSummary(run);const hasFindingsSnapshot = run.finding_ids !== undefined;+ const runStatus = getPatrolRunStatusPresentation(run.status, run.error_count, hasFindingsSnapshot);return (<divdiff --git a/frontend-modern/src/components/patrol/__tests__/PatrolStatusBar.test.tsx b/frontend-modern/src/components/patrol/__tests__/PatrolStatusBar.test.tsxindex ea5fd3c005..32796d20bc 100644--- a/frontend-modern/src/components/patrol/__tests__/PatrolStatusBar.test.tsx+++ b/frontend-modern/src/components/patrol/__tests__/PatrolStatusBar.test.tsx@@ -105,7 +105,7 @@ describe('PatrolStatusBar', () => {const latestRunSection = screen.getByText('Latest: Full patrol').closest('span');expect(latestRunSection).not.toBeNull();expect(latestRunSection).toHaveTextContent(- 'Latest: Full patrol · healthy · Findings snapshot unavailable',+ 'Latest: Full patrol · completed · Findings snapshot unavailable',);});diff --git a/frontend-modern/src/components/patrol/__tests__/RunHistoryEntry.test.tsx b/frontend-modern/src/components/patrol/__tests__/RunHistoryEntry.test.tsxindex 08755963ff..5a84fa4f65 100644--- a/frontend-modern/src/components/patrol/__tests__/RunHistoryEntry.test.tsx+++ b/frontend-modern/src/components/patrol/__tests__/RunHistoryEntry.test.tsx@@ -132,6 +132,7 @@ describe('RunHistoryEntry', () => {));expect(screen.getByText('• Findings snapshot unavailable')).toBeInTheDocument();+ expect(screen.getByText('completed')).toBeInTheDocument();expect(screen.getByTestId('findings-panel')).toBeInTheDocument();expect(findingsPanelState.latestProps).toMatchObject({filterFindingIds: undefined,@@ -154,6 +155,7 @@ describe('RunHistoryEntry', () => {expect(screen.getByText('Snapshot unavailable')).toBeInTheDocument();expect(screen.queryByText('All clear — no new issues.')).not.toBeInTheDocument();expect(screen.queryByText(/^All clear$/)).not.toBeInTheDocument();+ expect(screen.queryByText('healthy')).not.toBeInTheDocument();});it('uses a shared coverage summary when a scoped run checked fewer resources than its scope', () => {diff --git a/frontend-modern/src/utils/__tests__/patrolRunPresentation.test.ts b/frontend-modern/src/utils/__tests__/patrolRunPresentation.test.tsindex a4ae315557..a7f5a836d8 100644--- a/frontend-modern/src/utils/__tests__/patrolRunPresentation.test.ts+++ b/frontend-modern/src/utils/__tests__/patrolRunPresentation.test.ts@@ -47,6 +47,13 @@ describe('patrolRunPresentation', () => {expect(getPatrolRunStatusPresentation('healthy').badgeClass).toContain('green-100');});+ it('downgrades legacy healthy runs without findings snapshots to a neutral completed state', () => {+ expect(getPatrolRunStatusPresentation('healthy', 0, false)).toEqual({+ badgeClass: 'bg-surface-alt text-base-content',+ label: 'completed',+ });+ });+it('treats erroring runs as error presentation even when the raw status says healthy', () => {const presentation = getPatrolRunStatusPresentation('healthy', 2);expect(presentation.label).toBe('error');@@ -91,6 +98,7 @@ describe('patrolRunPresentation', () => {it('uses checked-resource language for non-scoped coverage summaries', () => {expect(getPatrolRunCoverageSummary(fullCoverageRun)).toBe('Checked 58 resources');expect(getPatrolRunResourcesHeading(fullCoverageRun)).toBe('Resources checked (58)');+ });it('fails closed on zero-coverage scoped runs', () => {expect(@@ -101,7 +109,6 @@ describe('patrolRunPresentation', () => {}),).toBe('Checked 0 of 2 scoped resources');});- });it('returns canonical patrol run loading and unavailable copy', () => {expect(getRunHistoryLoadingState()).toBe('Loading run history…');diff --git a/frontend-modern/src/utils/patrolRunPresentation.ts b/frontend-modern/src/utils/patrolRunPresentation.tsindex 487009325c..5f4555e787 100644--- a/frontend-modern/src/utils/patrolRunPresentation.ts+++ b/frontend-modern/src/utils/patrolRunPresentation.ts@@ -48,6 +48,7 @@ export function isPatrolRunHealthy(export function getPatrolRunStatusPresentation(status: PatrolRunStatus | string,errorCount: number = 0,+ findingsSnapshotAvailable: boolean = true,): PatrolRunStatusPresentation {const normalized = getEffectivePatrolRunStatus(status, errorCount);@@ -64,6 +65,12 @@ export function getPatrolRunStatusPresentation(label: 'issues found',};case 'healthy':+ if (!findingsSnapshotAvailable) {+ return {+ badgeClass: 'bg-surface-alt text-base-content',+ label: 'completed',+ };+ }return {badgeClass: 'bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300',label: 'healthy',