DeepSeek V4 Pro · Heavy

feat-workflow-engine-add-in-hook-for-producing-occurrences-from-the-stateful-det-sentry

Sentry · Python · S · 30–99 lines · 3 files

The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. Judge: Claude Opus 5.5.

Gold bugs found
2 of 2
Comments published
3
Comments matching a bug
2
Comments not matching
1
Cost of this PR
$0.886

Published comments (3)

highbugsrc/sentry/incidents/grouptype.py:11-12

MetricAlertDetectorHandler remains abstract and cannot be instantiated — `StatefulDetectorHandler` requires abstract members that `MetricAlertDetectorHandler` does not implement (`counter_names`, `get_dedupe_value`, `get_group_key_values`, `build_occurrence_and_event_data`), so instantiating it raises a `TypeError` when `Detector.detector_handler` builds the registered handler. Implement those methods or keep it as a concrete `DetectorHandler` until the abstraction is ready.

mediumbugtests/sentry/workflow_engine/processors/test_detector.py:244-275

build_mock_occurrence_and_event ignores its value parameter — The expected occurrence/event is identical no matter what value was passed to `build_occurrence_and_event_data`, so a wrong or missing `value` in `evaluate_group_key_value` would still pass. Make the mock occurrence/event depend on `value` (for example include it in `evidence_data` or the event payload) or explicitly assert the builder receives it.

mediumbugtests/sentry/workflow_engine/processors/test_detector.py:206-222

Test does not assert produce_occurrence_to_kafka call count — `assert_has_calls` does not enforce the total number of calls, so extra calls to `produce_occurrence_to_kafka` would go unnoticed. Also assert `mock_produce_occurrence_to_kafka.call_count == 2` or otherwise require an exact call list.

Gold bugs found (2)

highMetricAlertDetectorHandler subclasses StatefulDetectorHandler without implementing its abstract methods, so instantiating it for metric alert detectors raises TypeError where it previously returned an empty-result handler.
mediumThe mock occurrence builder ignores its value argument, so tests (e.g. group_2 expected with 6 while the packet carries 10) pass regardless of which value is passed to build_occurrence_and_event_data.

Gold bugs missed (0)

None.