Skip to content

🐛 [v6] queue accepts what merge will refuse: empty dashboard.authorized_users, and PAT-queued "@internal" approvals, never merge #14938

Closed

Description

@Danathar

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_users is 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:

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 from trustedMergerFunc in src/cmd/hive/merge_eligibility.go:31, which fails closed. Merge trusts only cfg.Dashboard.AuthorizedRole (dashboard_config.go, AuthorizedRole), which reads authorized_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 or internal.

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_users empty, a queue request returns an error naming the setting, and posts no review.
  • A PAT-authenticated queue that would record internal is refused, unless internal is 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 empty authorized_users gives a 4xx and no review. The PAT case gives a 4xx. A listed owner gives 200.
  • src/pkg/github/automerge: test the untrusted-merger comment 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

  1. hivecommons-hive commented on Oct 28, 2026

    @hivecommons-hive
    Contributor

    🔒 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 /unclaim to release, or /claim to take it over if you outrank the holder.

  2. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Oct 28, 2026
  3. hivecommons-hive commented on Oct 28, 2026

    @hivecommons-hive
    Contributor

    🔓 Claim by @thatguywob released (lease revoked).

  4. added
    hive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmation
    and removed on Oct 29, 2026
  5. hivecommons-hive commented on Oct 29, 2026

    @hivecommons-hive
    Contributor

    Fixed by #14947 (merged f16e94c). Closing. Reply /reopen if the problem persists.

  6. github-actions commented on Oct 29, 2026

    @github-actions
    Contributor

    @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 /reopen and 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.hive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions