Repository navigation
ref(autofix): Move PR iteration completion handling into pr_iteration - #125495
Merged
Merged
Conversation
joseph-sentry
force-pushed
the
joey--pr-iter-sweep-retry
branch
from
September 24, 2026 20:23
4b7397f to
3e3bdf5
Compare
joseph-sentry
force-pushed
the
joey--pr-iter-completion-hook
branch
from
September 24, 2026 20:23
ae61921 to
b5e1179
Compare
joseph-sentry
force-pushed
the
joey--pr-iter-sweep-retry
branch
from
September 24, 2026 20:46
3e3bdf5 to
1e7d915
Compare
joseph-sentry
force-pushed
the
joey--pr-iter-completion-hook
branch
3 times, most recently
from
September 25, 2026 18:03
5f5d6c3 to
41eb62d
Compare
joseph-sentry
force-pushed
the
joey--pr-iter-completion-hook
branch
from
September 25, 2026 20:38
41eb62d to
cdc7642
Compare
Contributor
Author
|
cursor review |
joseph-sentry
marked this pull request as ready for review
September 25, 2026 22:07
The autofix completion hook runs for every autofix step, and it held most of the PR iteration completion logic: failing a paused iteration, reacting to the comments that triggered it, the iteration webhook, pushing the new changes and consuming queued feedback. The hook is reached through Seer's RPC endpoint, so errors raised there had no pr_iteration module anywhere in their stack trace, and a stack.module:*pr_iteration* search could not find them. Move that logic into sentry.seer.autofix.pr_iteration.completion and completion_reactions. The hook now does the shared work (fetch the run, resolve the group, find the step), then forks once: a regular autofix step continues the pipeline, and a PR iteration handles its own errored run, webhook, reactions and push. The two branches share the group lookup, the completed check, the timestamps and the webhook sending. One behavior change: a PR iteration run whose group cannot be found is now recorded with a new missing_group_id outcome and logged as an error, instead of being dropped silently. Log event names, fields and metrics are otherwise unchanged; the log lines moved with the code now come from the new modules' loggers.
joseph-sentry
force-pushed
the
joey--pr-iter-completion-hook
branch
from
September 29, 2026 14:23
cdc7642 to
a2e03f2
Compare
Contributor
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.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a2e03f2. Configure here.
joseph-sentry
requested review from
alexsohn1126,
giovanni-guidini and
vaind
September 29, 2026 18:44
alexsohn1126
approved these changes
Oct 2, 2026
…etion-hook # Conflicts: # src/sentry/seer/autofix/on_completion_hook.py
Contributor
Sentry Snapshot Testing
|
…etion-hook # Conflicts: # src/sentry/seer/autofix/on_completion_hook.py
This was referenced Oct 15, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The autofix completion hook runs for every autofix step, and it held most of the PR iteration completion logic: failing a paused iteration, reacting to the comments that triggered it, the iteration webhook, pushing the new changes and consuming queued feedback. The hook is reached through Seer's RPC endpoint, so errors raised there had no pr_iteration module anywhere in their stack trace, and a stack.module:pr_iteration search could not find them.
Move that logic into sentry.seer.autofix.pr_iteration.completion and completion_reactions. The hook now does the shared work (fetch the run, resolve the group, find the step), then forks once: a regular autofix step continues the pipeline, and a PR iteration handles its own errored run, webhook, reactions and push. The two branches share the group lookup, the completed check, the timestamps and the webhook sending.
One behavior change: a PR iteration run whose group cannot be found is now recorded with a new missing_group_id outcome and logged as an error, instead of being dropped silently. Log event names, fields and metrics are otherwise unchanged; the log lines moved with the code now come from the new modules' loggers.