Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
56eacd6
fix(pr): show when GitHub branch rules block merging
shethshlok Oct 27, 2026
20da63f
merge: update blocked-merge fix with main
shethshlok Oct 29, 2026
bed76d7
fix(web): make blocked merge explanations keyboard accessible
shethshlok Oct 29, 2026
43f4d5d
fix(github): refresh merge-blocked API fixtures against main
shethshlok Oct 31, 2026
bc8e8d2
test(web): assert blocked merge ARIA state explicitly
shethshlok Oct 31, 2026
4fcc4a8
fix(pr): resolve merge-status conflicts with main
shethshlok Nov 8, 2026
bacc0d4
test(web): align blocked-merge fixture with current props
shethshlok Nov 8, 2026
a3a1fc8
Merge remote-tracking branch 'github/main' into fix/pr-merge-blocked-…
maria-rcks Nov 11, 2026
7f3c955
Merge remote-tracking branch 'origin/main' into fix/pr-merge-blocked-…
juliusmarminge Nov 12, 2026
16e6777
test(web): keep blocked-merge coverage to the logic tests
juliusmarminge Nov 12, 2026
776f2d6
Merge remote-tracking branch 'origin/main' into fix/pr-merge-blocked-…
juliusmarminge Nov 12, 2026
e35a7a9
fix(github): merge-queue branches no longer read as merge-blocked
juliusmarminge Nov 13, 2026
596850a
Merge remote-tracking branch 'origin/main' into fix/pr-merge-blocked-…
juliusmarminge Nov 13, 2026
e63c791
fix(pr): blocked merges reuse the merge button's disabled state
juliusmarminge Nov 13, 2026
484292f
fix(pr): a merge block clears once live checks move
juliusmarminge Nov 13, 2026
d8a7899
fix(pr): the checks poll carries the merge block
juliusmarminge Nov 13, 2026
538ab53
chore(pr): merge main into blocked merge fix
shethshlok Nov 15, 2026
c7f7cd5
merge: update blocked merge fix with main
shethshlok Nov 19, 2026
c3c09a7
fix(mobile): preserve the branch rules merge guard
shethshlok Nov 19, 2026
cd2c553
merge: update blocked merge fix with main
shethshlok Nov 24, 2026
c43537c
merge: update blocked merge fix with main
shethshlok Nov 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ describe("mobile pull request actions", () => {
expect(mergeUnavailableReason(pr, true, GITHUB)).toContain("conflicts");
});

it("blocks a merge the host's branch rules hold back, keeping auto-merge", () => {
const pr = detail({ mergeBlocked: true });
expect(canPerformPullRequestAction(pr, "merge")).toBe(false);
expect(canPerformPullRequestAction(pr, "enable-auto-merge")).toBe(true);
expect(mergeUnavailableReason(pr, true, GITHUB)).toContain("rules");
});

it("picks the chosen, project default, then last used merge method the repository allows", () => {
const pr = detail();
expect(resolveMergeMethod(pr, null, "merge", "squash")).toBe("merge");
Expand Down
16 changes: 14 additions & 2 deletions apps/mobile/src/features/pull-requests/pullRequestActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ import { PullRequestGlyph } from "./pullRequestGlyphs";

type ActionDetail = Pick<
PullRequestDetail,
"state" | "isDraft" | "mergeability" | "autoMergeEnabled" | "workflowApprovalsRequired"
| "state"
| "isDraft"
| "mergeability"
| "mergeBlocked"
| "autoMergeEnabled"
| "workflowApprovalsRequired"
> & {
readonly capabilities: Pick<
PullRequestDetail["capabilities"],
Expand Down Expand Up @@ -159,7 +164,12 @@ export function canPerformPullRequestAction(pr: ActionDetail, action: PullReques
case "draft":
return !pr.isDraft;
case "merge":
return !pr.isDraft && pr.mergeability !== "conflicting" && allowedMergeMethods(pr).length > 0;
return (
!pr.isDraft &&
pr.mergeability !== "conflicting" &&
pr.mergeBlocked !== true &&
allowedMergeMethods(pr).length > 0
);
case "enable-auto-merge":
return !pr.isDraft && pr.autoMergeEnabled === false && allowedMergeMethods(pr).length > 0;
case "disable-auto-merge":
Expand Down Expand Up @@ -205,6 +215,8 @@ export function mergeUnavailableReason(
return resolve(msg("Resolve the branch conflicts before merging."));
if (!allowedMergeMethods(pr).length)
return resolve(msg("This repository has no available merge methods."));
if (pr.mergeBlocked)
return resolve(msg("The repository's rules block merging until their requirements are met."));
return null;
}

Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -3117,6 +3117,7 @@
"1d44f8d46fa8508e": "Markiere diesen Entwurf vor dem Mergen als bereit für Review.",
"6ffcf2825c96d94b": "Löse die Branch-Konflikte vor dem Mergen.",
"ceac7373aef06b11": "Dieses Repository hat keine verfügbaren Merge-Methoden.",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"80bb66fe1c536e09": "Auf {provider} öffnen",
"dd7e258483f58a8f": "Archivierter Thread",
"754d11d1f210a398": "Neuen Thread starten",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3118,6 +3118,7 @@
"1d44f8d46fa8508e": "Mark this draft ready for review before merging.",
"6ffcf2825c96d94b": "Resolve the branch conflicts before merging.",
"ceac7373aef06b11": "This repository has no available merge methods.",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"80bb66fe1c536e09": "Open on {provider}",
"dd7e258483f58a8f": "Archived thread",
"754d11d1f210a398": "Start a new thread",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -3112,6 +3112,7 @@
"1d44f8d46fa8508e": "Marca este borrador como listo para revisión antes de fusionar.",
"6ffcf2825c96d94b": "Resuelve los conflictos de la rama antes de fusionar.",
"ceac7373aef06b11": "Este repositorio no tiene métodos de merge disponibles.",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"80bb66fe1c536e09": "Abrir en {provider}",
"dd7e258483f58a8f": "Hilo archivado",
"754d11d1f210a398": "Iniciar un hilo nuevo",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -3112,6 +3112,7 @@
"1d44f8d46fa8508e": "Marquez ce brouillon comme prêt pour la revue avant de le fusionner.",
"6ffcf2825c96d94b": "Résolvez les conflits de la branche avant de fusionner.",
"ceac7373aef06b11": "Ce dépôt n’a aucune méthode de fusion disponible.",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"80bb66fe1c536e09": "Ouvrir sur {provider}",
"dd7e258483f58a8f": "Fil archivé",
"754d11d1f210a398": "Démarrer un nouveau fil",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -3109,6 +3109,7 @@
"1d44f8d46fa8508e": "マージする前に、この下書きをレビューの準備完了にしてください。",
"6ffcf2825c96d94b": "マージする前にブランチの競合を解決してください。",
"ceac7373aef06b11": "このリポジトリで利用できるマージ方法はありません。",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"80bb66fe1c536e09": "{provider} で開く",
"dd7e258483f58a8f": "アーカイブ済みのスレッド",
"754d11d1f210a398": "新しいスレッドを開始",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -3113,6 +3113,7 @@
"1d44f8d46fa8508e": "병합하기 전에 이 초안을 검토 준비 완료로 표시하세요.",
"6ffcf2825c96d94b": "병합하기 전에 브랜치 충돌을 해결하세요.",
"ceac7373aef06b11": "이 저장소에는 사용 가능한 병합 방법이 없습니다.",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"80bb66fe1c536e09": "{provider}에서 열기",
"dd7e258483f58a8f": "보관된 스레드",
"754d11d1f210a398": "새 스레드 시작",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -3112,6 +3112,7 @@
"1d44f8d46fa8508e": "Marque este rascunho como pronto para revisão antes de mesclar.",
"6ffcf2825c96d94b": "Resolva os conflitos do branch antes de mesclar.",
"ceac7373aef06b11": "Este repositório não tem métodos de merge disponíveis.",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"80bb66fe1c536e09": "Abrir no {provider}",
"dd7e258483f58a8f": "Thread arquivada",
"754d11d1f210a398": "Iniciar uma nova thread",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -3166,6 +3166,7 @@
"1d44f8d46fa8508e": "Отметьте этот черновик как готовый к ревью перед слиянием.",
"6ffcf2825c96d94b": "Разрешите конфликты ветки перед слиянием.",
"ceac7373aef06b11": "В этом репозитории нет доступных способов слияния.",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"80bb66fe1c536e09": "Открыть в {provider}",
"dd7e258483f58a8f": "Архивный тред",
"754d11d1f210a398": "Начать новый тред",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -3118,6 +3118,7 @@
"1d44f8d46fa8508e": "Markera utkastet som redo för granskning innan du mergar.",
"6ffcf2825c96d94b": "Lös grenkonflikterna innan du mergar.",
"ceac7373aef06b11": "Repot har inga tillgängliga merge-metoder.",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"80bb66fe1c536e09": "Öppna på {provider}",
"dd7e258483f58a8f": "Arkiverad tråd",
"754d11d1f210a398": "Starta en ny tråd",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/i18n/translations/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -3113,6 +3113,7 @@
"1d44f8d46fa8508e": "合并前请将此草稿标记为可供审查。",
"6ffcf2825c96d94b": "合并前请解决分支冲突。",
"ceac7373aef06b11": "此仓库没有可用的合并方式。",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"80bb66fe1c536e09": "在 {provider} 上打开",
"dd7e258483f58a8f": "已归档的会话",
"754d11d1f210a398": "开始新会话",
Expand Down
4 changes: 4 additions & 0 deletions apps/server/src/pullRequest/PullRequestService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2012,6 +2012,9 @@ export const make = Effect.gen(function* () {
...(changeRequest.workflowApprovalsRequired === undefined
? {}
: { workflowApprovalsRequired: changeRequest.workflowApprovalsRequired }),
...(changeRequest.mergeBlocked === undefined
? {}
: { mergeBlocked: changeRequest.mergeBlocked }),
...(changeRequest.mergeQueueRemoval === undefined
? {}
: { mergeQueueRemoval: changeRequest.mergeQueueRemoval }),
Expand Down Expand Up @@ -3433,6 +3436,7 @@ export const make = Effect.gen(function* () {
state: value.state,
checks: value.checks,
observedAt: value.observedAt,
...(value.mergeBlocked === undefined ? {} : { mergeBlocked: value.mergeBlocked }),
...(value.workflowApprovalsRequired === undefined
? {}
: { workflowApprovalsRequired: value.workflowApprovalsRequired }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,7 @@ export function PullRequestDetailPanel({
state: detail.state,
isDraft: detail.isDraft,
mergeability: detail.mergeability,
mergeBlocked: detail.mergeBlocked,
checksState,
autoMergeEnabled: detail.autoMergeEnabled,
hasMergeMethod: allowedMergeMethods.length > 0,
Expand All @@ -1472,6 +1473,11 @@ export function PullRequestDetailPanel({
canEnableAutoMerge: !stackOwnsMerge && can("enable-auto-merge"),
})
: null;
const primaryMergeBlockedReason =
mergeBlockedReason ??
(primaryAction === "merge" && detail?.mergeBlocked === true
? gt("The repository's rules block merging until their requirements are met.")
: null);
const showsDraftToggle =
detail?.state === "open" &&
can(detail.isDraft ? "ready" : "draft") &&
Expand All @@ -1493,6 +1499,7 @@ export function PullRequestDetailPanel({
can("merge") &&
!detail.isDraft &&
!conflicting &&
detail.mergeBlocked !== true &&
allowedMergeMethods.length > 0;
const showsMergeMethods =
detail?.state === "open" &&
Expand Down Expand Up @@ -1675,7 +1682,7 @@ export function PullRequestDetailPanel({
/>
) : null}
<PullRequestPrimaryAction
mergeBlockedReason={mergeBlockedReason}
mergeBlockedReason={primaryMergeBlockedReason}
pullRequestKey={pullRequestKey}
primaryAction={primaryAction}
autoMergeArmed={autoMergeArmed}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ describe("pull request primary control", () => {
}),
).toBe("merge");
});

it("offers auto-merge for a merge the host's branch rules block", () => {
expect(resolvePullRequestPrimaryControl({ ...open, mergeBlocked: true })).toBe(
"enable-auto-merge",
);
});
});

describe("stacked pull request classification", () => {
Expand Down Expand Up @@ -1812,6 +1818,11 @@ describe("the compact row's single action slot", () => {
).toBe("fix");
});

it("does not offer a merge the host's branch rules block", () => {
expect(resolveThreadPanelPullRequestAction(openDetail())).toBe("merge");
expect(resolveThreadPanelPullRequestAction(openDetail({ mergeBlocked: true }))).toBeNull();
});

it("offers nothing the viewer may not do, and nothing on settled pull requests", () => {
expect(
resolveThreadPanelPullRequestAction(
Expand Down
15 changes: 11 additions & 4 deletions apps/web/src/components/pullRequest/pullRequestDetail.logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export function resolvePullRequestPrimaryControl(input: {
readonly state: PullRequestState;
readonly isDraft: boolean;
readonly mergeability: PullRequestMergeability;
readonly mergeBlocked?: boolean | undefined;
readonly checksState: ContractPullRequestChecksState | null;
readonly autoMergeEnabled: boolean | undefined;
readonly hasMergeMethod: boolean;
Expand All @@ -116,8 +117,8 @@ export function resolvePullRequestPrimaryControl(input: {
if (!input.hasMergeMethod) return null;
if (
input.autoMergeEnabled === false &&
input.checksState !== null &&
input.checksState !== "passing" &&
(input.mergeBlocked === true ||
(input.checksState !== null && input.checksState !== "passing")) &&
input.canEnableAutoMerge
) {
return "enable-auto-merge";
Expand Down Expand Up @@ -293,7 +294,13 @@ export function isStackedPullRequestBase(

type PullRequestActionableDetail = Pick<
PullRequestDetail,
"state" | "isDraft" | "mergeability" | "capabilities" | "viewerPermissions" | "mergeCapabilities"
| "state"
| "isDraft"
| "mergeability"
| "mergeBlocked"
| "capabilities"
| "viewerPermissions"
| "mergeCapabilities"
>;

export function allowedPullRequestMergeMethods(
Expand Down Expand Up @@ -392,7 +399,7 @@ export function resolveThreadPanelPullRequestAction(
}
const checks = classifyPullRequestChecks(detail.checks);
if (checks === "failing") return "fix";
if (checks === "pending") return null;
if (checks === "pending" || detail.mergeBlocked) return null;
return canPerformPullRequestAction(detail, "merge") &&
allowedPullRequestMergeMethods(detail).length > 0
? "merge"
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/i18n/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -6845,6 +6845,7 @@
"ff49cda2006d155a": "Zugehörigkeit zum Stack konnte nicht geprüft werden",
"be49947d8fca9505": "Zugehörigkeit zum Stack wird geprüft…",
"a2e58d83bc5daf36": "Auto-Merge",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"6a2b21500ebf1305": "{term, select, mr {Merge-Request-Bereich einklappen} cr {Änderungsanfrage-Bereich einklappen} other {Pull-Request-Bereich einklappen}}",
"9f07c0e2e791c6b0": "{count, plural, one {{formatted} geänderte Datei} other {{formatted} geänderte Dateien}}",
"1f7445dfeeb0502d": "Checkout-Befehl kopieren",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6852,6 +6852,7 @@
"ff49cda2006d155a": "Couldn't check stack membership",
"be49947d8fca9505": "Checking stack membership…",
"a2e58d83bc5daf36": "Auto-merge",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"6a2b21500ebf1305": "Collapse {term, select, mr {merge request} cr {change request} other {pull request}} panel",
"9f07c0e2e791c6b0": "{count, plural, one {{formatted} changed file} other {{formatted} changed files}}",
"1f7445dfeeb0502d": "Copy checkout command",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/i18n/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -6845,6 +6845,7 @@
"ff49cda2006d155a": "No se pudo comprobar la pertenencia a la pila",
"be49947d8fca9505": "Comprobando la pertenencia a la pila…",
"a2e58d83bc5daf36": "Fusión automática",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"6a2b21500ebf1305": "Contraer el panel de la {term, select, mr {merge request} cr {solicitud de cambios} other {pull request}}",
"9f07c0e2e791c6b0": "{count, plural, one {{formatted} archivo cambiado} other {{formatted} archivos cambiados}}",
"1f7445dfeeb0502d": "Copiar el comando de checkout",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/i18n/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -6846,6 +6846,7 @@
"ff49cda2006d155a": "Impossible de vérifier l’appartenance à la pile",
"be49947d8fca9505": "Vérification de l’appartenance à la pile…",
"a2e58d83bc5daf36": "Fusion automatique",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"6a2b21500ebf1305": "Réduire le panneau de la {term, select, mr {merge request} cr {demande de modification} other {pull request}}",
"9f07c0e2e791c6b0": "{count, plural, one {{formatted} fichier modifié} other {{formatted} fichiers modifiés}}",
"1f7445dfeeb0502d": "Copier la commande de checkout",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/i18n/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -6814,6 +6814,7 @@
"ff49cda2006d155a": "スタックへの所属を確認できませんでした",
"be49947d8fca9505": "スタックへの所属を確認しています…",
"a2e58d83bc5daf36": "自動マージ",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"6a2b21500ebf1305": "{term, select, mr {マージリクエストパネルを折りたたむ} cr {変更リクエストパネルを折りたたむ} other {プルリクエストパネルを折りたたむ}}",
"9f07c0e2e791c6b0": "{count, plural, other {{formatted} 個の変更されたファイル}}",
"1f7445dfeeb0502d": "チェックアウトコマンドをコピー",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/i18n/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -6818,6 +6818,7 @@
"ff49cda2006d155a": "스택 포함 여부를 확인할 수 없습니다",
"be49947d8fca9505": "스택 포함 여부 확인 중…",
"a2e58d83bc5daf36": "자동 병합",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"6a2b21500ebf1305": "{term, select, mr {병합 요청} cr {변경 요청} other {풀 리퀘스트}} 패널 접기",
"9f07c0e2e791c6b0": "{count, plural, other {변경된 파일 {formatted}개}}",
"1f7445dfeeb0502d": "체크아웃 명령 복사",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/i18n/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -6845,6 +6845,7 @@
"ff49cda2006d155a": "Não foi possível verificar a participação na pilha",
"be49947d8fca9505": "Verificando a participação na pilha…",
"a2e58d83bc5daf36": "Merge automático",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"6a2b21500ebf1305": "Recolher o painel {term, select, mr {do merge request} cr {da solicitação de alteração} other {do pull request}}",
"9f07c0e2e791c6b0": "{count, plural, one {{formatted} arquivo alterado} other {{formatted} arquivos alterados}}",
"1f7445dfeeb0502d": "Copiar comando de checkout",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/i18n/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -6845,6 +6845,7 @@
"ff49cda2006d155a": "Не удалось проверить членство в стеке",
"be49947d8fca9505": "Проверка членства в стеке…",
"a2e58d83bc5daf36": "Автослияние",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"6a2b21500ebf1305": "{term, select, mr {Свернуть панель мерж-реквеста} cr {Свернуть панель запроса на изменение} other {Свернуть панель пул-реквеста}}",
"9f07c0e2e791c6b0": "{count, plural, one {{formatted} изменённый файл} few {{formatted} изменённых файла} many {{formatted} изменённых файлов} other {{formatted} изменённого файла}}",
"1f7445dfeeb0502d": "Копировать команду checkout",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/i18n/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -6851,6 +6851,7 @@
"ff49cda2006d155a": "Kunde inte kontrollera medlemskap i stacken",
"be49947d8fca9505": "Kontrollerar medlemskap i stacken…",
"a2e58d83bc5daf36": "Automatisk merge",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"6a2b21500ebf1305": "Fäll ihop panelen för {term, select, mr {merge request} cr {ändringsbegäran} other {pull request}}",
"9f07c0e2e791c6b0": "{count, plural, one {{formatted} ändrad fil} other {{formatted} ändrade filer}}",
"1f7445dfeeb0502d": "Kopiera utcheckningskommando",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/i18n/translations/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -6857,6 +6857,7 @@
"ff49cda2006d155a": "无法检查堆叠归属",
"be49947d8fca9505": "正在检查堆叠归属…",
"a2e58d83bc5daf36": "自动合并",
"2ec6fd5239985d64": "The repository's rules block merging until their requirements are met.",
"6a2b21500ebf1305": "收起 {term, select, mr {MR} cr {change request} other {PR}} 面板",
"9f07c0e2e791c6b0": "{count, plural, other {{formatted} 个已更改的文件}}",
"1f7445dfeeb0502d": "复制检出工作副本的命令",
Expand Down
16 changes: 16 additions & 0 deletions packages/client-runtime/src/pullRequestChecks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ describe("resolvePullRequestDetailChecks", () => {
expect(resolvePullRequestDetailChecks(original, { state: "closed", checks }, false)).toBe(
original,
);
const blocked = { ...original, mergeBlocked: true };
const same = [...original.checks];
expect(
resolvePullRequestDetailChecks(
blocked,
{ state: "open", checks: same, mergeBlocked: false },
true,
)?.mergeBlocked,
).toBe(false);
expect(
resolvePullRequestDetailChecks(
original,
{ state: "open", checks: same, mergeBlocked: true },
true,
)?.mergeBlocked,
).toBe(true);
expect(resolvePullRequestDetailChecks(original, null, true)).toBe(original);
expect(resolvePullRequestDetailChecks(null, { state: "closed", checks }, true)).toBeNull();
});
Expand Down
4 changes: 3 additions & 1 deletion packages/client-runtime/src/pullRequestChecks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ export function resolvePullRequestDetailChecks(
!checks.checks.some((check) => check.status === "action-required")
? 0
: detail.workflowApprovalsRequired);
const { mergeBlocked: _staleBlock, ...rest } = detail;
return {
...detail,
...rest,
state: detail.state === "merged" ? "merged" : checks.state,
checks: checks.checks,
...(workflowApprovalsRequired === undefined ? {} : { workflowApprovalsRequired }),
...(checks.mergeBlocked === undefined ? {} : { mergeBlocked: checks.mergeBlocked }),
};
}

Expand Down
Loading
Loading