Alerting: Remove the POST endpoint for the internal Grafana Alertmanager config (#103819)

* Remove POST config for Grafana Alertmanager

* Delete auth + test for removed path

* Alerting: Remove check for `alertingApiServer` toggle in UI (#103805)

* Remove check for alertingApiServer in UI

* Update tests to no longer care about alertingApiServer

* Add contact points handlers now that we use alertingApiServer all the time

* Fix test broken from removing camelCase for UIDs

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
This commit is contained in:
William Wernert
2025-04-11 17:38:53 -04:00
committed by GitHub
parent c47ab101d1
commit a5288db624
50 changed files with 689 additions and 1930 deletions
+1 -27
View File
@@ -3288,7 +3288,7 @@ func TestIntegrationAlertRuleCRUD(t *testing.T) {
"intervalSeconds":60,
"is_paused": false,
"version":1,
"uid":"uid",
"uid":"uid",
"guid": "guid",
"namespace_uid":"nsuid",
"rule_group":"arulegroup",
@@ -4451,32 +4451,6 @@ func TestIntegrationRuleNotificationSettings(t *testing.T) {
t.Log(body)
})
t.Run("create with '...' groupBy followed by config post should succeed", func(t *testing.T) {
var copyD testData
err = json.Unmarshal(testDataRaw, &copyD)
group := copyD.RuleGroup
ns := group.Rules[0].GrafanaManagedAlert.NotificationSettings
ns.GroupBy = []string{ngmodels.FolderTitleLabel, model.AlertNameLabel, ngmodels.GroupByAll}
_, status, body := apiClient.PostRulesGroupWithStatus(t, folder, &group, false)
require.Equalf(t, http.StatusAccepted, status, body)
// Now update the config with no changes.
_, status, body = apiClient.GetAlertmanagerConfigWithStatus(t)
if !assert.Equalf(t, http.StatusOK, status, body) {
return
}
cfg := apimodels.PostableUserConfig{}
err = json.Unmarshal([]byte(body), &cfg)
require.NoError(t, err)
ok, err := apiClient.PostConfiguration(t, cfg)
require.NoError(t, err)
require.True(t, ok)
})
t.Run("should create rule and generate route", func(t *testing.T) {
_, status, body := apiClient.PostRulesGroupWithStatus(t, folder, &d.RuleGroup, false)
require.Equalf(t, http.StatusAccepted, status, body)