feat(store): detect overlapping maintenance windows #151

Merged
lerko merged 1 commits from fix/maintenance-overlap-detection into main 2026-06-27 15:05:11 +00:00
Owner

Summary

  • Add GetOverlappingMaintenanceWindows() to store interface — finds windows overlapping a time range for same monitor, parent group, or global scope
  • TUI warns via log entry when creating a window that overlaps with an existing one (warn-and-create, not blocking)
  • 5 subtests covering same-monitor, different-monitor, global, indefinite, and ended-window cases
  • BaseMock stub added for interface compliance

Context

Backlog #15. #13 (orphaned windows) and #14 (TTL/pruning) were already implemented — only overlap detection was missing.

Test plan

  • go test ./... all green
  • golangci-lint run ./... 0 issues
  • Create maintenance window while one is active for same monitor — verify log warning appears
  • Create window for different monitor — verify no warning
  • Create window while global window active — verify warning
## Summary - Add `GetOverlappingMaintenanceWindows()` to store interface — finds windows overlapping a time range for same monitor, parent group, or global scope - TUI warns via log entry when creating a window that overlaps with an existing one (warn-and-create, not blocking) - 5 subtests covering same-monitor, different-monitor, global, indefinite, and ended-window cases - BaseMock stub added for interface compliance ## Context Backlog #15. #13 (orphaned windows) and #14 (TTL/pruning) were already implemented — only overlap detection was missing. ## Test plan - [x] `go test ./...` all green - [x] `golangci-lint run ./...` 0 issues - [x] Create maintenance window while one is active for same monitor — verify log warning appears - [x] Create window for different monitor — verify no warning - [x] Create window while global window active — verify warning
lerko added 1 commit 2026-06-27 15:00:37 +00:00
feat(store): detect overlapping maintenance windows
CI / test (pull_request) Successful in 1m46s
CI / lint (pull_request) Successful in 1m16s
CI / vulncheck (pull_request) Successful in 56s
3a089e7c1d
Warn via log when creating a maintenance window that overlaps with an
existing one for the same monitor, parent group, or global scope.
Handles both timed and indefinite windows.
lerko merged commit 3a089e7c1d into main 2026-06-27 15:05:11 +00:00
lerko deleted branch fix/maintenance-overlap-detection 2026-06-27 15:05:11 +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#151