Alerting: Provisioning API - Notification Policies (#46755)

* Base-line API for provisioning notification policies

* Wire API up, some simple tests

* Return provenance status through API

* Fix missing call

* Transactions

* Clarity in package dependencies

* Unify receivers in definitions

* Fix issue introduced by receiver change

* Drop unused internal test implementation

* FGAC hooks for provisioning routes

* Polish, swap names

* Asserting on number of exposed routes

* Don't bubble up updated object

* Integrate with new concurrency token feature in store

* Back out duplicated changes

* Remove redundant tests

* Regenerate and create unit tests for API layer

* Integration tests for auth

* Address linter errors

* Put route behind toggle

* Use alternative store API and fix feature toggle in tests

* Fixes, polish

* Fix whitespace

* Re-kick drone

* Rename services to provisioning
This commit is contained in:
Alexander Weaver
2022-04-05 16:48:51 -05:00
committed by GitHub
parent cb6124c921
commit dde0b93cf1
29 changed files with 1055 additions and 78 deletions

View File

@@ -49,7 +49,7 @@ func TestAlertManagerHash(t *testing.T) {
require.NoError(t, err)
require.Equal(t, configMD5, req.Result.ConfigurationHash)
newConfig, newConfigMD5 := "my-config-new", fmt.Sprintf("%x", md5.Sum([]byte("my-config-new")))
err = store.UpdateAlertManagerConfiguration(&models.SaveAlertmanagerConfigurationCmd{
err = store.UpdateAlertmanagerConfiguration(context.Background(), &models.SaveAlertmanagerConfigurationCmd{
AlertmanagerConfiguration: newConfig,
FetchedConfigurationHash: configMD5,
ConfigurationVersion: "v1",
@@ -71,7 +71,7 @@ func TestAlertManagerHash(t *testing.T) {
err := store.GetLatestAlertmanagerConfiguration(context.Background(), req)
require.NoError(t, err)
require.Equal(t, configMD5, req.Result.ConfigurationHash)
err = store.UpdateAlertManagerConfiguration(&models.SaveAlertmanagerConfigurationCmd{
err = store.UpdateAlertmanagerConfiguration(context.Background(), &models.SaveAlertmanagerConfigurationCmd{
AlertmanagerConfiguration: config,
FetchedConfigurationHash: "the-wrong-hash",
ConfigurationVersion: "v1",