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)
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.
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`.
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.
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.
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`
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`
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.
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.
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)
Gold bugs missed (0)
None.