Amazon Ergo 1.0 · 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 Opus 5.5.

Gold bugs found
6 of 6
Comments published
9
Comments matching a bug
6
Comments not matching
3
Cost of this PR
$4.020

Published comments (9)

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

Grafana recording rules lose the Export action — Recording rules silently lose a valid, rule-type-agnostic action because `isAlertingRule` is false for them. Gate `ModifyExport` with `prometheusRuleType.grafana.rule(rule)` or `isGrafanaManagedAlertRule`, and keep `isAlertingRule` for pause/silence actions.

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

Prom-only rules with delete permission still hide the Delete action — Users with delete permission still cannot act because the menu requires `rulerRule`, which the prom-only list does not supply. Rework the Delete item and `handleDelete` to use the prom rule or editable identifier, or keep passing `rulerRule`.

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

Pause/Resume menu item is hidden when the list supplies only promRule — The prom-based pause ability is dead in the list because rendering still requires `rulerRuleType.grafana.rule(rulerRule)`. Render through the prom-rule path with a handler that does not need `rulerRule`, or keep supplying it.

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

Silence menu item enabled in prom-only list with no drawer flow — Clicking the item only toggles state: `RuleActionsButtons` mounts `SilenceGrafanaRuleDrawer` only for a Grafana ruler alerting rule, so no drawer opens. Add a prom-rule-compatible silence flow or keep `canSilence` false until `rulerRule` is available.

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

Federated rules lose immutability in useAllAlertRuleAbilities — Federated rules can now be treated as editable, deletable, and pausable because `useAllRulerRuleAbilities` hardcodes `isFederated = false`, bypassing the old `isFederatedRuleGroup` check. Preserve federation in `useAllAlertRuleAbilities` or pass it into `useAllRulerRuleAbilities` so those abilities remain `NotSupported`. **Also found in:** - `public/app/features/alerting/unified/hooks/useAbilities.ts:243-245`

highbugpublic/app/features/alerting/unified/hooks/useAbilities.ts:308-318

Undefined rule path grants Duplicate from Grafana permissions — Cloud and data-source rules can inherit Grafana's `AlertingRuleCreate` permission because the undefined-rule path builds a supported Duplicate ability. Make `useAllGrafanaPromRuleAbilities` return `NotSupported` for every ability when `rule` is absent, or map `skipToken` to `[false, false]`. **Also found in:** - `public/app/features/alerting/unified/hooks/useAbilities.ts:309-319`

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

Grafana rule list items are rendered without a stable React key — Filtering or polling can make React reuse row state for the wrong rule. Add `key={key}` to `GrafanaRuleListItem` so each row keeps its identity.

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

More button test claims menu coverage but never opens the menu — The test can pass even if every menu option breaks, so its name overstates the regression protection. Rename it to describe the button checks, or click `moreButton` and assert the menu items.

mediumbugpublic/app/features/alerting/unified/rule-list/GrafanaGroupLoader.test.tsx:159-165

Edit absence is asserted before folder permissions finish loading — The test can pass even when folder access control is ignored, since `useIsGrafanaPromRuleEditable` returns `isEditable: false` while `useFolder` loads. Open the menu and await a permission-dependent item before asserting `ui.editButton()` is absent.

Gold bugs found (6)

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

None.