Skip to content

✨ feature: enqueue eligible PRs into GitHub native merge queues - #15308

Merged
clubanderson merged 13 commits into
v5from
hive/adopt-15226
Oct 30, 2026
Merged

clubanderson merged 13 commits into
v5from
hive/adopt-15226

Conversation

@hivecommons-hive

@hivecommons-hive hivecommons-hive Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Supersedes #15226 (adopted after CI went red and the contributor was unavailable; original commits by @thatguywob preserved).

Closes #15198

This branch starts from #15226's head 4412365d62c8 as pushed by @thatguywob (fork thatguywob/hive); the original commit (now 41fc37875 after the rebase onto v5) and its Signed-off-by are preserved. Follow-up commits on top (hashes are pre-rebase):

  • bce4d0999 throttle native merge queue reconciliation on paused repos
  • d2601f0b4 match the native queue enqueuer by bot slug and share queue reasons
  • 986591112 keep the own native queue entry on queue error reasons
  • 8a4a2afe1 docs: list real withdrawal triggers and method-failure routing
  • ba4544287 park mixed-authorship PRs on a SQUASH native queue at stage/085 (🐛 fix: park mixed-authorship PRs on a SQUASH native queue at stage/085 #15380)
  • e46ab67fc address the adjudicator review findings at ba45442:
    • Queued lane: a blocked/behind PR on a queue-enabled base is enqueued instead of stopping at not-mergeable (which also withdrew Hive's own entry).
    • Current-base gate (⚠️ auto-merge: require a current base before merging by default (opt-out per repo) #15442): self, trusted and contributor lanes skip the behind update-branch and the default-on require_current_base gate on a queue-enabled base; the merge group tests the merged result, and a pushed head would drop the PR from the queue. Documented in src/docs/native-merge-queue.md.
    • Withdrawal: the App's own entry is dequeued only on an explicit allowlist of eligibility-loss reasons (holds, approval removed/stale/untrusted, changes requested, paused/disabled repo, draft/closed). Transient reasons (behind, not-mergeable, pending checks, moved head, API errors) keep the entry.
    • Identity: the own entry is matched by enqueuer __typename == "Bot" as well as login slug.
    • Changelog: the 085 routing note is folded into changelog.d/added-native-merge-queue.md, and the fixed-native-queue-method-refusal.md fragment is deleted.

Table tests in automerge_native_queue_test.go cover each behavior change.

Taken over by hand

Taken over by @clubanderson's operator at his request after the hive's fixer exhausted its attempts. The branch was rebased onto v5 (the 15 automated Merge branch 'v5' commits are gone; @thatguywob's commit and the hive's fix commits are preserved with their authorship) and one new commit, cb0e58fa9, addresses the three standing review findings:

  1. Opt-in, per repo. New auto_merge.native_merge_queue.enabled (default off) and auto_merge.native_merge_queue.repos: [] (owner/repo allow-list; empty = every watched repo once enabled). config.NativeMergeQueueAutoMergeConfig with EnabledFor/RepoSet/EffectiveProbeTTL accessors follows the TrustedAuthorAutoMergeConfig pattern; cmd/hive/main_sweeps.go wires it into automerge.Options.NativeMergeQueue. With the zero policy no lane probes, enqueues, withdraws an entry or lists a paused repo's PRs, so hives without queues see zero behaviour change (merge-queue-required still parks). The settings-parity allowlist, the agent-runtime config golden and src/docs/native-merge-queue.md + operator-reference.md are updated. Tests: TestNativeQueueIsOptInPerRepo, TestInactiveQueueReconcileSkipsUnlistedRepos, TestNativeMergeQueueAutoMergeConfigIsOptInPerRepo, …ParsesYAML.
  2. require_current_base stays in force on queue bases. The silent && !queueEnabled() bypass of the current-base gate and the behind update-branch in the self, trusted and contributor lanes is gone. Both gates run on a queue base exactly as on any other base unless the operator sets the new, documented auto_merge.native_merge_queue.skip_current_base_gate: true (default false). Test: TestNativeQueueCurrentBaseGateIsExplicit (replaces TestNativeQueueSkipsCurrentBaseUpdate).
  3. API cost. isMergeQueueEnabled is cached per owner/repo#base for auto_merge.native_merge_queue.probe_ttl (default 30m; read failures are not cached; tryNativeQueue refreshes the cache from the read it already does). The per-held-PR reconcileNativeQueueGate, the extra PullRequests.Get in the queued prefilter and the 10-minute paused-repo PR listing all run only on opted-in repos. Test: TestNativeQueueProbeIsCachedPerBase.

The changelog fragment changelog.d/added-native-merge-queue.md now describes the opt-in, the explicit gate and the probe cache.

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 29, 2026
@kubestellar-prow kubestellar-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Docs map: this PR adds page(s) under src/docs/ that
src/docs/documentation-map.md does not link:

  • native-merge-queue.md

A page missing from the map is one readers do not find. Please add a
line in the section a reader would actually look in, matching the
format of its neighbours.

If the page is indexed from a subdirectory README, or is deliberately
unlisted for now, ignore this. It is a reminder, not a gate; it never
blocks a merge.

@github-actions

github-actions Bot commented Oct 29, 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
#15763 🐛 merge train: ready PRs lead; odometer rolls only after the bee lands CONFLICT src/pkg/stageengine/derive_pr_classify.go
#15765 🐛 fix: advisory checklists resolve themselves and never park on a person same files src/docs/operator-reference.md
src/pkg/config/config.go
src/pkg/config/testdata/agent_runtime_golden.json
src/pkg/dashboard/settings_parity_allowlist.txt
#15755 🐛 [reviewer] carry operator decision over the hive's base refresh same files src/pkg/github/automerge/automerge_contributor_lane.go
src/pkg/github/automerge/automerge_sweep.go
#15731 📖 docs: split the operator reference CONFLICT src/docs/operator-reference.md
#15750 🐛 Reconcile launch_cmd on backend switch and degrade instead of crash-looping on a base-config contradiction same files src/pkg/config/config.go
#15757 ✨ Auto-merge hive-authored superseding PRs without operator decision CONFLICT src/docs/operator-reference.md
src/pkg/config/config.go
src/pkg/config/testdata/agent_runtime_golden.json
src/pkg/dashboard/settings_parity_allowlist.txt
#15748 🐛 [reviewer] park PRs at 085 Needs decision when the fixer exhausted its attempts same files src/cmd/hive/main_sweeps.go
src/pkg/github/automerge/automerge_sweep.go
src/pkg/stageengine/derive_pr_classify.go
#15767 🐛 Auto-resolve hive advisory checklists and fix issue-type delegated plan wording same files src/docs/operator-reference.md
src/pkg/config/config.go
src/pkg/config/testdata/agent_runtime_golden.json
src/pkg/dashboard/settings_parity_allowlist.txt

@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 29, 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.

Conclusion: the enqueue/dequeue mechanics look right and keep the existing gates; one cost path on paused repositories is unbounded and I think needs a memo before this lands.

What I verified (read automerge_native_queue.go, native_merge_queue.go, the sweep wiring):

  • tryNativeQueue (automerge_native_queue.go:33-105) runs only after the lane's mergeClaim is built, pins expectedHeadOid to the evaluated head (:44-46, :86), re-keys the claim per REMOVED_FROM_MERGE_QUEUE_EVENT so a removal gets a fresh attempt (:66-71), and preserves the mixed-authorship merge-commit gate by reading the branch's queue method (:49-64). Good.
  • reconcileNativeQueueGate (:109-161) nil-guards pr, so the defer in trySweepQueuedPR is safe on early returns, and the dequeue closure re-reads provenance immediately before the write (:141-148) so a human's re-enqueue is never withdrawn. Good.
  • NativeMergeQueueAvailable (native_merge_queue.go:28) requires App auth, which matches the merge_group trigger constraint the comment cites.

Finding (medium) — per-sweep API fan-out on paused/disallowed repos:
SweepQueuedAutoMerges calls reconcileInactiveNativeQueues unconditionally at automerge_sweep.go:893. For every repo that is paused or has automerge disallowed (automerge_native_queue.go:172-174) it pages GET /pulls?state=open (:177-181) and then, per open PR, reconcileNativeQueueGate with lane "inactive" reaches ReadNativeMergeQueue (:126) — one GraphQL query per PR. None of the early returns at :111-124 fire for "inactive" + "repo-paused-or-disabled". Nothing is cached between sweeps and nothing checks isMergeQueueEnabled once per repo first.

Consequence: a paused repo with 200 open PRs costs ~2 REST pages + 200 GraphQL points on every queued sweep, for as long as it stays paused — the exact state an operator chooses to stop traffic. TestNativeQueuePauseWithdrawsOwnEntry covers the behaviour but not the repeat cost.

Suggestions (either is enough): remember per repo that no App-owned entry was found and skip until the repo's pause/allow state changes; or query repository.mergeQueue(branch) once per repo and skip repos where the queue is not enabled before listing PRs.

Not a correctness bug in what it does, but it ships a standing API bill on every hive with a paused repo, so I'd fix it before merge.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@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/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 29, 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.

Reviewed — no findings from this perspective.

— 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.

Reviewed — no findings from this perspective.

— hive: agent=adjudicator 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.

Docs-currency review (read at head e8a41cf).

  1. Stage-reason table not updated for the new reasons — src/docs/labels-and-control-signals.md:487 is the operator-facing reason → stage table. src/pkg/stageengine/derive_pr_classify.go:453 now routes every native-merge-queue* reason (native-merge-queued: queued (position N, STATE) and the failure reasons native-merge-queue-read / -enqueue / -method, src/pkg/github/automerge/automerge_native_queue.go:45,50,62,67,70,103) to 100-merge-queue, but the table still lists only merge-queue-required and describes the sweeps as skipping the direct merge on a queue-only base "the same way". With App installation auth (src/pkg/github/native_merge_queue.go:28) that row is now wrong: queue-enabled bases are enqueued, and merge-queue-required remains only on static-token transports. Please add the native-merge-queue* reasons to the 100-merge-queue row (note that the enqueue failure reasons also land there) and qualify the merge-queue-required text.

  2. New page not linked from the docs map — src/docs/native-merge-queue.md is a new top-level page, but src/docs/documentation-map.md has no entry (the hive-merge entry at :76 is the natural neighbour). .github/workflows/docs-index-reminder.yml:68-116 will flag this on the PR; adding the line now avoids the round-trip.

The claims in src/docs/native-merge-queue.md (App-only transport, expectedHeadOid pinning, enqueuer-scoped dequeue, MERGE-method requirement for mixed authorship) match native_merge_queue.go:28,47-73,77 and automerge_native_queue.go:49-70,129-150.

— hive: agent=ci-maintainer 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.

Style/conventions review (read at e8a41cf) — no blocker; two advisory consistency notes.

  1. Shared reason strings bypass prstage. src/pkg/stageengine/prstage/reasons.go:14 documents that lane reasons shared by producers and the stage classifier live there (cf. AutoMergeReasonReviewGatePrefix, AutoMergeReasonMergeQueueRequired). This PR instead defines nativeQueueReason = "native-merge-queued" locally (src/pkg/github/automerge/automerge_native_queue.go:15), emits "native-merge-queue-read" / "-enqueue" / "-method" as inline literals (lines 45, 60/65/68, 96), and the classifier matches the literal prefix "native-merge-queue" (src/pkg/stageengine/derive_pr_classify.go:453). The match works only because native-merge-queue happens to be a prefix of native-merge-queued; a rename on either side silently drops PRs out of stage/100-merge-queue. Suggest a prstage.AutoMergeReasonNativeQueuePrefix (+ the queued constant) aliased from both packages, as the existing reasons are.

  2. Transport capability split across a named and an anonymous interface. nativeQueueTransport (automerge_native_queue.go:21-26) declares four methods, but NativeMergeQueueMethod is asserted via an inline anonymous interface at automerge_native_queue.go:55-57, even though both the real client (src/pkg/github/native_merge_queue.go:77) and the test fake (automerge_native_queue_test.go:245) implement it. Folding it into nativeQueueTransport removes the second type assertion and the unreachable "cannot be verified" branch. Similarly, "queued" / "inactive" are ad-hoc lane strings (automerge_native_queue.go:121,192; automerge_sweep.go:936,2509) alongside the stageLane* constants.

— hive: agent=adjudicator-4 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.

Security review (head e8a41cf7)

1. Hive can never recognise — and therefore never withdraw — its own queue entries (high, in-scope).
src/pkg/github/automerge/automerge_native_queue.go:140-141 gates dequeue on strings.EqualFold(state.MergeQueueEntry.Enqueuer.Login, login) where login = c.transport.AppBotLogin(). AppBotLogin is the REST form "<app-slug>[bot]" (src/pkg/github/client.go:162, app.go:479), but enqueuer { login } comes from GraphQL (src/pkg/github/native_merge_queue.go:33-36), where a Bot actor's login has no [bot] suffix. Verified live against this App: REST pulls/15308 → hivecommons-hive[bot]; GraphQL author { __typename login } → {"Bot","hivecommons-hive"}. The comparison is always false, so the pre-write recheck at :157 also never passes.

Consequence: every withdrawal path in the contract (#15198 "Leave the queue when the gate breaks") is dead — hold, withdrawn approval, changes-requested, stale lgtm, paused/disabled repo (reconcileInactiveNativeQueues). Once Hive enqueues, GitHub merges regardless of a later gate break; the gate becomes one-way. The changelog and src/docs/native-merge-queue.md:23-27 claim this works. Tests can't catch it because fixtures set the same testHiveAppBotLogin string on both sides (automerge_native_queue_test.go:34,45).

Fix: compare normalised slugs (strings.TrimSuffix(x, "[bot]") on both sides, or query enqueuer { __typename login } and match Bot+slug), and change the fixture so Enqueuer.Login is the GraphQL form (hive-app) while AppBotLogin() returns hive-app[bot].

Otherwise: enqueue/dequeue both route through effects.ExecuteReconciling with c.mutation (:88,:151), expectedHeadOid is pinned to the validated head (:50,:91), static tokens are excluded (native_merge_queue.go:28), no new App permissions.

— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@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/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 29, 2026
@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 2026
@hivecommons-hive hivecommons-hive Bot removed the stage/050-review-pending Review swarm requested; awaiting a verdict for the current head label Oct 29, 2026
hivecommons-hive Bot and others added 5 commits October 30, 2026 08:17
Guard reconcileNativeQueueGate with the shared native-merge-queue prefix so
read/enqueue/method error reasons do not dequeue Hive's own entry.

Hive-Fix-Attempt: 3/6

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com>
… routing

Hive-Fix-Attempt: 4/6

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com>
#15380)

* fix: park mixed-authorship PRs on a SQUASH native queue at stage/085

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: Danathar <6772335+Danathar@users.noreply.github.com>

* 🐛 fix: report queue method read failures as native-merge-queue-read

A transient failure reading the native queue's merge method was reported
as native-merge-queue-method, which the stage engine derives to
stage/085-needs-decision with the merge-method explanation. Return the
read reason instead so the PR stays at stage/100-merge-queue, and state
that in the docs.

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>

---------

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Queued lane: a blocked/behind PR on a queue-enabled base is enqueued
  instead of stopping at not-mergeable (and withdrawing its own entry).
- Self, trusted and contributor lanes skip the behind update and the
  default-on current-base gate on a queue-enabled base; the merge group
  tests the merged result and a new head would drop the queue entry.
- Withdraw the App's own entry only on an allowlist of eligibility-loss
  reasons (holds, approval loss, changes requested, paused/disabled,
  draft/closed); transient reasons keep the entry.
- Match the own entry by enqueuer __typename Bot as well as slug.
- Fold the 085 method-refusal note into the added- changelog fragment.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
… the current-base gate explicit, cache the queue probe

Addresses the three standing review findings on the native merge queue
hand-off (hivecommons/hive issue 15198):

- Opt-in, per repo: auto_merge.native_merge_queue.enabled (default off)
  plus a repos allow-list. The zero policy never probes, enqueues,
  withdraws or lists a paused repo's PRs, so hives without queues see no
  behaviour change. Settings-parity allowlist, config accessors, the
  runtime golden and docs are updated.
- The require_current_base gate and the behind update-branch stay in
  force on queue bases; auto_merge.native_merge_queue.skip_current_base_gate
  (default false) is the explicit, documented bypass.
- API cost: isMergeQueueEnabled is cached per owner/repo#base for
  auto_merge.native_merge_queue.probe_ttl (default 30m, failures not
  cached), and the per-held-PR reconcile, the queued-lane PullRequests.Get
  and the 10-minute paused-repo listing run only on opted-in repos.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

@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.

Reviewed — no findings from this perspective.

— hive: agent=adjudicator-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.

Intent-alignment (delta re-review, head cb0e58fa9) — the opt-in policy, explicit gate and probe cache do what the body says; one new in-scope gap from the delta:

Default-on current-base gate now branch-updates a head Hive already has in the queue, dropping its own entry. The delta removed the queue bypass, so with skip_current_base_gate: false (the default) every lane runs the behind update (automerge_sweep.go:1912, :2412; automerge_contributor_lane.go:1383) and currentBaseGate (automerge_sweep.go:1990, :2466; automerge_contributor_lane.go:1457) before tryNativeQueue (automerge_sweep.go:2045, :2495; automerge_contributor_lane.go:1485), and neither checks IsInMergeQueue. currentBaseGate compares base..head and pushes update-branch on any behind_by > 0 (automerge_current_base.go:100-111). On an active queue every merged entry makes the remaining Hive-enqueued PRs behind, so the next sweep pushes a new head to each — which, as native-merge-queue.md itself says, drops the PR from the queue — then re-enqueues after CI. Net effect on the #15198 use case: the queue never batches and each PR re-runs full CI per upstream merge, which is the "strict up-to-date" cost the issue lists as the alternative it rejects. TestNativeQueueCurrentBaseGateIsExplicit only fixtures IsInMergeQueue: false, so the case is untested.

Concrete fix compatible with keeping the gate explicit: skip the behind update and currentBaseGate when the PR's own queue entry already exists (read IsInMergeQueue + ownNativeQueueEntry via the cached probe path), and add a table row for behind + already-queued. Advisory, no action needed: per #15198 "branches with a queue go from skip to enqueue" with no config; the delta makes it opt-in (default off) per the standing review findings — fine as a config-shape call, but the issue reporter's hive will need auto_merge.native_merge_queue.enabled: true to see any change.

— hive: agent=adjudicator-3 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.

Reviewed (correctness, delta c224c14 → cb0e58f) — no blocking findings; one advisory.

  • Low / advisory — entries orphaned when the policy is switched off. reconcileInactiveNativeQueues returns before any listing when !c.nativeQueuePolicy().Enabled (src/pkg/github/automerge/automerge_native_queue.go:357) and skips repos no longer in .repos (:370-372); reconcileNativeQueueGate likewise returns early via c.nativeQueue(owner+"/"+repo) == nil (:302-304). So if an operator sets enabled: false (or drops a repo from the allow-list) while the App still has entries queued, a subsequent hold / withdrawn approval never dequeues them and GitHub merges them on its own. Docs (src/docs/native-merge-queue.md:57-58) only cover paused/automerge-disabled repos, not the policy flip. Acceptable for a default-off feature, but worth a sentence in the doc or a one-pass drain on flip.

Verified: zero policy → nativeQueue()/nativeQueueEnabled() return nil/false so every lane keeps pre-queue behaviour (:234-240, :165-168); nativeQueueSkipsCurrentBase requires both the flag and a queue (:187-189); probe failures are not cached (:178-181); cache map guarded by nativeQueueProbeMu (:108-125). Tests cover opt-in, per-repo allow-list, explicit gate, probe TTL and inactive-reconcile skipping (automerge_native_queue_test.go:459-640). CI was still pending on the merge head when read; go test is blocked on this host, so test execution was not confirmed here.

— hive: agent=adjudicator 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.

Reviewed — no findings from this perspective.

— hive: agent=adjudicator-3 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.

Reviewed (security) — no blocking findings at 61114ba8 (head moved from b73c66f0 by a v5 merge touching no PR files; the PR's own delta since the prior review is cb0e58fa9).

Checked: tryNativeQueue runs only after each lane's existing gates and pins the evaluated head via expectedHeadOid (automerge_native_queue.go:258-262, native_merge_queue.go:58-64); dequeue is limited to the App's own Bot-typed entry and re-verified immediately before the write (automerge_native_queue.go:143-145, 330-337); all GraphQL goes through bound variables; the feature is default-off and allow-listed per repo (config.go NativeMergeQueueAutoMergeConfig, main_sweeps.go:853-856).

Low advisory, only when skip_current_base_gate: true: a positive probe is reused for probe_ttl (automerge_native_queue.go:118-126). If a base's queue is removed inside that window, nativeQueueSkipsCurrentBase still skips the current-base gate / behind update (automerge_sweep.go self/trusted lanes), then tryNativeQueue re-reads, finds no queue, returns "" and the lane falls through to a direct merge without the gate. Branch protection still applies, so impact is bounded; consider only trusting a cached positive after tryNativeQueue confirms it, or shortening the TTL for the skip path.

— hive: agent=adjudicator-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.

Reviewed (correctness, delta since c224c14 → b73c66f) — the only substantive delta is cb0e58f (per-repo opt-in, explicit skip_current_base_gate, cached queue probe); the rest is v5 merge noise. No blocker. One advisory:

  • Stale positive probe can skip the current-base gate for a direct merge (low). nativeQueueSkipsCurrentBase (src/pkg/github/automerge/automerge_native_queue.go:186-188) trusts a cached enabled=true for up to probe_ttl (30m). If the queue was removed from the base in that window, trySweepSelfAuthoredPR skips the behind update-branch and currentBaseGate (automerge_sweep.go:1912-1913, 1990), then tryNativeQueue reads live, sees !IsMergeQueueEnabled && !IsInMergeQueue and returns "", nil (automerge_native_queue.go:235-238), so the lane falls through to a direct merge of a behind head with require_current_base on. Bounded to one tick per base per queue removal and only when the operator set skip_current_base_gate; the cache self-corrects via recordNativeQueueProbe at :234. A cheap fix is to have nativeQueueSkipsCurrentBase bypass the positive cache (or only cache negatives). Same pattern in automerge_sweep.go:2411 and automerge_contributor_lane.go:1382.

Full test matrix passed at b73c66f (test (agent|hub|rest|dashboard|scheduler) * all success); TestNativeQueueIsOptInPerRepo, TestNativeQueueCurrentBaseGateIsExplicit, TestNativeQueueProbeIsCachedPerBase, TestInactiveQueueReconcileSkipsUnlistedRepos cover the delta. Note the PR now defaults OFF whereas #15198 described queued branches going straight from skip → enqueue; the opt-in was requested by prior review and is documented in src/docs/native-merge-queue.md, so judged acceptable.

— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@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

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 conflicts-with-open-pr Open PR has a merge conflict with another open PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ feature: enqueue into GitHub's native merge queue instead of skipping with merge-queue-required

2 participants