From 22d5fb064ba7e40d5ef8ed7a20c747cb0d6b5ad8 Mon Sep 17 00:00:00 2001 From: Danathar Date: Sat, 31 Oct 2026 15:46:23 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20automerge:=20name=20a=20standing?= =?UTF-8?q?=20change=20request=20in=20the=20review-required=20ask;=20no=20?= =?UTF-8?q?merge=20call=20on=20a=20conflicting=20head?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A. When GitHub refuses the merge for want of an approving review and a person's change request still stands (their latest opinionated review is CHANGES_REQUESTED, on any head), the stage/085-needs-decision comment now names the reviewer, the commit they reviewed and a compare link to what the hive pushed since, and asks them to re-review or a maintainer to dismiss the review, instead of asking anyone to Approve over it. noteStageReviews records StandingChangeRequests from the review list the lane already read; drain carries it onto the observation. PRs without a standing request keep today's text. Seen on projectbluefin/utah-packages #633: three 085 comments asked for an Approve while @hanthor's CHANGES_REQUESTED stood. B. The self-authored sweep re-checks mergeable_state on its merge-time re-read and skips a dirty head as conflicting, and a 405 "Pull Request has merge conflicts" from any lane is reported as conflicting instead of merge-failed (#633 called PUT /merge on a conflicting PR at 18:29Z and bounced 070 -> 080 -> 070). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar --- ...xed-merge-refused-review-change-request.md | 1 + .../stage-labels.md | 2 +- .../automerge_merge_change_request_test.go | 236 ++++++++++++++++++ .../automerge/automerge_merge_refusal.go | 21 ++ .../github/automerge/automerge_stage_human.go | 72 ++++++ .../automerge/automerge_stage_labels.go | 43 ++++ src/pkg/github/automerge/automerge_sweep.go | 23 ++ .../github/automerge/automerge_sweep_test.go | 21 +- src/pkg/stageengine/prstage/types.go | 17 ++ 9 files changed, 432 insertions(+), 4 deletions(-) create mode 100644 changelog.d/fixed-merge-refused-review-change-request.md create mode 100644 src/pkg/github/automerge/automerge_merge_change_request_test.go diff --git a/changelog.d/fixed-merge-refused-review-change-request.md b/changelog.d/fixed-merge-refused-review-change-request.md new file mode 100644 index 0000000000..becca85de6 --- /dev/null +++ b/changelog.d/fixed-merge-refused-review-change-request.md @@ -0,0 +1 @@ +- Automerge: when GitHub refuses a merge for want of an approving review and a person's change request still stands on the PR, the `stage/085-needs-decision` comment now names the reviewer, the commit they reviewed and what the hive pushed since. It asks them to re-review, or a maintainer to dismiss the review, instead of asking anyone for an Approve over it (projectbluefin/utah-packages#633). PRs without a standing change request keep the same text. The self-authored sweep also re-reads `mergeable_state` right before the merge call and skips a head GitHub now calls conflicting, and a 405 "Pull Request has merge conflicts" from any lane is reported as `conflicting` instead of `merge-failed`. diff --git a/src/docs/labels-and-control-signals/stage-labels.md b/src/docs/labels-and-control-signals/stage-labels.md index 0a69f2bd43..a1f3c73d60 100644 --- a/src/docs/labels-and-control-signals/stage-labels.md +++ b/src/docs/labels-and-control-signals/stage-labels.md @@ -376,7 +376,7 @@ used to admit the PR: | CI red (required or optional) on a **fork** PR while **every** failing check's annotation says the check refuses forks (case-insensitive `fork pull request(s) cannot`, `maintainer must push this branch`, or `cannot publish` together with `fork` — a fork-publication / fork-secrets guard) | `085-needs-decision`, reason `fork-guard:,`: never 070/071/072, never nudged, never adopted (074) — neither the author nor the hive can turn the check green by pushing to the fork. The entry comment names the check and says a maintainer must push the branch to the repository (or approve the run as the repository requires). A same-repo PR with the same message, or a fork PR with any other red check, is handed back as usual ([#14273](https://github.com/hivecommons/hive/issues/14273)) | | any **non-required** check on the current head is red, whatever the lane's reason (the lane gates on required checks only, so it still soaks and merges; a reader of the rollup sees ✗). Parking modifiers (`hold`, `needs-human`, admission reasons) still win | `070-fixing` / `071-needs-author` / `072-returned-to-contributor` (by author kind), reason `optional-check-failing:` (the nudge lists every red check); never 080 or 100. A red *required* check is the lane's own `required-check-failing:*` → 070/071/072 ([#12538](https://github.com/hivecommons/hive/issues/12538), seen on [#12457](https://github.com/hivecommons/hive/pull/12457)) | | `label:hold`, `held`, `label:needs-human`, `exempt-label`, `excluded-label:*`, `sentinel`, `human-merge-path*`, `intent-*`, `contributor-lane:workflow-path` / `tests-removed` / `no-reviewer` / `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: