Repository navigation
fix(alerts): Skip issue validation when deleting old subscription during update - #128742
sentry[bot] wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a7ababb. Configure here.
| sub = QuerySubscription.objects.get(id=sub.id) | ||
| assert sub.status == QuerySubscription.Status.ACTIVE.value | ||
| assert sub.subscription_id is not None | ||
| assert sub.subscription_id != subscription_id |
There was a problem hiding this comment.
Update test fails on create
Medium Severity
The new test uses issue:INVALID-1 as the current query and does not pass old_query. After the skip-validation delete, _create_in_snuba rebuilds that query without skip_field_validation_for_entity_subscription_deletion, so _issue_filter_converter raises and the task fails with SubscriptionError instead of becoming ACTIVE.
Reviewed by Cursor Bugbot for commit a7ababb. Configure here.
Backend Test FailuresFailures on
|


Problem
When
update_subscription_in_snubaruns for an alert rule whose query contains anissue:filter referencing a deleted issue (e.g.issue:ANALYTICS-WERNICKE-SEARCH-1VT),_issue_filter_converterraisesInvalidIssueSearchQuery. This crashes the task and blocks the subscription update from completing (~26K errors/day in production).Fix
Pass
skip_field_validation_for_entity_subscription_deletion=Truetoold_entity_subscription.build_query_builder()inupdate_subscription_in_snuba, matching the pattern already used bydelete_subscription_from_snuba. Added a regression test toUpdateSubscriptionInSnubaTestmirroring the delete test.Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
Fixes SENTRY-5SFJ
@sentry <feedback>: Autofix iterates on these changes@sentry stop iterating: Autofix stops iterating on this runThis PR was automatically generated by Sentry. You can adjust this setting at any time.