Skip to content

chore(aci): roll out DELETE issue alert endpoint flag#113216

Merged
klochek merged 1 commit intomasterfrom
christopherklochek/iswf-2396-roll-out-issue-alert-rule-delete-endpoint
Apr 17, 2026
Merged

chore(aci): roll out DELETE issue alert endpoint flag#113216
klochek merged 1 commit intomasterfrom
christopherklochek/iswf-2396-roll-out-issue-alert-rule-delete-endpoint

Conversation

@klochek
Copy link
Copy Markdown
Contributor

@klochek klochek commented Apr 16, 2026

No description provided.

@klochek klochek requested a review from a team April 16, 2026 19:21
@klochek klochek requested a review from a team as a code owner April 16, 2026 19:21
@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 16, 2026

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 16, 2026
Comment on lines +108 to 111
"DELETE": "organizations:workflow-engine-issue-alert-endpoints-delete",
}
publish_status = {
"DELETE": ApiPublishStatus.PUBLIC,
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.

Bug: An unexpected error during Rule deletion can cause an inconsistent state because the associated Workflow deletion is committed separately and cannot be rolled back.
Severity: MEDIUM

Suggested Fix

Wrap both the Workflow and Rule deletion operations within a single, overarching atomic transaction. This ensures that both operations must succeed for the changes to be committed, preventing any potential for an inconsistent state if the Rule deletion fails unexpectedly.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/sentry/api/endpoints/project_rule_details.py#L108-L111

Potential issue: In the `delete` method, a `Workflow` is scheduled for deletion and this
change is committed within its own atomic transaction. Subsequently, the code attempts
to delete the associated `Rule`. However, the error handling for the `Rule` deletion
only catches `DoesNotExist` exceptions. If any other unexpected exception occurs during
the `Rule` deletion, the API will return a 500 error, leaving the system in an
inconsistent state where the `Workflow` is pending deletion but the `Rule` is not.

Did we get this right? 👍 / 👎 to inform future reviews.

@klochek klochek merged commit 816b56e into master Apr 17, 2026
78 checks passed
@klochek klochek deleted the christopherklochek/iswf-2396-roll-out-issue-alert-rule-delete-endpoint branch April 17, 2026 16:31
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