GLM-5.3 · 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
- 9
- Comments matching a bug
- 3
- Comments not matching
- 6
- Cost of this PR
- $3.003
Published comments (9)
Delete and Pause actions silently dropped when only promRule is provided — Grafana rules in the new list view lose Delete and Pause even though `showDeleteModal` only needs the identifier, because AlertRuleMenu gates both items on `rulerRule`. Gate them on the prom-rule abilities and `identifier` instead.
Silence action is a no-op: drawer requires a ruler rule that is never passed — Clicking Silence sets `showSilenceDrawer` but renders nothing: the drawer mounts only when `rulerRuleType.grafana.alertingRule(rule)` is truthy, and this call site passes only `promRule`. Render a prom-rule-based silence drawer or hide the menu item when no drawer can render.
Federated rules wrongly shown as editable: federated check dropped in delegation — Federated Mimir rules now expose Edit, Delete, Pause, Restore and Duplicate because `useAllAlertRuleAbilities` delegates to `useAllRulerRuleAbilities`, which hardcodes `isFederated` to `false` instead of computing `isFederatedRuleGroup(rule.group)`. Restore the check before delegating. **Also found in:** - `public/app/features/alerting/unified/hooks/useAbilities.ts:243-245`
skipToken does not skip: undefined rule still yields supported abilities — Cloud rules show a Duplicate item gated only by Grafana create permission, bypassing the datasource-scoped check, because the `skipToken` path still computes `MaybeSupported` as `AlwaysSupported`. Return `NotSupported` for every action when `rule` is undefined.
Menu actions test grants delete permission but never asserts the Delete item — The test grants delete permission but never asserts Delete, so it passes with the action missing. Either assert Delete and fix the `rulerRule` gate in AlertRuleMenu, or drop the delete permission and rename the test.
Undefined rule (skipToken) yields enabled Duplicate ability instead of disabled — With `rule` undefined, `loading` is false so `MaybeSupported` becomes `AlwaysSupported`, letting AlertRuleMenu's OR show Duplicate on cloud rules with only `AlertingRuleCreate`. Early-return `NotSupported` for every action on the skip path.
Dropped federated rule group check makes federated rules editable/deletable — Federated Mimir rule groups now evaluate as editable and deletable for every `useAllAlertRuleAbilities` consumer because the delegation to `useAllRulerRuleAbilities` hardcodes `isFederated` to `false`. Restore `isFederatedRuleGroup(rule.group)` in the wrapper.
Federated Mimir rule groups incorrectly shown as editable/removable after refactor — Federated Mimir rules now offer Update, Delete, Pause, Restore and DeletePermanently because the delegation to `useAllRulerRuleAbilities` hardcodes `isFederated` to `false`. Pass a federated flag or keep `isFederatedRuleGroup(rule.group)` in the wrapper until real support lands.
Delegation to useAllRulerRuleAbilities drops federated-rule immutability check — Read-only federated Mimir rules now report Update, Delete and Pause as supported to every `useAlertRuleAbility` consumer because `useAllRulerRuleAbilities` hardcodes `isFederated` to `false`. Pass a federated flag derived from the combined rule's group into `useAllRulerRuleAbilities`.