Repository navigation
Description
Target: v6.
Found in the v6 serialized merge lane live exercise (#7563). Code cited at
44534cd40.
Executive summary
Queuing a PR for Hive auto-merge and actually merging it check "who queued this" against two different rules. The dashboard queue endpoint accepts a queue from anyone the dashboard role allows. But the merge sweep merges only when the queuer is listed in dashboard.authorized_users with a merger role. Two common setups therefore produce PRs that look queued and never merge:
- A hive whose
dashboard.authorized_usersis empty: no human-queued PR ever merges, on any repo. - A queue made with the dashboard PAT: recorded as "Approved by @internal", which is never a trusted merger.
The user sees "queued" and gets silence. The fix: refuse (or warn) at queue time when the merge step will refuse, and say why on the PR.
Evidence
Self-hosted v6 hive at dd406b3, repo Danathar/hive-lane-sandbox:
- PRs ✨ Add KubeStellar production scanner configs and Copilot skills #4/✨ Multi-agent KubeStellar deployment: supervisor + 4 executors #5 queued with
POST /api/prs/{o}/{r}/{n}/queue-automergeand the dashboard PAT. The App posted "Approved by @internal for Hive auto-merge on green CI.", and the merge sweep refused it as an untrusted merger. - Re-queued with the dashboard 🔀 while signed in as @Danathar: "Approved by @Danathar". The sweep still refused,
untrusted-merger, becausedashboard.authorized_userswas[]. - Merges began only after
PUT /api/config/dashboardsetauthorized_users: ["Danathar:owner"]. - Neither refusal was visible on the PR or in the dashboard's queue state. Both PRs showed as queued.
Root cause
src/pkg/github/automerge/automerge_sweep.go:isTrustedMerger(:799), called on the queued path at:2044(the lane authorize callback) and:2673; its allowlist comes fromtrustedMergerFuncinsrc/cmd/hive/merge_eligibility.go:31, which fails closed. Merge trusts onlycfg.Dashboard.AuthorizedRole(dashboard_config.go,AuthorizedRole), which readsauthorized_users.src/pkg/dashboard/api.go:1372,handleQueuePRAutoMerge: it accepts the queue based on the request's dashboard role, which for a PAT is the token's role, and records the queuer as the signed-in user orinternal.
Wanted behavior
At queue time, the endpoint runs the same trusted-merger check the merge sweep will run, against the identity it is about to record. If that check would fail, the endpoint refuses the queue with a clear error. For example: "@internal cannot merge: queue from a signed-in owner/merger account", or "dashboard.authorized_users is empty: no queued PR can merge until an owner or merger is listed". It posts no approval review. The sweep's untrusted-merger skip, when it does happen (for example after a config change), leaves one comment on the PR.
Acceptance criteria
- With
authorized_usersempty, a queue request returns an error naming the setting, and posts no review. - A PAT-authenticated queue that would record
internalis refused, unlessinternalis a trusted merger by config. - A queue by a listed merger or owner works exactly as today.
- One PR comment (deduplicated per head) when the sweep refuses a queued PR as
untrusted-merger.
Test plan
src/pkg/dashboard/api_test.go(or the queue handler's test file): an emptyauthorized_usersgives a 4xx and no review. The PAT case gives a 4xx. A listed owner gives 200.src/pkg/github/automerge: test theuntrusted-mergercomment and its dedupe.
Out of scope / do not change
- Do not loosen the merge-time trusted-merger check. The fix is to refuse earlier, not to merge more.
Activity
hivecommons-hive commentedon Oct 28, 2026
🔒 Claimed by @thatguywob (contributor on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 30m0s without activity and renews while the work continues. Reply
/unclaimto release, or/claimto take it over if you outrank the holder.hivecommons-hive commentedon Oct 28, 2026
🔓 Claim by @thatguywob released (lease revoked).
🐛 fix: reject auto-merge queues from untrusted merger identities (#14947
hivecommons-hive commentedon Oct 29, 2026
Fixed by #14947 (merged f16e94c). Closing. Reply /reopen if the problem persists.
github-actions commentedon Oct 29, 2026
@Danathar this issue was closed by @hivecommons-hive[bot] as completed.
If this was closed by a merged PR, the fix only takes effect once it ships in a tagged release and your deployment updates to it — check your running version against the fix before concluding the fix failed.
If you are still seeing the problem, comment
/reopenand it will be reopened for you — you do not need write access. Please add what you are still observing (running version, logs, steps) so it is not closed the same way again.