Skip to content

migration(workflow-engine): Delete malformed anomaly conditions - #124847

Open
sentry-junior[bot] wants to merge 8 commits into
masterfrom
junior/delete-malformed-anomaly-conditions
Open

sentry-junior[bot] wants to merge 8 commits into
masterfrom
junior/delete-malformed-anomaly-conditions

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Add a post-deployment data migration that deletes non-anomaly conditions from condition groups containing an anomaly detection condition. These mixed groups caused SENTRY-5TEK and can no longer be created after #122870.

The migration preserves anomaly conditions and valid static condition groups, and deletes matching rows in batches.

Refs SENTRY-5TEK and ISWF-3306.

via Kyle Consalus.

--

View Junior Session [Sentry]

Co-Authored-By: Kyle Consalus <kyle.consalus@sentry.io>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 17, 2026
@kcons
kcons marked this pull request as ready for review September 17, 2026 22:11
@kcons
kcons requested a review from a team as a code owner September 17, 2026 22:11
@github-actions

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/workflow_engine/migrations/0121_delete_malformed_anomaly_conditions.py

for 0121_delete_malformed_anomaly_conditions in workflow_engine

--
-- Raw Python operation
--
-- THIS OPERATION CANNOT BE WRITTEN AS SQL

@linear-code

linear-code Bot commented Sep 17, 2026

Copy link
Copy Markdown

ISWF-3306

@kcons

kcons commented Sep 17, 2026

Copy link
Copy Markdown
Member

FWIW, our previous, fairly similar cleanup seemed to run cleanly.

Comment thread src/sentry/workflow_engine/migrations/0121_delete_malformed_anomaly_conditions.py Outdated
Comment thread src/sentry/workflow_engine/migrations/0121_delete_malformed_anomaly_conditions.py Outdated
Comment thread src/sentry/workflow_engine/migrations/0121_delete_malformed_anomaly_conditions.py Outdated
Comment thread src/sentry/workflow_engine/migrations/0121_delete_malformed_anomaly_conditions.py Outdated

@cursor cursor Bot left a comment

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.

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.

Reviewed by Cursor Bugbot for commit 0d7f892. Configure here.

Comment thread src/sentry/workflow_engine/migrations/0121_delete_malformed_anomaly_conditions.py Outdated
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