Repository navigation
✨ auto-merge: breaking-titled or needs-owner-merge PRs wait for a human - #15485
Conversation
One shared predicate, automerge.RequiresHumanMerge(pr), runs where every lane (self, queued, trusted-author, contributor) and the merge train compute eligibility: a PR whose trimmed title starts with⚠️ /⚠ or that carries needs-owner-merge is never merged by hive. The tracker parks it at 090 'Ready for human merge' with the 'human merge' chip and the reason 'breaking change — owner merges'; Approve & merge as maintainer is the lead action and hive posts one writeback-gated comment saying it waits. Configurable via auto_merge.human_merge_title_prefixes / human_merge_labels. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>
|
@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply. |
|
stage 080-awaiting-merge-admission → 050-review-pending: required-check-pending:Sign-off survives the squash |
|
@clubanderson this PR is held at Failing checks:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. |
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether the agent merge-request relay (hive-merge) must also refuse a
Read against the tree at pr15485 head. The predicate and the sweep wiring are sound; there is one path the new rule does not cover, and the docs promise that it does.
Gap: the merge-request relay still merges a
src/pkg/github/automerge/automerge_relay_gate.go:65-72— the relay lane gate returns""(admit) as soon as the author is hive-authored (sweepLaneForAuthor) or passestrustedAuthorDecision, before any prefilter runs.humanMergeRequiredReasonis only reached for contributor-tier authors viaprefilterContributorLanePR(automerge_contributor_lane.go:530).src/pkg/github/merge_request_watcher.go:413-425— the relay's own terminal refusals aremergeRequestHumanMergePathRefusal(paths) and thenmergePolicyGate(the gate above). Neither evaluatesHumanMergeRule.- Consequence: an agent running
hive-merge <n>on a⚠️ -titled PR authored by the App or by a trusted author merges it. That is the same author class as the incident this PR cites (trusted-author lane merged a⚠️ PR), just entered through the relay instead of the sweep. src/docs/hive-merge.md(new section, "is never merged by hive") andoperator-reference.md("a matching PR is never merged by hive … however green and however approved") state a guarantee the code does not give. Thehuman_merge_pathsrow right above it is explicit that the relay is covered, which is the model readers will assume.
Fix shape is small: evaluate RequiresHumanMerge(pr.Title, labels) next to the paths refusal in merge_request_watcher.go (or at the top of the relay gate before the hive-authored / trusted early-returns) and deny with the same reason code. If the intended scope is "sweeps and train only, the relay is a deliberate human-driven path", say so in the docs instead — but that needs the owner's call, which is the question above.
Verified and fine:
prstage/human_merge.go:25-54— nil-vs-empty semantics match the config docs;TrimSpaceon both title and prefix means"⚠️ foo"and" ⚠ foo"match and""prefixes are ignored.- Rule is applied on the refetched PR in
trySweepSelfAuthoredPR(automerge_sweep.go:1789) andtrySweepQueuedPR(:2615);trySweepTrustedAuthorPR(:2264) re-runsprefilterTrustedAuthorPRon the refetched PR, which includes it (:2205). So a title edited after listing is caught in all three. - The 090 entry comment goes through
writebackAllowed(automerge_stage_human.go:454-463) and a refusal leaves the record unmarked, as described.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 080-awaiting-merge-admission → 050-review-pending: required-check-pending:build-and-test |
…n-nil Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Fixes #15483
What
PR #15442 (⚠️ -titled = breaking change) was auto-merged by the trusted-author lane while the owner was still deciding whether to ship it. This adds one rule: breaking-titled or
needs-owner-merge-labelled PRs never auto-merge.How
prstage.HumanMergeRule.RequiresHumanMerge(title, labels), surfaced asautomerge.RequiresHumanMerge(pr)/(*Engine).RequiresHumanMerge(pr). True when the trimmed title starts with⚠️/⚠(U+26A0 ± VS16, configurableauto_merge.human_merge_title_prefixes) or any label matchesauto_merge.human_merge_labels(defaultneeds-owner-merge, case-insensitive). Empty list = that half is off.prefilterSelfAuthoredPR,prefilterQueuedIssue,prefilterTrustedAuthorPR,prefilterContributorLanePR, plus the refetch pathstrySweepSelfAuthoredPR/trySweepQueuedPR.planMergeTrainsdraws candidates from the same prefilters, so such PRs never front or ride a train.derive_pr_classify.go) returns an owned 090 human verdict;RouteHumanyields aManualMergeroute with reason breaking change — owner merges. Tracker: caption Ready for human merge (breaking change — owner merges), chiphuman merge(human_merge_reason: breaking-change),new.gates[]names the gate on 000 rows. Lead action is the existing gated Approve & merge as maintainer; Approve — let hive merge is greyed ("Hive never merges a breaking change"). No new direct GitHub write path.postHumanEntryposts the once-only "hive waits for a human" entry viawritebackAllowed(KindNeedsDecisionComment) for this reason.HumanMergeRule()accessor; wired incmd/hive/main.gofor all threeautomerge.Optionssites.Tests
TestRequiresHumanMergeDefaults/TestRequiresHumanMergeConfiguredRule(VS16 ± , leading whitespace, label case, empty-list off)TestHumanMergeRequiredSkipsEveryLanePrefilter,TestSweepTrustedAuthorSkipsBreakingTitle,TestPlanMergeTrainsExcludesHumanMergePRautomerge_stage_labels_test.go;TestStageTrackerHumanMergeRequiredRow+ caption/humanize rows; JS word assertions in the sentinel-lane harnesstime.Sleep;go generate ./pkg/dashboard/...run,static/index.htmlcommitted.go build ./... && go test ./pkg/github/automerge/... ./pkg/dashboard/... ./pkg/writeback/... ./pkg/stageengine/... ./pkg/stagelabels/... ./pkg/config/...andgo vetpass.