Skip to content

feat(workflows): start using the action filters cache#111817

Open
klochek wants to merge 2 commits intomasterfrom
christopherklochek/iswf-2325-start-using-the-cacheaction_filter-in
Open

feat(workflows): start using the action filters cache#111817
klochek wants to merge 2 commits intomasterfrom
christopherklochek/iswf-2325-start-using-the-cacheaction_filter-in

Conversation

@klochek
Copy link
Copy Markdown
Contributor

@klochek klochek commented Mar 30, 2026

No description provided.

@linear-code
Copy link
Copy Markdown

linear-code bot commented Mar 30, 2026

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 30, 2026
@klochek klochek force-pushed the christopherklochek/iswf-2325-start-using-the-cacheaction_filter-in branch from f476634 to 903ad94 Compare March 30, 2026 20:29
@klochek klochek marked this pull request as ready for review March 31, 2026 17:17
@klochek klochek requested a review from a team as a code owner March 31, 2026 17:17
Copy link
Copy Markdown
Contributor

@saponifi3d saponifi3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


action_conditions_to_workflow: dict[DataConditionGroup, Workflow] = {}

if features.has("organizations:workflow-engine-action-filters-cache", organization):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mind adding a test to the processing method to make sure that this is working as expected when it's enabled? (that should help guard against any rollout concerns and flipping the switch later. we would ideally be testing the majority of the logic in the tests for evaluating action filters)

@klochek klochek force-pushed the christopherklochek/iswf-2325-start-using-the-cacheaction_filter-in branch from f4003a9 to 16117e0 Compare April 1, 2026 15:33
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Backend Test Failures

Failures on bc98e54 in this run:

tests/sentry/workflow_engine/processors/test_workflow.py::TestTaintTracking::test_evaluate_workflows_action_filters_with_cachelog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/workflow_engine/processors/test_workflow.py:750: in test_evaluate_workflows_action_filters_with_cache
    self.test_action_filter_stats_from_trigger_result()
tests/sentry/workflow_engine/processors/test_workflow.py:705: in test_action_filter_stats_from_trigger_result
    assert stats == EvaluationStats(tainted=0, untainted=1)
E   AssertionError: assert EvaluationSta..., untainted=0) == EvaluationSta..., untainted=1)
E     
E     Omitting 1 identical items, use -vv to show
E     Differing attributes:
E     ['untainted']
E     
E     Drill down into differing attribute untainted:
E       untainted: 0 != 1
tests/sentry/workflow_engine/processors/test_workflow.py::TestEvaluateWorkflowActionFilters::test_evaluate_workflows_action_filters_with_cachelog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/workflow_engine/processors/test_workflow.py:1143: in test_evaluate_workflows_action_filters_with_cache
    self.test_with_slow_conditions()
tests/sentry/workflow_engine/processors/test_workflow.py:1050: in test_with_slow_conditions
    assert self.action_group.conditions.count() == 2
E   AssertionError: assert 4 == 2
E    +  where 4 = <bound method QuerySet.count of <django.db.models.fields.related_descriptors.create_reverse_many_to_one_manager.<locals>.RelatedManager object at 0x7f8d121a87d0>>()
E    +    where <bound method QuerySet.count of <django.db.models.fields.related_descriptors.create_reverse_many_to_one_manager.<locals>.RelatedManager object at 0x7f8d121a87d0>> = <django.db.models.fields.related_descriptors.create_reverse_many_to_one_manager.<locals>.RelatedManager object at 0x7f8d121a87d0>.count
E    +      where <django.db.models.fields.related_descriptors.create_reverse_many_to_one_manager.<locals>.RelatedManager object at 0x7f8d121a87d0> = <DataConditionGroup at 0x7f8d03eac440: id=119, logic_type=<Type.ALL: 'all'>>.conditions
E    +        where <DataConditionGroup at 0x7f8d03eac440: id=119, logic_type=<Type.ALL: 'all'>> = <tests.sentry.workflow_engine.processors.test_workflow.TestEvaluateWorkflowActionFilters testMethod=test_evaluate_workflows_action_filters_with_cache>.action_group

@klochek klochek force-pushed the christopherklochek/iswf-2325-start-using-the-cacheaction_filter-in branch from 16117e0 to 26f1b57 Compare April 1, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants