Kimi K3.1 Pro · Heavy

notification-rule-processing-engine-grafana-codex

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

The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. Judge: Claude Haiku 5.5.

Gold bugs found
3 of 4
Comments published
8
Comments matching a bug
3
Comments not matching
5
Cost of this PR
$3.245

Published comments (8)

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

Grafana recording rules incorrectly lose export support — Users cannot export Grafana recording rules from the prom-only list, although `RuleFormType.grafanaRecording` is supported. Change `ModifyExport` to use `prometheusRuleType.grafana.rule(rule)` with `exportAllowed`, retaining alerting-only guards for actions that need them.

mediumbugpublic/app/features/alerting/unified/components/rules/RulesTable.test.tsx:23-26

Singular Grafana ability mocks cannot control AlertRuleMenu — Mocking `useGrafanaPromRuleAbility` cannot change the abilities rendered by `AlertRuleMenu`, which consumes `useGrafanaPromRuleAbilities`, making the new guidance and mocks misleading. Remove the singular-hook recommendation and mock the plural hook instead.

mediumbugpublic/app/features/alerting/unified/rule-list/GrafanaGroupLoader.test.tsx:92-101

More button test never opens or verifies the action menu — The test would still pass if `AlertRuleMenu` lost every action or the More button never opened it. Click `moreButton` and assert the silence, copy-link, duplicate, and export menu items, or rename the test to cover trigger rendering only.

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

Skipped Grafana-prom rules can incorrectly enable Duplicate — For cloud rules, `skipToken` becomes an undefined `rule`, so `Duplicate` falls back to `rulesPermissions.create`; `canDuplicate` in `AlertRuleMenu.tsx` can then allow duplication despite the ruler ability forbidding it. Return `NotSupported` with `false` when `rule` is absent, or make both Grafana wrappers neutral for `skipToken`. **Also found in:** - `public/app/features/alerting/unified/hooks/useAbilities.ts:397-405`

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

CombinedRule adapter drops federated-group immutability checks — Federated rules can now expose update, delete, pause, restore, and permanent-delete as supported because this `CombinedRule` delegation drops `rule.group` and the delegated hook hard-codes `isFederated` to false. Preserve the federated-group check in the adapter or pass it into `useAllRulerRuleAbilities`. **Also found in:** - `public/app/features/alerting/unified/hooks/useAbilities.ts:242-245`

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

Prom-only Grafana rules hide Delete despite delete permission — Users with delete permission still see no Delete action for prom-only Grafana rules because `GrafanaRuleListItem` supplies no `rulerRule`, even when `canDelete` is true. Allow the Delete item to use the prom-rule identifier instead of requiring `rulerRule`.

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

Prom-only rule silence action does not open a drawer — Clicking Silence notifications for a prom-only rule only sets `showSilenceDrawer`; `RuleActionsButtons.V2` renders `SilenceGrafanaRuleDrawer` only after `rulerRuleType.grafana.alertingRule(rule)` succeeds, but receives no `rule` here. Add a prom-rule drawer path or hide the silence action for this caller.

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

Missing key reconciles Grafana rule rows by position — Without `key`, React reconciles these stateful `GrafanaRuleListItem` rows by position, so delete, silence, or clone state can attach to a different rule as asynchronous results arrive. Restore `key={key}` to preserve rule identity.

Gold bugs found (3)

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