-
Notifications
You must be signed in to change notification settings - Fork 0
Notification Rule Processing Engine #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: notification-rule-baseline
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛑 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔷 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: