Repository navigation
fix(hosted-review-sitter): key GitHub conflict work on the live base tip - #123
Merged
Merged
Conversation
GitHub refreshes a pull request's baseRefOid only when the PR is pushed, but computes mergeability against the base branch's current tip. The sitter read baseRefOid, so after the base advanced it dispatched conflict preparation against an old base commit the head already contained. The worker's merge was a no-op, the attempt settled unverifiable, and because (head, base) never changed the sitter raised the same deviation every tick. Read baseRef.target.oid in the same GraphQL query instead, matching the GitLab reader, which already resolves the target branch tip. An unreadable base ref now leaves baseSha empty (evidence incomplete) rather than falling back to the stale commit. A no-op conflict preparation stays non-retryable for the same (head, base): rerunning that merge is deterministic, and a moved base already produces a fresh attempt fingerprint.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
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.
ELI5
The PR sitter decides whether a pull request has merge conflicts by comparing it to the base branch. On GitHub it was comparing against an old snapshot of the base branch, so when it tried to fix a conflict there was nothing to merge, the fix "failed", and the sitter got stuck repeating the same complaint forever. It now compares against the base branch as it is right now.
What Changed
Before: on a GitHub PR whose base branch moved after the PR's last push, GitHub reports the PR as conflicting, but the sitter sends its conflict worker to merge the commit the PR was opened against. That merge is a no-op ("Already up to date"), the worker reports failure, and every later tick raises the same "worker never produced a verifiable outcome" deviation. Seen on zpyoung/quirk#52 (recorded base 00d339c, live main 3df5f34).
After: the sitter dispatches conflict resolution against the base branch's current tip, so the worker merges the commit that actually conflicts. Already-wedged sitters recover on their next tick, because the new base gives the attempt a new identity.
Mechanism: the GitHub reader read
pullRequest.baseRefOid, which GitHub refreshes only when the PR is pushed, whilemergeableis computed against the live tip. It now readsbaseRef { target { oid } }in the same GraphQL query. If the base ref can't be read, the base SHA is left empty, which marks the snapshot's evidence incomplete, instead of quietly falling back to the stale commit. That matches the GitLab reader, which already looks up the target branch's tip.Why
mergeable, so the two can't disagree. A separate REST lookup (the GitLab shape) would cost a request per tick and could race the GraphQL read.UNKNOWNmergeability, and the live tip is the right value for all of them.baseShaon GitHub changes, and it now means the same thing it already meant on GitLab.Linked Issue
Orca ledger bug-317.
Visual Proof
N/A. This changes background sitter behavior and has no UI.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
New
provider-github-read.test.ts: snapshot base is the live tip,UNKNOWNmergeability is simulated against the live tip, and a missing base ref leaves the base empty and not ready. All three failed before the fix with the stale SHA.New case in
decision.test.ts: an unverifiable conflict preparation isn't re-dispatched for the same base, and a moved base gets a fresh dispatch.pnpm test:sandboxoversrc/main/fork-hosted-review-sitter/andsrc/shared/fork-hosted-review-sitter/(135 tests) green,pnpm typecheck:nodeclean,check:code-quality:changedclean.Review
Agent skill upstream boundary
Notes
All files are under the fork-owned
**/fork-hosted-review-sitter/**glob, so no manifest change is needed. SSH: no change, since the GitHub read runs throughghthe same way as before.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)