Alerting: Persist rule position in the group (#50051)
Migrations: * add a new column alert_group_idx to alert_rule table * add a new column alert_group_idx to alert_rule_version table * re-index existing rules during migration API: * set group index on update. Use the natural order of items in the array as group index * sort rules in the group on GET * update the version of all rules of all affected groups. This will make optimistic lock work in the case of multiple concurrent request touching the same groups. UI: * update UI to keep the order of alerts in a group
This commit is contained in:
@@ -177,6 +177,7 @@ func validateRuleGroup(
|
||||
}
|
||||
uids[rule.UID] = idx
|
||||
}
|
||||
rule.RuleGroupIndex = idx + 1
|
||||
result = append(result, rule)
|
||||
}
|
||||
return result, nil
|
||||
|
||||
Reference in New Issue
Block a user