mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-23 04:06:21 +00:00
a22eb2587c
Delete the residual internal/alerts/alerts.go catch-all and move its remaining ownership groups into config_facade, model, constants, metric_hooks, manager, default_config, lifecycle, and escalation files. Keep compatibility aliases in the alerts package, preserve the type-alias identity test, add a default-config pointer isolation regression test, and record the new ownership split in the alerts subsystem contract. Proof: git diff --check -- docs/release-control/v6/internal/subsystems/alerts.md internal/alerts Proof: go test ./internal/alerts/... -run 'TestDefaultAlertConfigUsesIndependentBackupAlertOrphanedPointer|TestTypeAliasIdentity|TestSetMetricHooks|TestSetLicenseCheckerStoresChecker|TestHistoryManager_Stop|TestEscalationDisabledWhenAlertsDisabled|TestEscalationDisabledWhenActivationPending|TestEscalationDisabledWhenActivationSnoozed|TestEscalationSkipsWhenScheduleDisabled|TestEscalationSkipsAcknowledgedAlerts|TestEscalationAdvancesLevels|TestEscalationDoesNotRepeatSameLevel|TestEscalationUsesCallback' -count=1 Proof: go test ./internal/alerts/... -count=1 Proof: go test ./internal/api -run Alert -count=1
26 lines
949 B
Go
26 lines
949 B
Go
package config_test
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
|
|
alerts "github.com/rcourtman/pulse-go-rewrite/internal/alerts"
|
|
alertconfig "github.com/rcourtman/pulse-go-rewrite/internal/alerts/config"
|
|
)
|
|
|
|
// TestTypeAliasIdentity verifies that alerts.AlertConfig and config.AlertConfig
|
|
// are the same underlying type via the type alias in config_facade.go.
|
|
func TestTypeAliasIdentity(t *testing.T) {
|
|
if reflect.TypeOf(alertconfig.AlertConfig{}) != reflect.TypeOf(alerts.AlertConfig{}) {
|
|
t.Error("config.AlertConfig and alerts.AlertConfig must be the same type (type alias)")
|
|
}
|
|
|
|
if reflect.TypeOf(alertconfig.ThresholdConfig{}) != reflect.TypeOf(alerts.ThresholdConfig{}) {
|
|
t.Error("config.ThresholdConfig and alerts.ThresholdConfig must be the same type")
|
|
}
|
|
|
|
if reflect.TypeOf(alertconfig.AlertLevelWarning) != reflect.TypeOf(alerts.AlertLevelWarning) {
|
|
t.Error("config.AlertLevelWarning and alerts.AlertLevelWarning must be the same type")
|
|
}
|
|
}
|