Repository navigation
feat(github): Check for merge conflicts on pull request webhook events - #2501
Open
sentry-junior[bot] wants to merge 3 commits into
Open
sentry-junior[bot] wants to merge 3 commits into
sentry-junior[bot] wants to merge 3 commits into
Conversation
GitHub sends no webhook when a pull request gets a conflict, and a conflicted pull request gets no new checks. When the base branch moves while a Junior pull request is idle, nothing told the maintenance watch. The GitHub plugin heartbeat now reads mergeability for open Junior pull requests that a watch or event automation matches, at most every five minutes, and publishes pull_request.merge_conflict once per head commit. Core gives plugin heartbeats the same scoped event publisher as plugin routes. The watch made after Junior creates a pull request always gets the new event, with guidance to merge the base branch and never rebase. Closes #2416 Co-Authored-By: BYK <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
3 screenshot changes — 3 changed · 0 added · 0 removed Review screenshots in Frameshift
|
…uests Each check read the same newest open pull requests and stopped after 20 matches, so idle watched pull requests past that cap were never read. Page through open pull requests in a stable order and keep a cursor in plugin state, so each check goes on where the last one stopped.
BYK
requested changes
Nov 1, 2026
BYK
left a comment
Member
There was a problem hiding this comment.
Not really a fan of this polling approach. Do you think we can subscribe to more events or make our post-event checks more robust? For instance if I comment on, or review a PR we should check the merge state. Similar to right after a push?
…ling Drop the heartbeat sweep. When a webhook delivers a comment, review, check result, or other event for an open pull request that a watch or event automation wants conflicts for, read the pull request and publish pull_request.merge_conflict when GitHub reports a conflict. The event key names the head commit, so each head commit reaches a watch once. This reverts the core heartbeat event publisher, which nothing uses now.
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 7eb5492. Configure here.
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.

GitHub sends no webhook when a pull request gets a conflict, and a conflicted pull request gets no new checks. So when the base branch moves under a Junior PR, nothing tells its maintenance watch. #2374 stayed conflicted until a person noticed.
This adds a
pull_request.merge_conflictevent. The GitHub webhook checks for it on other pull request events:mergeable: falseandmergeable_state: "dirty"), the plugin publishes the event to the PR and its repository. If GitHub does not know yet, the read starts its calculation, and a later event reads it again.repoandpullRequest. That way the check before the read gives the same answer as the full event, and PRs that nothing watches cost no GitHub calls.A PR that gets no other events is not checked. The
github-codeskill still checks mergeability after each push. This settles the open question from #2303: detection now lives inpackages/junior-githubcode, not only in skill prose.Refs #2416
--
View Session in Sentry