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)

highbugpublic/app/features/alerting/unified/hooks/useAbilities.ts:323-326

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.

highbugpublic/app/features/alerting/unified/components/rule-viewer/AlertRuleMenu.tsx:85-87

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.

highbugpublic/app/features/alerting/unified/rule-list/GrafanaRuleListItem.tsx:47

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.

mediumbugpublic/app/features/alerting/unified/hooks/useAbilities.ts:221-228

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`.

mediumbugpublic/app/features/alerting/unified/hooks/useAbilities.ts:305-323

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`.

Gold bugs found (5)

highThe Delete menu item still requires a ruler rule, which list-view Grafana rules no longer provide, so users with delete permission lose the Delete action.
mediumWhen the Grafana prom-rule branch is skipped (datasource rules), useAllGrafanaPromRuleAbilities(undefined) still reports Duplicate as supported and allowed by Grafana create permission, and AlertRuleMenu ORs it with the ruler ability, so Duplicate appears on cloud rules even when the ruler check denies it.
mediumThe refactor of useAllAlertRuleAbilities into useAllRulerRuleAbilities drops the isFederatedRuleGroup check (isFederated is hardcoded false), so federated Mimir rules are reported as editable and deletable.
highThe Grafana prom-rule abilities gate Pause, Restore, Export and DeletePermanently on alertingRule(rule) while the comment claims it checks Grafana-managed rules, so Grafana recording rules lose these actions in the list view.
highFor list-view Grafana rules RuleActionsButtons gets only promRule, so the Silence menu item is shown but the silence drawer, still gated on a ruler alerting rule, never renders and clicking Silence does nothing.

Gold bugs missed (1)

highThe pause menu item is still gated on a Grafana ruler rule, but the list view now passes only the Prometheus rule, so Pause/Resume disappears for list-view rules even when the user may pause them.