@@ -428,10 +428,11 @@ def evaluate(
428
428
# TODO ensure this is not a duplicate packet or reprocessing
429
429
430
430
value = self .extract_value (data_packet )
431
- condition_evaluation , new_priority = self ._evaluation_detector_conditions (value )
431
+ is_condition_group_met , new_priority = self ._evaluation_detector_conditions (value )
432
432
state = self .state_manager .get_state_data ([None ])[None ]
433
433
434
- if not condition_evaluation or state .status == new_priority :
434
+ is_status_changed = state .status != new_priority
435
+ if not is_condition_group_met or not is_status_changed :
435
436
# If the condition is not met or the status is not the same, nothing to do.
436
437
return None
437
438
@@ -448,10 +449,10 @@ def evaluate(
448
449
self .state_manager .enqueue_counter_reset ()
449
450
else :
450
451
detector_occurrence , event_data = self .create_occurrence (
451
- condition_evaluation , data_packet , new_priority
452
+ is_condition_group_met , data_packet , new_priority
452
453
)
453
454
detector_result = self ._create_decorated_issue_occurrence (
454
- detector_occurrence , condition_evaluation , new_priority
455
+ detector_occurrence , is_condition_group_met , new_priority
455
456
)
456
457
457
458
return {
@@ -535,15 +536,16 @@ def evaluate_group_key_value(
535
536
metrics .incr ("workflow_engine.detector.skipping_invalid_condition_group" )
536
537
return None
537
538
538
- new_status = DetectorPriorityLevel .OK
539
- is_condition_group_met , new_status = self ._evaluation_detector_conditions (value )
539
+ new_priority = DetectorPriorityLevel .OK
540
+ is_condition_group_met , new_priority = self ._evaluation_detector_conditions (value )
541
+ is_status_changed = state_data .status != new_priority
540
542
541
- if state_data . status == new_status or not is_condition_group_met :
543
+ if not is_status_changed or not is_condition_group_met :
542
544
return None
543
545
544
546
# Update the counter for the new status
545
547
updated_threshold_count = self ._increment_detector_thresholds (
546
- state_data , new_status , group_key
548
+ state_data , new_priority , group_key
547
549
)
548
550
549
551
breached_threshold = self ._has_breached_threshold (updated_threshold_count )
0 commit comments