Skip to content

πŸ› Stage: GitHub's transient mergeable "unknown" keeps the PR's stage - #19381

Merged
hivecommons-hive[bot] merged 2 commits into
hivecommons:v6from
Danathar:danathar/stage-mergeable-unknown-keeps-refusal
Nov 20, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
hivecommons:v6from
Danathar:danathar/stage-mergeable-unknown-keeps-refusal

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

GitHub reports a PR's mergeable_state as unknown for a moment while it recomputes the merge, which it does after the base moves. On those passes an unchanged PR could leave its stage and come back on the next pass:

Cause

  • On unknown, the contributor lane returns mergeable-unknown before admission, review or CI (contributorLaneConflictReason). That part is by design (πŸ› Keep conflicting contributor PRs out of human-merge stageΒ #12859: unknown means wait).
  • The stage engine had no rule for that reason. It fell through to "approved head, nothing left for the author", which is a weak 080 whenever a verdict had been noted in that drain window.
  • With the contributor lane silent, another lane's weak opinion could also win. For example, the trusted-author lane's untrusted-author-role gives a 090 candidate, so a conflicting PR at 072 could read 090 for a pass.
  • noteMergeTrainOutcome treated the unevaluated pass like a handoff and deleted the human-merge verdict.

Fix

mergeable-unknown is now "no opinion", the same way base-refresh:merge-guard is (#16819):

  • ClassifyStage abstains for it (new constant prstage.StageReasonMergeableUnknown).
  • ResolveStage drops other lanes' weak opinions on a pass where a lane reported it, and abstains under that reason. An owned opinion from another lane, such as a red required check, still applies. The reconciler (derivePR) goes through the same function, so both agree.
  • noteMergeTrainOutcome ignores it, so the head's human-merge verdict survives.
  • The lane is unchanged: unknown still stops before admission. A first fix that let it run admission was dropped after review, because it made a refused, conflicting PR at 072 read 090.
  • Docs: the stage-labels "no opinion" row now lists it.

Known limits:

  • A stage stays held for as long as GitHub keeps answering unknown. Normally that is one pass, because the read itself makes GitHub compute the merge. It is the same open-ended shape as the merge guard.
  • A brand-new PR, or one newly entering a weak 085, gets its stage one pass later.

Tests

  • stageengine: TestClassifyStageMergeableUnknownIsNoOpinion covers the reason with and without a verdict. TestResolveStageMergeableUnknownKeepsTheStage covers the contributor lane alone and with a weak trust opinion; derivePR abstains on mergeable-unknown, and an owned opinion still wins.
  • Stage labels, with alternating unknown and evaluated passes:
    • TestMergeableUnknownPassKeepsHumanMerge: a no-linked-issue PR stays at 090.
    • TestMergeableUnknownPassKeepsConflictReturn: a conflicting, refused PR stays at 072.
    • TestMergeableUnknownPassKeepsAdmittedStage: a soaking PR stays at 095.
    • Each has zero writes on the unknown passes.
  • Merge train: TestMergeTrainUnknownOutcomeKeepsHumanMergeVerdict.
  • Lane skip reasons: unknown still stops before admission, and a conflict outranks no-linked-issue.

Nothing was run locally (AGENTS.md). gofmt -l and the docs citation check are clean, and CI is the first build.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

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
(hivecommons#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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 20, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 20, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit bcbfc24 into hivecommons:v6 Nov 20, 2026
71 of 72 checks passed
@hivecommons-hive

hivecommons-hive Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

Evidence bundle `#19381a98c0a9` sha256:23e000038c093d4b5ef8051daa12aba707142f462b577d6f05db121c26c61987 β€” download from the dashboard or `hivectl review evidence #19381`.

merged by Hive trusted-author auto-merge: author Danathar holds role owner and GitHub permission maintain on repo; CI green at a98c0a9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant