fix: exclude watch from patrol status summary

Since watch/info findings are filtered from the UI and never shown
to users, don't include them in the patrol run status summary.
This makes the summary consistent with what users actually see.
This commit is contained in:
rcourtman 2025-12-21 23:31:21 +00:00
parent 78c3434061
commit a0580db62d

View file

@ -872,7 +872,8 @@ func (p *PatrolService) runPatrol(ctx context.Context) {
summary := p.findings.GetSummary()
var findingsSummaryStr string
var status string
totalActive := summary.Critical + summary.Warning + summary.Watch
// Only count critical and warning as active issues (watch/info are filtered from UI)
totalActive := summary.Critical + summary.Warning
if totalActive == 0 {
findingsSummaryStr = "All healthy"
status = "healthy"
@ -884,9 +885,6 @@ func (p *PatrolService) runPatrol(ctx context.Context) {
if summary.Warning > 0 {
parts = append(parts, fmt.Sprintf("%d warning", summary.Warning))
}
if summary.Watch > 0 {
parts = append(parts, fmt.Sprintf("%d watch", summary.Watch))
}
findingsSummaryStr = fmt.Sprintf("%s", joinParts(parts))
if summary.Critical > 0 {
status = "critical"