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:
@@ -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
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user