Skip to content

Commit

Permalink
fix the logic aruodn remaining conditions / evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
saponifi3d committed Jan 30, 2025
1 parent 5561b44 commit df05a43
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/sentry/workflow_engine/processors/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ def evaluate_workflow_triggers(workflows: set[Workflow], job: WorkflowJob) -> se

for workflow in workflows:
evaluation, remaining_conditions = workflow.evaluate_trigger_conditions(job)
if evaluation:
if remaining_conditions:
workflows_to_enqueue.add(workflow)
else:
if remaining_conditions:
workflows_to_enqueue.add(workflow)
else:
if evaluation:
# Only add workflows that have no remaining conditions to check
triggered_workflows.add(workflow)

Expand All @@ -108,13 +108,13 @@ def evaluate_workflows_action_filters(
for action_condition in action_conditions:
evaluation, result, remaining_conditions = evaluate_condition_group(action_condition, job)

if evaluation:
if remaining_conditions:
# If there are remaining conditions for the action filter to evaluate,
# then return the list of conditions to enqueue
enqueued_conditions.extend(remaining_conditions)
else:
# if we don't have any other conditions to evaluate, add the action to the list
if remaining_conditions:
# If there are remaining conditions for the action filter to evaluate,
# then return the list of conditions to enqueue
enqueued_conditions.extend(remaining_conditions)
else:
# if we don't have any other conditions to evaluate, add the action to the list
if evaluation:
filtered_action_groups.add(action_condition)

# get the actions for any of the triggered data condition groups
Expand Down

0 comments on commit df05a43

Please sign in to comment.