Skip to content

feat(workflows): Make thresholds in prune_old_fire_history options#111575

Merged
kcons merged 2 commits intomasterfrom
kcons/optit
Mar 25, 2026
Merged

feat(workflows): Make thresholds in prune_old_fire_history options#111575
kcons merged 2 commits intomasterfrom
kcons/optit

Conversation

@kcons
Copy link
Member

@kcons kcons commented Mar 25, 2026

We plan on tweaking these values as necessary, might as well make them possible to tweak very quickly.

@kcons kcons requested review from a team as code owners March 25, 2026 21:57
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 25, 2026
Copy link
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, really like that we can ramp this as we go!

@override_options(
{
"workflow_engine.fire_history_cleanup.batch_size": 10,
"workflow_engine.fire_history_cleanup.time_limit_seconds": 5.0,
Copy link
Contributor

Choose a reason for hiding this comment

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

we should probably also have a test or modify this to override the time_limit_seconds as well.

@kcons kcons enabled auto-merge (squash) March 25, 2026 22:17
Copy link
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.

mock_metrics.incr.assert_called_once()
assert mock_metrics.incr.call_args.kwargs["amount"] >= 2

@patch("sentry.workflow_engine.tasks.cleanup.FIRE_HISTORY_BATCH_SIZE", 10)
Copy link
Contributor

Choose a reason for hiding this comment

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

Test missing time_limit_seconds override is fragile

Medium Severity

test_multiple_batches (and test_options_honored) only override batch_size but not time_limit_seconds. These tests rely on the default time_limit_seconds being large enough to complete all batches. Since the whole point of this PR is to make these values tweakable, if the default is ever lowered (e.g., to 0, which the doc comment says "prevents any batches from running"), these tests will silently break. The test_time_bounded_leaves_remaining_rows test correctly overrides both options — these tests need the same treatment.

Additional Locations (1)
Fix in Cursor Fix in Web

@kcons kcons merged commit 3348917 into master Mar 25, 2026
64 checks passed
@kcons kcons deleted the kcons/optit branch March 25, 2026 22:37
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.

2 participants