feat(autofix): Update seer explorer autofix last triggered on completion #111663
1 issue
sentry-backend-bugs: Found 1 issue (1 high)
High
Unhandled Group.DoesNotExist when group is deleted between fetch_run_status and lookup - `src/sentry/seer/autofix/on_completion_hook.py:230`
The refactoring in this hunk removes DoesNotExist handlers from _maybe_trigger_supergroups_embedding (removed lines 236-248) and _maybe_continue_pipeline (removed lines 310-328), replacing them with a group parameter passed from execute(). However, the execute() method at line 85 calls Group.objects.get(id=group_id, project__organization_id=organization.id) without any try/except handler. If the group is deleted between when the run was created and when this completion hook executes, a Group.DoesNotExist exception will crash the hook, preventing webhook delivery and pipeline continuation.
Also found at:
src/sentry/seer/autofix/on_completion_hook.py:85
Duration: 2m 11s · Tokens: 384.4k in / 7.7k out · Cost: $0.81 (+extraction: $0.01, +merge: $0.00)
Annotations
Check failure on line 230 in src/sentry/seer/autofix/on_completion_hook.py
sentry-warden / warden: sentry-backend-bugs
Unhandled Group.DoesNotExist when group is deleted between fetch_run_status and lookup
The refactoring in this hunk removes DoesNotExist handlers from `_maybe_trigger_supergroups_embedding` (removed lines 236-248) and `_maybe_continue_pipeline` (removed lines 310-328), replacing them with a `group` parameter passed from `execute()`. However, the `execute()` method at line 85 calls `Group.objects.get(id=group_id, project__organization_id=organization.id)` without any try/except handler. If the group is deleted between when the run was created and when this completion hook executes, a `Group.DoesNotExist` exception will crash the hook, preventing webhook delivery and pipeline continuation.
Check failure on line 85 in src/sentry/seer/autofix/on_completion_hook.py
sentry-warden / warden: sentry-backend-bugs
[TVD-3MR] Unhandled Group.DoesNotExist when group is deleted between fetch_run_status and lookup (additional location)
The refactoring in this hunk removes DoesNotExist handlers from `_maybe_trigger_supergroups_embedding` (removed lines 236-248) and `_maybe_continue_pipeline` (removed lines 310-328), replacing them with a `group` parameter passed from `execute()`. However, the `execute()` method at line 85 calls `Group.objects.get(id=group_id, project__organization_id=organization.id)` without any try/except handler. If the group is deleted between when the run was created and when this completion hook executes, a `Group.DoesNotExist` exception will crash the hook, preventing webhook delivery and pipeline continuation.