Skip to content

A delivery no longer polls forever when GitHub never refreshes the PR after a push - #2444

Merged
orbi-build[bot] merged 2 commits into
mainfrom
orbi/orbi-build-orbi-issue-2440
Nov 26, 2026
Merged

orbi-build[bot] merged 2 commits into
mainfrom
orbi/orbi-build-orbi-issue-2440

Conversation

@orbi-build

@orbi-build orbi-build Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #2440

A delivery no longer polls forever when GitHub never refreshes the PR after a push (run_id=9ddfb214)

Built by Orbi from Issue #2440

The merge gate deferred forever when GitHub's PR view never picked up the
runner's push: the incident (orbi-cloud#3953) polled `mergeable=UNKNOWN`
with a stale `head.sha` for 8.5 hours, with no stop and no comment.

The gate now compares the PR's recorded head with `origin/<branch>` at its
UNKNOWN-mergeability deferral and, when the head lags, asks GitHub to
update the pull request branch itself (`PUT /pulls/<n>/update-branch` with
the branch tip as `expected_head_sha` — the documented value, and the one
the manual attempt got wrong with a 422). GitHub re-reads the branch and
the delivery continues on the refreshed head.

The attempt is bounded to three ticks (`PR_HEAD_REFRESH_TICKS`), counted in
the delivery's run state; past the bound the run stops `ai-blocked` with a
comment naming the cause (GitHub did not refresh the PR) and the repair (a
new commit on the branch, or the PR's "Update branch" button). A PR whose
head IS the branch tip with a briefly UNKNOWN mergeability is waited on
exactly as before, and an unreadable tip or an absent run state never
starts an uncounted refresh loop.

Fixes #2440
…2440)

The update-branch request is a network mutation: it now carries the same
bounded timeout every other gh call in the runner has (Issue #95), and a
request that outlasts it spends its tick exactly like a rejected one.

An unreadable branch tip used to clear the counted scene, so each flaky
read reset the three-tick bound and a stale PR could poll past it. A
failed probe is not a verdict about the PR: it now leaves the count (and
the bound it carries) untouched.
@orbi-build
orbi-build Bot merged commit 4acee8f into main Nov 26, 2026
2 checks passed
@orbi-build
orbi-build Bot deleted the orbi/orbi-build-orbi-issue-2440 branch November 26, 2026 15:17
@orbi-build

orbi-build Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

✅ Orbi 已交付 · 查看交付证明 →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A delivery no longer polls forever when GitHub never refreshes the PR after a push

0 participants