feat(workflow_engine): Add in hook for producing occurrences from the stateful detector#1
Conversation
… stateful detector (#80168) This adds a hook that can be implemented to produce an occurrence specific to the detector that is subclassing the StatefulDetector. Also change the signature of evaluate to return a dict keyed by groupkey instead of a list. This helps avoid the chance of duplicate results for the same group key. <!-- Describe your PR here. -->
|
@CodeAnt-AI: review |
|
CodeAnt AI is running the review. |
Sequence DiagramShows the core change where stateful detectors return group-keyed results and can build IssueOccurrences; the processor then converts those results into produced occurrences (Kafka). This captures the main success path introduced in the PR. sequenceDiagram
participant DataPacket
participant Processor as process_detectors
participant DetectorModel as Detector
participant Handler as StatefulDetectorHandler
participant IssueProducer as produce_occurrence_to_kafka
DataPacket->>Processor: process_detectors(data_packet, [detector])
Processor->>DetectorModel: get detector.detector_handler
Processor->>Handler: evaluate(data_packet) -- returns dict[group_key -> DetectorEvaluationResult]
Handler-->>Processor: dict of DetectorEvaluationResult (includes IssueOccurrence + event_data for new issues)
Processor->>IssueProducer: create_issue_occurrence_from_result -> produce_occurrence_to_kafka (OCCURRENCE, occurrence, event_data)
Generated by CodeAnt AI |
Nitpicks 🔍
|
|
CodeAnt AI finished running the review. |
User description
Test 10
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.
Replicated from ai-code-review-evaluation/sentry-coderabbit#10
CodeAnt-AI Description
Produce issue occurrences from stateful detectors and return results keyed by group
What Changed
Impact
✅ Issues emitted as occurrences to Kafka when detectors fire✅ Fewer duplicate detector results for the same group key✅ Deterministic group type resolution for detectors💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.