Alerting: Update alerting module + refactor (#111761)

* update alerting module
* replace compat with ones from alerting
* update type references Receiver and Integration to *Status
* update route in provisioning test that is invalid after recent change
* use right type for LINE ingtegration
This commit is contained in:
Yuri Tseretyan
2025-10-03 10:37:49 -04:00
committed by GitHub
parent cca9e0d55f
commit d0f79ee60d
25 changed files with 139 additions and 297 deletions
@@ -14,8 +14,7 @@ import (
"testing"
"time"
alertingNotify "github.com/grafana/alerting/notify"
"github.com/grafana/alerting/receivers/schema"
"github.com/grafana/alerting/notify/notifytest"
prometheus "github.com/prometheus/alertmanager/config"
"github.com/prometheus/alertmanager/pkg/labels"
"github.com/prometheus/alertmanager/timeinterval"
@@ -2033,12 +2032,12 @@ func TestApiContactPointExportSnapshot(t *testing.T) {
t.Run(fmt.Sprintf("exportType=%s", exportType), func(t *testing.T) {
for _, redacted := range []bool{true, false} {
t.Run(fmt.Sprintf("redacted=%t", redacted), func(t *testing.T) {
allIntegrations := make([]models.Integration, 0, len(alertingNotify.AllKnownConfigsForTesting))
for integrationType := range alertingNotify.AllKnownConfigsForTesting {
allIntegrations := make([]models.Integration, 0, len(notifytest.AllKnownV1ConfigsForTesting))
for integrationType := range notifytest.AllKnownV1ConfigsForTesting {
integration := models.IntegrationGen(
models.IntegrationMuts.WithName(allIntegrationsName),
models.IntegrationMuts.WithUID(fmt.Sprintf("%s-uid", integrationType)),
models.IntegrationMuts.WithValidConfig(schema.IntegrationType(integrationType)),
models.IntegrationMuts.WithUID(fmt.Sprintf("%s-uid", strings.ToLower(string(integrationType)))),
models.IntegrationMuts.WithValidConfig(integrationType),
)()
integration.DisableResolveMessage = redacted
allIntegrations = append(allIntegrations, integration)