Notification Rule Processing Engine#10
Conversation
* wip * Add working actions for GMA rules based on Prom-only API * Remove Ruler-loader related code for Grafana rules Co-authored-by: Sonia Augilar <sonia.aguilar@grafana.com> * Remove outdated tests * add some comments * remove commented code * remove showLocation property * Add missing mocks in tests * Add showLocation to GrafanaRuleListItem, improve useAbilities, address PR feedback * Enhance GrafanaGroupLoader tests: Add permission checks and More button functionality - Introduced user permission grants for alerting actions in tests. - Added tests for rendering the More button with action menu options. - Verified that each rule has its own action buttons and handles permissions correctly. - Ensured the edit button is not rendered when user lacks edit permissions. - Confirmed the correct menu actions are displayed when the More button is clicked. * Update translations --------- Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com> Co-authored-by: Sonia Augilar <sonia.aguilar@grafana.com>
Codoki PR ReviewSummary: URL-encode UID in link, prevent malformed paths Issues (Critical & High only)
Showing top 1 issues. Critical: 1, High: 0. See inline suggestions for more. Key Feedback (click to expand)
Confidence: 2/5 — Not ready to merge (1 critical · status: Requires changes) React with 👍 or 👎 if you found this review useful. |
| loading, | ||
| }; | ||
| } | ||
|
|
There was a problem hiding this comment.
🛑 Critical: ctx is not defined in this scope, which will cause a compile-time error and break the build; use the existing access control service (e.g., contextSrv) or a dedicated hook to check folder permissions for Grafana-managed rules. Replace both permission checks to avoid runtime failures.
| import { contextSrv } from 'app/core/core'; | |
| const canEditGrafanaRules = contextSrv.hasPermissionInMetadata(rulesPermissions.update, folder); | |
| const canRemoveGrafanaRules = contextSrv.hasPermissionInMetadata(rulesPermissions.delete, folder); |
| rulesSource: GrafanaRulesSource, | ||
| group: groupIdentifier.groupName, | ||
| namespace: namespaceName, | ||
| href: createRelativeUrl(`/alerting/grafana/${uid}/view`), |
There was a problem hiding this comment.
🔷 Medium: UID is interpolated into the path without URL encoding; if a UID contains reserved characters, the link can break or route incorrectly. Encode the segment to ensure a valid, safe URL.
| href: createRelativeUrl(`/alerting/grafana/${uid}/view`), | |
| ```suggestion | |
| href: createRelativeUrl(`/alerting/grafana/${encodeURIComponent(uid)}/view`), |
Mirrors ai-code-review-evaluation#5 for like-for-like benchmarking.
notification-rule-baselinenotification-rule-enhancementsOriginal PR excerpt: