Alerting: Keep the latest version of deleted rule in version table (#101481)

* add feature toggle alertRuleRestore
* Update delete rule to require UserUID, remove all versions and create "delete" version that holds information about who and when deleted the rule
This commit is contained in:
Yuri Tseretyan
2025-03-05 09:15:26 -05:00
committed by GitHub
parent da2c382d80
commit 374380d1f6
16 changed files with 215 additions and 39 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ func TestRouteDeleteAlertRules(t *testing.T) {
deleteCommands := getRecordedCommand(ruleStore)
require.Len(t, deleteCommands, 1)
cmd := deleteCommands[0]
actualUIDs := cmd.Params[1].([]string)
actualUIDs := cmd.Params[2].([]string)
require.Len(t, actualUIDs, len(expectedRules))
for _, rule := range expectedRules {
require.Containsf(t, actualUIDs, rule.UID, "Rule %s was expected to be deleted but it wasn't", rule.UID)