Alerting: Update grafana/alerting to 8eef376f49f8 (#108190)

Update grafana/alerting to 8eef376f49f8

Includes support for OAuth2 in most notifiers but does not enable that support
yet in FE. Fixes tests related to the change.
pull/108191/head
Matthew Jacobson 4 days ago committed by GitHub
parent 7a88a64121
commit 2444fb1caf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      go.mod
  2. 4
      go.sum
  3. 25
      pkg/services/ngalert/api/compat_contact_points_test.go
  4. 10
      pkg/services/ngalert/provisioning/contactpoints_test.go

@ -85,7 +85,7 @@ require (
github.com/googleapis/gax-go/v2 v2.14.2 // @grafana/grafana-backend-group
github.com/gorilla/mux v1.8.1 // @grafana/grafana-backend-group
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // @grafana/grafana-app-platform-squad
github.com/grafana/alerting v0.0.0-20250709204613-c5c6f9c1653d // @grafana/alerting-backend
github.com/grafana/alerting v0.0.0-20250711181610-8eef376f49f8 // @grafana/alerting-backend
github.com/grafana/authlib v0.0.0-20250710201142-9542f2f28d43 // @grafana/identity-access-team
github.com/grafana/authlib/types v0.0.0-20250710201142-9542f2f28d43 // @grafana/identity-access-team
github.com/grafana/dataplane/examples v0.0.1 // @grafana/observability-metrics

@ -1571,8 +1571,8 @@ github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7Fsg
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo=
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA=
github.com/grafana/alerting v0.0.0-20250709204613-c5c6f9c1653d h1:rtlYpwsE3KDWWCg2kytDw3s5qgpDjG87qh1IixAyNz4=
github.com/grafana/alerting v0.0.0-20250709204613-c5c6f9c1653d/go.mod h1:gtR7agmxVfJOmNKV/n2ZULgOYTYNL+PDKYB5N48tQ7Q=
github.com/grafana/alerting v0.0.0-20250711181610-8eef376f49f8 h1:XUfln7L8Lz1E+gWU3Zz9+H+qIIqsBEls57vZmokoQog=
github.com/grafana/alerting v0.0.0-20250711181610-8eef376f49f8/go.mod h1:gtR7agmxVfJOmNKV/n2ZULgOYTYNL+PDKYB5N48tQ7Q=
github.com/grafana/authlib v0.0.0-20250710201142-9542f2f28d43 h1:vVPT0i5Y1vI6qzecYStV2yk7cHKrC3Pc7AgvwT5KydQ=
github.com/grafana/authlib v0.0.0-20250710201142-9542f2f28d43/go.mod h1:1fWkOiL+m32NBgRHZtlZGz2ji868tPZACYbqP3nBRJI=
github.com/grafana/authlib/types v0.0.0-20250710201142-9542f2f28d43 h1:NlkGMnVi/oUn6Cr90QbJYpQJ4FnjyAIG9Ex5GtTZIzw=

@ -79,11 +79,26 @@ func TestContactPointFromContactPointExports(t *testing.T) {
})
require.NoError(t, err)
diff := cmp.Diff(expected, actual, cmp.FilterPath(func(path cmp.Path) bool {
return strings.Contains(path.String(), "Metadata.UID") ||
strings.Contains(path.String(), "Metadata.Name") ||
strings.Contains(path.String(), "WecomConfigs.Settings.EndpointURL") // This field is not exposed to user
}, cmp.Ignore()))
pathFilters := []string{
"Metadata.UID",
"Metadata.Name",
"WecomConfigs.Settings.EndpointURL", // This field is not exposed to user
}
if integrationType != "webhook" {
// Many notifiers now support HTTPClientConfig but only Webhook currently has it enabled in schema.
//TODO: Remove this once HTTPClientConfig is added to other schemas.
pathFilters = append(pathFilters, "HTTPClientConfig")
}
pathFilter := cmp.FilterPath(func(path cmp.Path) bool {
for _, filter := range pathFilters {
if strings.Contains(path.String(), filter) {
return true
}
}
return false
}, cmp.Ignore())
diff := cmp.Diff(expected, actual, pathFilter)
if len(diff) != 0 {
require.Failf(t, "The re-marshalled configuration does not match the expected one", diff)
}

@ -435,13 +435,11 @@ func TestRemoveSecretsForContactPoint(t *testing.T) {
keys := maps.Keys(configs)
slices.Sort(keys)
for _, integrationType := range keys {
cfg := configs[integrationType]
var settings map[string]any
require.NoError(t, json.Unmarshal([]byte(cfg.Config), &settings))
integration := models.IntegrationGen(models.IntegrationMuts.WithValidConfig(integrationType))()
if f, ok := overrides[integrationType]; ok {
f(settings)
f(integration.Settings)
}
settingsRaw, err := json.Marshal(settings)
settingsRaw, err := json.Marshal(integration.Settings)
require.NoError(t, err)
expectedFields, err := channels_config.GetSecretKeysForContactPointType(integrationType)
@ -460,7 +458,7 @@ func TestRemoveSecretsForContactPoint(t *testing.T) {
for _, field := range expectedFields {
assert.Contains(t, secureFields, field)
path := strings.Split(field, ".")
var expectedValue any = settings
var expectedValue any = integration.Settings
for _, segment := range path {
v, ok := expectedValue.(map[string]any)
if !ok {

Loading…
Cancel
Save