You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(github): retry the transient 405 'Merge already in progress' race (#5003)
classifyMergeFailure treated every 405 except the known "Base branch
was modified" TOCTOU race as terminal, holding the PR for a human.
"Merge already in progress" (GITTENSORY-1K, 2 Sentry events) is the
same class of benign race -- another merge request for the same PR is
already being processed by GitHub -- not a policy rejection, so it
resolves the same way: retry against the settled state instead of
holding.
// A 405 "Base branch was modified" is a benign TOCTOU race, not a policy rejection — retry against the new base
56
65
// (the executor caps retries at MERGE_RETRY_CAP before escalating to the same terminal hold).
57
66
if(status===405&&isBaseBranchMovedMessage(message))return{terminal: false,reason: `base branch moved during merge — retrying: ${message}`};
67
+
if(status===405&&isMergeAlreadyInProgressMessage(message))return{terminal: false,reason: `a merge for this PR was already in progress — retrying: ${message}`};
58
68
if(status===405)return{terminal: true,reason: `merge not allowed (405 — repo merge policy forbids an automated merge): ${message}`};
0 commit comments