Skip to content

πŸ› automerge: withdraw native-queue entries on release freeze and human merge path - #15781

Merged
hivecommons-hive[bot] merged 19 commits into
v5from
scanner/fix-15517
Oct 30, 2026
Merged

hivecommons-hive[bot] merged 19 commits into
v5from
scanner/fix-15517

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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. nativeQueueWithdrawReason now includes release-in-progress and human-merge-path; the withdraw test table covers both.

Closes #15517

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

…n merge path

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 30, 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 nicholasjackson 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#15853 ✨ Complete native GitHub queue CI and policy integration same files src/docs/native-merge-queue.md

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me β€” read the two new reason emitters, not just the table.

  • release-in-progress is exactly the string releaseHoldActive returns (src/pkg/github/automerge/automerge_sweep.go:525,1774), and autoMergeReasonHumanMergePath is what humanMergePathGate returns on a match (automerge_human_paths.go:75-77), so both now reach nativeQueueWithdrawReason β†’ 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: tryNativeQueue re-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.
  • TestNativeQueueGateWithdrawsOnlyHiveEntries now 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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the code path, not just the diff: looks correct to me, with one docs follow-up.

Correctness (verified against the tree at c19140c)

  • releaseInProgressStatusContext is the literal reason releaseHoldActive returns (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 reaches reconcileNativeQueueGate unchanged.
  • autoMergeReasonHumanMergePath is what humanMergePathGate returns 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:140 covers 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>
@hivecommons-hive hivecommons-hive Bot removed the stage/050-review-pending Review swarm requested; awaiting a verdict for the current head label Oct 30, 2026
@kubestellar-prow kubestellar-prow Bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 30, 2026
@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 30, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me; matches #15517 exactly.

Verified against the tree at 2d55201:

  • automerge_sweep.go:1930/2451/2825 β€” all three releaseHoldActive callers return releaseInProgressStatusContext ("release-in-progress", automerge_sweep.go:540) as the lane's reason, which reaches reconcileNativeQueueGate via the existing reason plumbing (automerge_sweep.go:1021/1156/1393/2728, automerge_contributor_lane.go:440). So the new case in nativeQueueWithdrawReason (automerge_native_queue.go:152) actually fires.
  • automerge_human_paths.go:75-77 β€” humanMergePathGate returns autoMergeReasonHumanMergePath on a match (and also adds hold, so the next tick would have withdrawn via label:hold anyway; 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:140 exercises 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

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 060-reviewed β†’ 050-review-pending: required-check-pending:build-and-test

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 at automerge_sweep.go:1799 when the pending release-in-progress status is fresh, so adding it to nativeQueueWithdrawReason (automerge_native_queue.go:152) hits the real string.
  • autoMergeReasonHumanMergePath is what humanMergePathGate returns on a match (automerge_human_paths.go:75-77). Leaving autoMergeReasonHumanMergePathEvidence out 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 hold label (automerge_human_paths.go:72), so without this PR the entry would still have been withdrawn via held/label:hold on 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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 bare releaseInProgressStatusContext string, 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 to reconcileNativeQueueGate (automerge_sweep.go:1156,1393, automerge_contributor_lane.go:440). The API-error path returns release-hold-check instead, which stays outside the withdraw set β€” so a flaky status read still does not withdraw an entry.
  • autoMergeReasonHumanMergePath is likewise returned bare at automerge_human_paths.go:75-77, including when HoldForHumanMergePaths fails to apply the label β€” withdrawing in that case is the safe direction.
  • reconcileNativeQueueGate (automerge_native_queue.go:301-312) still gates on ownNativeQueueEntry, 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-51 updated 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

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 060-reviewed β†’ 050-review-pending: required-check-pending:Sign-off survives the squash

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 string releaseHoldActive returns as the rejection reason when the hold is active (automerge_sweep.go:1818), and every caller hands it straight back as the lane's reason (automerge_sweep.go:1949-1953, automerge_contributor_lane.go:1413-1417), which is what reconcileNativeQueueGate passes into nativeQueueWithdrawReason (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.
  • autoMergeReasonHumanMergePath is 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

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 060-reviewed β†’ 050-review-pending: required-check-pending:build-and-test

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 at automerge_sweep.go:1823, and the trusted sweep forwards that reason through stage(reason, …) at automerge_sweep.go:1469 β†’ reconcileNativeQueueGate at automerge_sweep.go:1411-1412, which is the only place nativeQueueWithdrawReason is consulted (automerge_native_queue.go:303). So the change is not a no-op.
  • autoMergeReasonHumanMergePath is returned after HoldForHumanMergePaths adds hold (automerge_human_paths.go:73-77); held/label:hold already 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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the diff against v5 and traced both new reasons to the gate. Looks correct to me.

  • release-in-progress is returned verbatim by releaseHoldActive (src/pkg/github/automerge/automerge_sweep.go:1829) and handed to reconcileNativeQueueGate unchanged via the reason return at :1960-1963 (and the deferred call at :2790), so the new case at automerge_native_queue.go:152 matches what the lane actually emits. The stale-status path (:1830) returns "", so an expired freeze never withdraws.
  • human-merge-path is likewise returned as-is by humanMergePathGate (automerge_human_paths.go:75-77). The sibling human-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.md and 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

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit e2d2a4c into v5 Oct 30, 2026
77 of 78 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#15781355423d` sha256:113d8cc1afda0db38d998be160e81cc38da8f6d26d51a00d7557c34112bf81ff β€” download from the dashboard or `hivectl review evidence #15781`.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-15517 branch October 30, 2026 20:22
@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review backlog (security): Native-queue withdrawal no longer triggers on release-in-progress or human-merge-path

0 participants