fix(engine): apply convergence + push/group check history #114

Merged
lerko merged 1 commits from fix/apply-convergence into main 2026-06-12 11:56:31 +00:00
Owner

Summary

Two engine correctness fixes from the review-findings backlog.

1. Poll loop fully converges with DB
Previously the poll loop only added new sites — uptop apply config edits were silently ignored until restart, and pruned sites kept being checked and alerting. Now:

  • Updated configs detected via SiteConfig != cfg comparison, refreshed via UpdateSiteConfig
  • Vanished sites (removed from DB) evicted from liveState via RemoveSite

2. Push + group monitors record check history

  • RecordHeartbeat now calls recordCheck — push monitors get check_history rows, sparklines, and uptime %
  • checkGroup records a synthetic check per evaluation — groups get uptime history instead of blank displays

Test plan

  • go test -count=1 ./... — all pass
  • golangci-lint — 0 issues
  • Existing heartbeat/group tests still pass
## Summary Two engine correctness fixes from the review-findings backlog. **1. Poll loop fully converges with DB** Previously the poll loop only added new sites — `uptop apply` config edits were silently ignored until restart, and pruned sites kept being checked and alerting. Now: - Updated configs detected via `SiteConfig != cfg` comparison, refreshed via `UpdateSiteConfig` - Vanished sites (removed from DB) evicted from liveState via `RemoveSite` **2. Push + group monitors record check history** - `RecordHeartbeat` now calls `recordCheck` — push monitors get check_history rows, sparklines, and uptime % - `checkGroup` records a synthetic check per evaluation — groups get uptime history instead of blank displays ## Test plan - [x] `go test -count=1 ./...` — all pass - [x] `golangci-lint` — 0 issues - [x] Existing heartbeat/group tests still pass
lerko added 1 commit 2026-06-12 01:20:04 +00:00
fix(engine): apply convergence + push/group check history
CI / test (pull_request) Successful in 1m54s
CI / lint (pull_request) Successful in 1m27s
CI / vulncheck (pull_request) Successful in 1m1s
916c963663
1. Poll loop now fully converges with the DB: updated site configs
   are refreshed via UpdateSiteConfig, and sites removed from the DB
   are evicted from liveState. Previously the loop only added new
   sites — config edits via apply were ignored until restart, and
   pruned sites kept being checked and alerting.

2. Push monitors now record check history on each heartbeat via
   recordCheck. Previously RecordHeartbeat updated state but never
   wrote to check_history — push uptime % and sparklines were empty.

3. Groups record a synthetic check per evaluation tick so they get
   uptime history and sparklines instead of blank displays.
lerko merged commit 916c963663 into main 2026-06-12 11:56:31 +00:00
lerko deleted branch fix/apply-convergence 2026-06-12 11:56:31 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lerkolabs/uptop#114