Kimi K3.1 Pro · Balanced

notification-rule-processing-engine-grafana-codex

Grafana · Go · L · 300–799 lines · 6 files

The normal review, with one generalist agent. Judge: Claude Haiku 5.5.

Gold bugs found
4 of 4
Comments published
7
Comments matching a bug
4
Comments not matching
3
Cost of this PR
$1.335

Published comments (7)

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

Delegating with only `rule.rulerRule` and a group identifier drops `rule.group.source_tenants`… — Preserve the federated-group check when delegating, or pass an explicit federated/immutable flag into `useAllRulerRuleAbilities`.

mediumbugpublic/app/features/alerting/unified/hooks/useAbilities.ts:309-318

skipToken can grant Duplicate using Grafana rule-create permission — When `useGrafanaPromRuleAbilities` receives `skipToken`, it converts that to `undefined`, but this code still makes Duplicate supported and checks the Grafana rule-create permission; `AlertRuleMenu` then ORs it into non-Grafana rules and can show Duplicate without the required external-rule permission. Return neutral `[false, false]` abilities for the skip/undefined case, at least for Duplicate, instead of treating an absent rule as always supported.

mediumbugpublic/app/features/alerting/unified/components/rule-viewer/AlertRuleMenu.tsx:94-96

Silence notifications does nothing for prom-only Grafana rules — A prom-only Grafana rule can now enable Silence notifications, but clicking it only sets `showSilenceDrawer`; `RuleActionsButtons.V2.tsx` still renders that drawer exclusively when `rulerRuleType.grafana.alertingRule(rule)` matches a ruler rule that this list no longer supplies, so nothing opens. Let the silence drawer accept the prom rule UID (the only ruler field it currently consumes) or otherwise provide a prom-based silence handler.

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

Prom-only Grafana rules hide Delete despite delete permission — The prom-based ability can make `canDelete` true, but the delete menu still has the separate `rulerRule` guard at line 165, so every prom-only Grafana rule in the new list loses its Delete action even for permitted users. Render Delete from the editable identifier/callback without requiring a ruler DTO, as `RuleActionsButtons.V2` already constructs that identifier from `promRule`.

mediumbugpublic/app/features/alerting/unified/components/rule-viewer/AlertRuleMenu.tsx:81-83

Pause remains hidden for Grafana list rules without a ruler rule — The prom-based ability can make `canPause` true, but the sole pause renderer at lines 123-125 still requires a Grafana `rulerRule`, which `GrafanaRuleListItem` never passes, so Pause disappears from the new Grafana list views. Provide a prom-rule/UID-based pause action or lazily obtain the ruler rule only when this action is invoked.

mediumbugpublic/app/features/alerting/unified/hooks/useAbilities.ts:324

ModifyExport excludes prom-only Grafana recording rules — Base ModifyExport support on `prometheusRuleType.grafana.rule(rule)` rather than the alerting-rule narrowing.

mediumbugpublic/app/features/alerting/unified/rule-list/FilterView.tsx:157-162

Grafana rule items lack keys, so UI state can follow the wrong rule — The Grafana branch no longer passes the computed `key`, unlike the sibling branches, so React reconciles these stateful rule/action components by position and can associate open menus, drawers, or modal state with a different rule when filtered results change. Restore `key={key}` on `GrafanaRuleListItem`.

Gold bugs found (4)

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.
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.
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 (0)

None.