mirror of
https://github.com/stablyai/orca.git
synced 2026-10-19 16:03:26 +00:00
Fix create PR visibility when upstream status is unknown
This commit is contained in:
@@ -616,6 +616,21 @@ describe('getHostedReviewCreationEligibility', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('rethrows review lookup failures when upstream status is unknown', async () => {
|
||||
getHostedReviewForBranchMock.mockRejectedValueOnce(new Error('gh lookup failed'))
|
||||
|
||||
await expect(
|
||||
getHostedReviewCreationEligibility({
|
||||
repoPath: '/repo',
|
||||
branch: 'feature/create-pr',
|
||||
base: 'main',
|
||||
hasUncommittedChanges: false,
|
||||
ahead: 0,
|
||||
behind: 0
|
||||
})
|
||||
).rejects.toThrow('gh lookup failed')
|
||||
})
|
||||
|
||||
it('enables creation for clean, in-sync, authenticated GitHub feature branches', async () => {
|
||||
await expect(
|
||||
getHostedReviewCreationEligibility({
|
||||
|
||||
@@ -405,7 +405,7 @@ export async function getHostedReviewCreationEligibility(
|
||||
branch !== 'HEAD' &&
|
||||
supportsHostedReviewCreation(provider) &&
|
||||
(!baseBranch || branch.toLowerCase() !== baseBranch.toLowerCase()) &&
|
||||
(args.hasUncommittedChanges || args.hasUpstream !== true || (args.behind ?? 0) > 0)
|
||||
(args.hasUncommittedChanges || args.hasUpstream === false || (args.behind ?? 0) > 0)
|
||||
if (!canReturnLocalBlocker) {
|
||||
throw error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user