Repository navigation
π automerge: withdraw native-queue entries on release freeze and human merge path - #15781
Conversation
β¦n merge path Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.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 |
|
hive/awaiting-ci: CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Looks correct to me β read the two new reason emitters, not just the table.
release-in-progressis exactly the stringreleaseHoldActivereturns (src/pkg/github/automerge/automerge_sweep.go:525,1774), andautoMergeReasonHumanMergePathis whathumanMergePathGatereturns on a match (automerge_human_paths.go:75-77), so both now reachnativeQueueWithdrawReasonβreconcileNativeQueueGate(automerge_native_queue.go:303) as withdrawals.- The release freeze is transient (
releaseInProgressMaxAge= 10m), so withdrawing matters only if the entry comes back afterwards:tryNativeQueuere-enqueues on the next eligible tick and explicitly refuses to let the prior applied journal entry suppress it (automerge_native_queue.go:263-268). Nothing is lost by withdrawing. TestNativeQueueGateWithdrawsOnlyHiveEntriesnow covers both reasons Γ every actor shape, and it fails on v5 without the table change.
No findings. CI was still in progress (build arm64, tide) when I read it.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the code path, not just the diff: looks correct to me, with one docs follow-up.
Correctness (verified against the tree at c19140c)
releaseInProgressStatusContextis the literal reasonreleaseHoldActivereturns (src/pkg/github/automerge/automerge_sweep.go:1799), and every lane that calls it returns that string as its rejection reason (automerge_sweep.go:1930-1934,:2451,:2825,automerge_contributor_lane.go:1408), so it reachesreconcileNativeQueueGateunchanged.autoMergeReasonHumanMergePathis whathumanMergePathGatereturns on a match (automerge_human_paths.go:75-77) and is surfaced the same way (automerge_sweep.go:1979,:2467,:2844). The evidence-failure variant (β¦HumanMergePathEvidence,:67) is deliberately not in the withdraw set β correct, since that is a read error, not an eligibility loss.- A release hold is transient (β€
releaseInProgressMaxAge, 10 min). Withdrawing on it is safe because the queued lane re-enqueues on the next eligible sweep and the journal explicitly never suppresses re-enqueue (automerge_native_queue.go:263-268). - The test table extension in
automerge_native_queue_test.go:140covers both new reasons across all five actor variants. Package builds.
Docs currency (low, suggest fixing in this PR)
src/docs/native-merge-queue.md:48-52 enumerates the eligibility-loss reasons that trigger withdrawal ("a hold or do-not-merge/needs-human label, a removed merger label, β¦ changes requested, or a draft or closed PR"). It should now also list a release in progress and a human-merge-path hold, otherwise the operator reference contradicts the code this PR ships.
Intent matches #15517 exactly (the review-backlog finding named precisely these two reasons). Changelog fragment name/category is valid.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
β¦awal triggers Hive-Fix-Attempt: 1/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Looks correct to me; matches #15517 exactly.
Verified against the tree at 2d55201:
automerge_sweep.go:1930/2451/2825β all threereleaseHoldActivecallers returnreleaseInProgressStatusContext("release-in-progress",automerge_sweep.go:540) as the lane'sreason, which reachesreconcileNativeQueueGatevia the existingreasonplumbing (automerge_sweep.go:1021/1156/1393/2728,automerge_contributor_lane.go:440). So the new case innativeQueueWithdrawReason(automerge_native_queue.go:152) actually fires.automerge_human_paths.go:75-77βhumanMergePathGatereturnsautoMergeReasonHumanMergePathon a match (and also addshold, so the next tick would have withdrawn vialabel:holdanyway; this PR just makes it happen on the same tick).autoMergeReasonHumanMergePathEvidence(fetch failure,automerge_human_paths.go:69) is deliberately not added β correct, that is a transient API error and the policy keeps the entry on those.- Test table at
automerge_native_queue_test.go:140exercises both new reasons against all five enqueuer actors.
Docs and changelog fragment updated in step. Nothing further from me.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 060-reviewed β 050-review-pending: required-check-pending:build-and-test |
There was a problem hiding this comment.
Read nativeQueueWithdrawReason (src/pkg/github/automerge/automerge_native_queue.go:145-156) and traced both new reasons to their emitters: releaseInProgressStatusContext is returned as the lane reason at automerge_sweep.go:1799, and autoMergeReasonHumanMergePath at automerge_human_paths.go:75-77. Both are genuine loss-of-eligibility outcomes, so withdrawing the App's own queue entry is consistent with the rule the function already implements. The sibling autoMergeReasonHumanMergePathEvidence (automerge_human_paths.go:67, returned when the changed-file list could not be fetched) is correctly left out β it is a transient API-read failure and the comment's "API read errors keep the entry" rule applies. Table test and native-merge-queue.md updated in step. Looks correct to me; no findings.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the withdraw path and both reason sources at the reviewed head (5b1569e). This looks correct to me.
releaseInProgressStatusContext(automerge_sweep.go:540) is returned verbatim as the lane rejection reason atautomerge_sweep.go:1799when the pendingrelease-in-progressstatus is fresh, so adding it tonativeQueueWithdrawReason(automerge_native_queue.go:152) hits the real string.autoMergeReasonHumanMergePathis whathumanMergePathGatereturns on a match (automerge_human_paths.go:75-77). LeavingautoMergeReasonHumanMergePathEvidenceout is right: that is the fail-closed API-error branch (:67), i.e. a transient read error, which the function's doc already says keeps the entry.- Worth knowing, not a defect: the human-merge-path gate also applies the
holdlabel (automerge_human_paths.go:72), so without this PR the entry would still have been withdrawn viaheld/label:holdon the following tick. The change makes the withdrawal happen on the tick that detects the match and covers the case where the label write fails.
The withdraw-reason table test now covers both reasons across all five enqueuer actors.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Traced both new reasons from their emit sites to the native-queue gate at merge-base 074530a; this looks correct to me.
releaseHoldActive(src/pkg/github/automerge/automerge_sweep.go:1799) returns the barereleaseInProgressStatusContextstring, and every caller (automerge_sweep.go:1930,2451,2825,automerge_contributor_lane.go:1408) returns that reason unchanged to the lane, which hands it verbatim toreconcileNativeQueueGate(automerge_sweep.go:1156,1393,automerge_contributor_lane.go:440). The API-error path returnsrelease-hold-checkinstead, which stays outside the withdraw set β so a flaky status read still does not withdraw an entry.autoMergeReasonHumanMergePathis likewise returned bare atautomerge_human_paths.go:75-77, including whenHoldForHumanMergePathsfails to apply the label β withdrawing in that case is the safe direction.reconcileNativeQueueGate(automerge_native_queue.go:301-312) still gates onownNativeQueueEntry, so the widened reason set only ever touches the App's own entries. The extended table test covers both reasons against the non-App actors.src/docs/native-merge-queue.md:48-51updated to match.
Scope matches #15517 exactly. Nothing further from me.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 060-reviewed β 050-review-pending: required-check-pending:Sign-off survives the squash |
There was a problem hiding this comment.
Read automerge_native_queue.go at 8907c1f and traced both new reasons back to where the lanes emit them:
releaseInProgressStatusContext("release-in-progress",automerge_sweep.go:547) is the stringreleaseHoldActivereturns as the rejection reason when the hold is active (automerge_sweep.go:1818), and every caller hands it straight back as the lane'sreason(automerge_sweep.go:1949-1953,automerge_contributor_lane.go:1413-1417), which is whatreconcileNativeQueueGatepasses intonativeQueueWithdrawReason(automerge_native_queue.go:303). The API-error path returns"release-hold-check"instead, which is not in the list β so a transient status-read failure keeps the entry, consistent with the "API read errors keep the entry" rule the doc states.autoMergeReasonHumanMergePathis the reason the human-paths gate returns on both its success and error paths (automerge_human_paths.go:75-77), and it is already treated as an eligibility-loss reason by the stage router (automerge_stage_human.go:446), so withdrawing the queue entry on it is consistent with how the rest of the engine classifies it.
TestNativeQueueGateWithdrawsOnlyHiveEntries now iterates both reasons across all five actor identities, and docs/native-merge-queue.md:48-51 lists them. This matches the two triggers #15517 asked for, with no other reason-list changes.
Looks correct to me; no changes requested. Waiting on a human's approval.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 060-reviewed β 050-review-pending: required-check-pending:build-and-test |
There was a problem hiding this comment.
Read the tree at merge-base, not just the diff. This looks correct to me.
- Both new reasons are real constants that reach the gate:
releaseInProgressStatusContext(src/pkg/github/automerge/automerge_sweep.go:552) is returned by the release-hold check atautomerge_sweep.go:1823, and the trusted sweep forwards that reason throughstage(reason, β¦)atautomerge_sweep.go:1469βreconcileNativeQueueGateatautomerge_sweep.go:1411-1412, which is the only placenativeQueueWithdrawReasonis consulted (automerge_native_queue.go:303). So the change is not a no-op. autoMergeReasonHumanMergePathis returned afterHoldForHumanMergePathsaddshold(automerge_human_paths.go:73-77);held/label:holdalready withdrew, so this just makes the withdrawal happen on the same tick instead of the next one. Consistent, no new behaviour class.- Release freeze is temporary; so is
nativeQueueReasonPaused, which was already on the list, so re-enqueue-after-recovery is already the accepted contract here.
Test table extension covers both reasons across all five actors. CI is green on e6f002b.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the diff against v5 and traced both new reasons to the gate. Looks correct to me.
release-in-progressis returned verbatim byreleaseHoldActive(src/pkg/github/automerge/automerge_sweep.go:1829) and handed toreconcileNativeQueueGateunchanged via thereasonreturn at:1960-1963(and the deferred call at:2790), so the newcaseatautomerge_native_queue.go:152matches what the lane actually emits. The stale-status path (:1830) returns"", so an expired freeze never withdraws.human-merge-pathis likewise returned as-is byhumanMergePathGate(automerge_human_paths.go:75-77). The siblinghuman-merge-path-evidence(:66-67) is an API read failure that fails closed, so leaving it out is the right call β it is the "API read errors keep the entry" class the doc paragraph already describes, not a lost-eligibility signal.go build ./pkg/github/automerge/clean at this head;native-merge-queue.mdand the test table are updated to match.
Body matches the diff.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
An enqueued PR must not keep merging through GitHub's native queue during a release freeze or once a human merge path applies β both are withdrawal triggers stated in #15198.
nativeQueueWithdrawReasonnow includesrelease-in-progressandhuman-merge-path; the withdraw test table covers both.Closes #15517
β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88