Accept merged fallback PRs during branch lookup (#5908)

Ensure that when a visible fallback PR has been merged (e.g., outside
Orca with a deleted head branch), it is still accepted and refreshed by
branch lookup instead of being discarded as an implicit merged PR.

* Add `acceptMergedFallbackPR` option to GitHub branch lookups
* Enable this option during manual and background refreshes of fallback PRs
* Plumb the new option through preload APIs, IPC handlers, and RPC protocols
This commit is contained in:
Jinjing
2026-06-20 03:30:18 -07:00
committed by GitHub
parent 1419193bea
commit 97dc6d63e3
16 changed files with 253 additions and 25 deletions
@@ -269,6 +269,8 @@ describe('forge provider interface', () => {
number: 7,
status: 'success'
})
expect(getPRForBranchMock).toHaveBeenCalledWith('/repo', '', null, 'ssh-1', 7)
expect(getPRForBranchMock).toHaveBeenCalledWith('/repo', '', null, 'ssh-1', 7, {
acceptMergedFallbackPR: true
})
})
})
+4 -1
View File
@@ -120,7 +120,10 @@ const gitHubForgeProvider = {
input.linkedReviewNumber ?? null,
input.connectionId,
fallbackReviewNumber,
...executionArgs
{
...executionArgs[0],
acceptMergedFallbackPR: true
}
)
: executionArgs.length > 0
? await getPRForBranch(
@@ -194,7 +194,9 @@ describe('getHostedReviewForBranch', () => {
number: 42,
status: 'success'
})
expect(getPRForBranchMock).toHaveBeenCalledWith('/repo', '', null, undefined, 42)
expect(getPRForBranchMock).toHaveBeenCalledWith('/repo', '', null, undefined, 42, {
acceptMergedFallbackPR: true
})
})
it('falls through to Bitbucket when origin is not GitLab or GitHub', async () => {