Amazon Ergo 1.0 · Balanced
notification-rule-processing-engine-grafana-codex
Grafana · Go · L · 300–799 lines · 6 files
The normal review, with one generalist agent. Judge: Claude Opus 5.5.
- Gold bugs found
- 5 of 6
- Comments published
- 5
- Comments matching a bug
- 5
- Comments not matching
- 0
- Cost of this PR
- $2.666
Published comments (5)
Recording rules lose export and pause actions in Prom-only list — Gate `ModifyExport`, `Pause`, and `Restore` on `prometheusRuleType.grafana.rule(rule)`; keep only `Silence` alerting-rule-only.
Delete action stays hidden for Grafana rules in ruler-less alert list — Users with delete permission cannot see Delete for Grafana rules in the new alert list because `AlertRuleMenu` still requires `rulerRule`, which this path never provides. Render the item from `canDelete` alone, dropping the `rulerRule` requirement.
Silence action is a no-op for prom-only Grafana rules — Clicking Silence does nothing for every Grafana rule in the new list: `showSilenceDrawer` is set, but `RuleActionsButtons.V2.tsx` renders `SilenceGrafanaRuleDrawer` only for a ruler alerting rule. Update that condition to support the prom-only `promRule` path.
Federated Mimir rules lose immutability in alert rule abilities — Federated Mimir rules can now expose edit/delete actions despite being read-only because `useAllRulerRuleAbilities` hardcodes `isFederated = false`. Restore the `isFederatedRuleGroup(rule.group)` check in `useAllAlertRuleAbilities`, or pass the federated state into `useAllRulerRuleAbilities`.
skipToken still evaluates abilities for an undefined rule — A user with Grafana alert-rule create permission can see `Duplicate` on Mimir/cloud rules even when the ruler ability denies it, because `useAllGrafanaPromRuleAbilities(undefined)` still grants it and `AlertRuleMenu` ORs the results. Return `NotSupported`/`false` for every ability when the rule is undefined, or short-circuit the `useGrafanaPromRuleAbility(ies)` wrappers for `skipToken`.