refactor: architecture foundations (status type, schema versioning, shared mock) #107
Reference in New Issue
Block a user
Delete Branch "refactor/arch-foundations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Phase 5a of the review-findings backlog — three foundational items that make larger refactors safer.
Commit 1 — typed Status constants:
models.Statustype with constants (StatusUp, StatusDown, StatusPending, StatusLate, StatusStale, StatusSSLExp)IsBroken()predicate replaces duplicateisBrokenlambda (monitor.go) andisDownfunction (sla.go)Commit 2 — schema_version migration table:
schema_versiontable tracks applied migrations by numberregions(sites) andnode_id(check_history)DeleteAlertnow nullssites.alert_idbefore deleting, preventing dangling refsCommit 3 — shared storetest.BaseMock:
internal/store/storetest/mock.gowith full Store interface + optional Func field overridesTest plan
go test -race ./...— all passgolangci-lint— 0 issues"UP"/"DOWN"remaining in non-test, non-checker code