OLS-1188: Add the ability to attach Alert Rules and Silences to the prompt#1941
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
1 similar comment
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughThe PR extends the plugin to support two new monitoring resource attachments: Alertmanager Silence (detected via /monitoring/silences/{uuid}) and Alerting Rule (detected via /monitoring/alertrules/{hash}). It adds URL pattern detection, YAML fetching from APIs, validation helpers, UI strings, and tests for the new validators and rule-hash function. ChangesSilence and Alerting Rule Attachment Support
Sequence DiagramsequenceDiagram
participant User
participant Browser as Prompt Component
participant Router as URL Router
participant Context as useLocationContext
participant AlertMgr as Alertmanager API
participant Prometheus as Prometheus API
User->>Router: Navigate to /monitoring/silences/{uuid}
Router->>Context: URL change detected
Context->>Context: Parse URL, validate silence UUID
Context->>Browser: Update context state (kind='Silence', name=uuid)
User->>Browser: Click "Attach" → Select "Silence"
Browser->>AlertMgr: Fetch silence details GET /api/v2/silences/{uuid}
AlertMgr-->>Browser: Silence JSON response
Browser->>Browser: Convert to YAML
Browser->>Browser: Attach to message
User->>Router: Navigate to /monitoring/alertrules/{hash}
Router->>Context: URL change detected
Context->>Context: Parse URL, set alerting rule context
Context->>Browser: Update context state (kind='AlertingRule', name=hash)
User->>Browser: Click "Attach" → Select "Alerting Rule"
Browser->>Prometheus: Fetch alerting rules GET /api/v1/rules
Prometheus-->>Browser: Rules list response
Browser->>Browser: Find rule matching hash (via alertingRuleID)
Browser->>Browser: Convert rule to YAML
Browser->>Browser: Attach to message
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
558b765 to
7bd419e
Compare
|
Rebased |
|
/retest |
|
/lgtm |
|
Override test failure unrelated to this change: |
|
@kyoto: Overrode contexts on behalf of kyoto: Red Hat Konflux / e2e-console-pf6 / lightspeed-console DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Summary by CodeRabbit