From bab6a9f1a92df80908391e37eb81eadff906df15 Mon Sep 17 00:00:00 2001 From: Danathar <6772335+Danathar@users.noreply.github.com> Date: Fri, 20 Nov 2026 05:53:46 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Stage:=20GitHub's=20transient=20?= =?UTF-8?q?mergeable=20"unknown"=20keeps=20the=20PR's=20stage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitHub reports mergeable_state "unknown" while it recomputes a merge, and the contributor lane then stops before admission, review or CI with reason mergeable-unknown. The stage engine read that as an approved head with nothing left for its author (a weak 080), and another lane's weak opinion could stand in for the silent contributor lane, so an unchanged head dropped for one pass: projectbluefin/utah-packages#1222 went 090 -> 080 -> 090 on a no-linked-issue refusal, and a conflicting PR at 072 could read 090. mergeable-unknown is now "no opinion", like base-refresh:merge-guard (#16819): ClassifyStage abstains, ResolveStage drops other lanes' weak opinions on such a pass (an owned opinion still applies), and the merge train keeps the head's human-merge verdict instead of clearing it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com> --- .../fixed-mergeable-unknown-keeps-refusal.md | 1 + .../stage-labels.md | 2 +- .../automerge/automerge_contributor_lane.go | 2 +- .../automerge_contributor_lane_test.go | 11 ++ .../github/automerge/automerge_merge_train.go | 8 +- .../automerge_stage_mergeable_unknown_test.go | 182 ++++++++++++++++++ src/pkg/stageengine/derive_pr_classify.go | 32 ++- .../derive_pr_mergeable_unknown_test.go | 60 ++++++ src/pkg/stageengine/prstage/reasons.go | 11 +- 9 files changed, 301 insertions(+), 8 deletions(-) create mode 100644 changelog.d/fixed-mergeable-unknown-keeps-refusal.md create mode 100644 src/pkg/github/automerge/automerge_stage_mergeable_unknown_test.go create mode 100644 src/pkg/stageengine/derive_pr_mergeable_unknown_test.go diff --git a/changelog.d/fixed-mergeable-unknown-keeps-refusal.md b/changelog.d/fixed-mergeable-unknown-keeps-refusal.md new file mode 100644 index 0000000000..9d4973b9b1 --- /dev/null +++ b/changelog.d/fixed-mergeable-unknown-keeps-refusal.md @@ -0,0 +1 @@ +- Stage labels: a pass where GitHub reports a PR's mergeable state as `unknown`, which it does while it recomputes the merge after the base moves, no longer changes the PR's stage. The contributor lane stops on `mergeable-unknown` before admission, review or CI, and an approved head read as "nothing left for the author" became a weak `stage/080-awaiting-merge-admission` for that pass: a PR waiting on a person's merge for `contributor-lane:no-linked-issue` went 090 → 080 → 090, an admitted PR at 095 or 100 dropped to 080, and a conflicting PR at 072 could take the trusted-author lane's 090 for a pass. `mergeable-unknown` is now no stage opinion, like the destination-merge guard (#16819), and another lane's weak opinion does not stand in for it; an owned opinion from another lane still applies. The pass also keeps the lane's merge-train verdict on the head instead of clearing it, so a person's merge stays out of the train. [projectbluefin/utah-packages#1222](https://github.com/projectbluefin/utah-packages/pull/1222) flipped 090 → 080 → 090 twice in one evening this way. diff --git a/src/docs/labels-and-control-signals/stage-labels.md b/src/docs/labels-and-control-signals/stage-labels.md index 5a2dd4d892..7316869517 100644 --- a/src/docs/labels-and-control-signals/stage-labels.md +++ b/src/docs/labels-and-control-signals/stage-labels.md @@ -420,7 +420,7 @@ used to admit the PR: | `label:needs-human`, `exempt-label`, `excluded-label:*`, `human-merge-path*`, `intent-*`, `contributor-lane:workflow-path` / `tests-removed` / `no-reviewer` / `review-off` (a verdict is required but the review swarm is off, so none will be requested) / `reporter-trust-hold`, `workflow-permission` (GitHub refused update-branch or the merge-forward with a 403 because the base changed `.github/workflows/` and the token the hive used lacks the workflows permission; no token the hive holds can push that update, so it is not sent to 070), `fork-workflow-update` (the same update-branch refusal on a fork head: the App is not installed on the fork, so no grant lets it push there), `linked-issue:hold:#N: