fix(source-control): say when the review lookup failed instead of "not ready" (#36458)

A ready branch whose MR/PR lookup failed was told it wasn't ready, hiding the real problem.

Refs #35632
This commit is contained in:
Kelvin Amoaba
2026-10-30 21:25:00 +00:00
committed by GitHub
parent d9652f2b19
commit 99cb2cbbf3
2 changed files with 38 additions and 6 deletions
@@ -532,6 +532,32 @@ describe('resolvePrimaryAction Create PR intent', () => {
})
})
it('names a failed review lookup instead of calling a ready branch not ready', () => {
expect(
resolveCreatePrHeaderAction(
inputs({
upstreamStatus: upstreamInSync,
hostedReviewCreation: {
provider: 'gitlab',
review: null,
reviewLookupOutcome: 'unavailable',
defaultBaseRef: 'origin/main',
head: 'feature',
canCreate: false,
blockedReason: null,
nextAction: null
}
})
)
).toEqual({
kind: 'create_pr',
label: 'Create MR',
title:
'Create MR failed: Orca could not confirm whether this branch already has a merge request. Retry once the GitLab lookup succeeds.',
disabled: true
})
})
it('returns a clickable Create PR header notice path when the branch has nothing to publish yet', () => {
expect(
resolveCreatePrHeaderAction(
@@ -11,7 +11,10 @@ import type {
} from '../../../../../../shared/hosted-review'
import type { PrimaryAction, PrimaryActionInputs } from '../../source-control-primary-action-types'
import { resolveCreatePrIntentEligibility } from './create-pr-intent-state'
import { canClickBlockedCreateReviewReason } from '../../source-control-create-review-blocked-action'
import {
canClickBlockedCreateReviewReason,
resolveBlockedCreateReviewNoticeMessage
} from '../../source-control-create-review-blocked-action'
export function resolveProvisionalHostedReviewProvider(input: {
hostedReview?: Pick<HostedReviewInfo, 'provider'> | null
@@ -175,11 +178,14 @@ export function resolveDisabledCreatePrHeaderAction(
case 'unsupported_provider':
case 'base_not_on_remote':
case null:
title = translate(
'auto.components.right.sidebar.source.control.primary.action.f0c6e2a581',
'This branch is not ready for a {{value0}} yet.',
{ value0: copy.reviewLabel }
)
// A failed review lookup is not a branch problem, so name it instead.
title =
resolveBlockedCreateReviewNoticeMessage(hostedReviewCreation) ??
translate(
'auto.components.right.sidebar.source.control.primary.action.f0c6e2a581',
'This branch is not ready for a {{value0}} yet.',
{ value0: copy.reviewLabel }
)
}
}