Repository navigation
π fix: reject auto-merge queues from untrusted merger identities - #14947
Conversation
Check the recorded queue actor against dashboard.authorized_users before posting an approval. Explain merge-time refusals once per PR head, including authorization revocation at the serialized lane's final re-check. Hive-Run: hivecommons#14938 Hive-Plan: queue-merge-authorization-parity Hive-Spec: issue-14938#acceptance-criteria Co-authored-by: Danathar <6772335+Danathar@users.noreply.github.com> Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
There was a problem hiding this comment.
Decision needed: @clubanderson should confirm that dashboard queueing may now hard-fail (403) whenever dashboard.authorized_users is empty or the signed-in/internal actor is not listed as owner/merger, since deployments that queued via X-Hive-Role alone will lose the π button's effect until the allowlist is populated.
Code read against v6 44534cd40 β the change is sound and tightens trust rather than loosening it; routing to a human only because it changes merge-authorization policy.
What I verified:
dashboard/api.go:1387-1395applies exactly the same predicate as the sweep'strustedMergerFunc(cmd/hive/merge_eligibility.go:31-41:AuthorizedRole+RoleAtLeast(RoleMerger)), so a queue the dashboard accepts is one the sweep will honour. PreviouslyrequireMergerOrOwnerRoletrusted theX-Hive-Roleheader alone, so the sharedinternalcredential could record an approval the sweep then refused as untrusted β the mismatch #14938 describes.- The refusal happens before any GitHub write; the tests assert
labelAdded/reviewCreatedstay false on 403. automerge_untrusted_merger.go:38-45dedupes by App-authored comment containing thehead=marker, so the notice survives restarts; the sweep path is already guarded by the empty-AppBotLoginbail atautomerge_sweep.go:2638.
One low note: commentUntrustedMerger skips the dedupe scan entirely when AppBotLogin() is empty (appLogin != "" &&). The sweep never reaches it in that state, but queueApprovalStillHolds (automerge_sweep.go:2044) is called from the lane's final re-check and has no such guard, so an unconfigured app login plus a revoked merger would post a notice every lane round. Edge case; worth a if appLogin == "" { return nil } or a warn-and-skip.
Decision for the owner: the new 403 when authorized_users is empty is a behaviour change for any deployment that queued from the dashboard without an allowlist. I believe it is the right default (fail-closed, matches the sweep), but it is a merge-policy call.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
@thatguywob this PR is back in your court ( Failing checks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Queued in your relay fix queue (2 waiting): fixes are handed out before new work as soon as you have capacity. |
The hive and contributor image jobs failed downloading pinned base image layers from mirror.gcr.io with HTTP 429. Retry CI on a fresh head; the source and test checks passed. Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
|
Needs a decision, not a merge:
Head: verdict requires_human @bc3a6ea, 40/49 checks green, 9 pending, DCO yes, soak 0s of 30m0s. How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
/hive decision supersede now: adopt #14947 in supersede mode, preserving the author's commits and sign-off; do not wait for the grace deadline Rationale: the contributor is offline; adoption in supersede mode keeps the work moving (#13975). Decided by the hive at @clubanderson's request as the owner's delegate under the owner-delegate policy (rule |
|
@thatguywob the hive has adopted this PR ( |
|
Hive decided close this PR and open a fresh hive-authored PR with the same commits at 2026-10-28T15:40:11Z, but it hasn't taken effect. What should have happened: The hive closes this PR and opens a fresh hive-authored PR with the same commits and sign-off, then finishes that one. Posted by the hive as the owner's delegate; the rule was: the author's hive hasn't been connected since the nudge ( |
|
@thatguywob the hive's copy of this PR, #14977, was closed without merging, and the hive could not open a fresh copy just now. The adoption is undone: this PR is back in its normal flow ( |
|
/lgtm Posted by @clubanderson from the Hive dashboard; the merge gate decides from here. |
|
@hivecommons-hive[bot]: changing LGTM is restricted to collaborators DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/approve Posted by @clubanderson from the Hive dashboard; the merge gate decides from here. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hivecommons-hive[bot] 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 |
f16e94c
into
hivecommons:v6
|
Merged by hive contributor-lane auto-merge: CI green for β₯30m, reviewer verdict not required, claim by @thatguywob on #14938 verified. |
β¦dopted or could-not-adopt, routes workflow-path PRs to the workflows capability blocker, and re-adoption survives the mutation journal
Let hive decide β adopt-supersede settled the operator-action ledger as
applied ("done") as soon as the adoption/supersede request label landed,
and the β hover kept saying so while nothing happened.
- #14822 edits .github/workflows: the adoption engine's
fence refused the supersession (adoption-stalled:contributor-lane:
workflow-path) and the row fell back to a bare Needs human decision.
The policy now decides such PRs as capability-gap (recommend-only),
the ledger records blocked, and the badge names the
capability:workflows-permission blocker with what a person can do.
- #14947 was adopted (copy #14977), the copy was closed by
the duplicate sweep, and the re-adoption's branch_push /
pull_request_create claims had the same inputs as the first attempt, so
the mutation journal replayed them as idempotent success without running
the effect: created == nil β "error=None" β adoption reverted. The
claims now carry prior_copy, and a replayed provenance URL is resolved
and reused while the copy is still open.
- settledDelegatedOutcome: adopt-supersede β executing, dedup β no-effect,
capability-gap β blocked. The tracker derives the β state from the
stage record (adopted as #N / could not adopt / still executing / stuck)
and exposes progress, blocker and human to the SPA hover.
Fixes #15188
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
β¦dopted or could-not-adopt, routes workflow-path PRs to the workflows capability blocker
Let hive decide β adopt-supersede settled the operator-action ledger as
applied ("done") as soon as the adoption/supersede request label landed,
and the β hover kept saying so while nothing happened.
- #14822 edits .github/workflows: the adoption engine's
fence refused the supersession (adoption-stalled:contributor-lane:
workflow-path) and the row fell back to a bare Needs human decision.
The policy now decides such PRs as capability-gap (recommend-only),
the ledger records blocked, and the badge names the
capability:workflows-permission blocker with what a person can do.
- #14947: the re-adoption after the copy #14977 was
closed was replayed by the mutation journal; that fix landed in
#15209 (prior_copy claim input, replayed provenance
resolved). This PR layers the ledger / hover states over it.
- settledDelegatedOutcome: adopt-supersede β executing, dedup β no-effect,
capability-gap β blocked. The tracker derives the β state from the
stage record (adopted as #N / could not adopt / still executing / stuck)
and exposes progress, blocker and human to the SPA hover.
Fixes #15188
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
β¦dopted or could-not-adopt, routes workflow-path PRs to the workflows capability blocker
Let hive decide β adopt-supersede settled the operator-action ledger as
applied ("done") as soon as the adoption/supersede request label landed,
and the β hover kept saying so while nothing happened.
- #14822 edits .github/workflows: the adoption engine's
fence refused the supersession (adoption-stalled:contributor-lane:
workflow-path) and the row fell back to a bare Needs human decision.
The policy now decides such PRs as capability-gap (recommend-only),
the ledger records blocked, and the badge names the
capability:workflows-permission blocker with what a person can do.
- #14947: the re-adoption after the copy #14977 was
closed was replayed by the mutation journal; that fix landed in
#15209 (prior_copy claim input, replayed provenance
resolved). This PR layers the ledger / hover states over it.
- settledDelegatedOutcome: adopt-supersede β executing, dedup β no-effect,
capability-gap β blocked. The tracker derives the β state from the
stage record (adopted as #N / could not adopt / still executing / stuck)
and exposes progress, blocker and human to the SPA hover.
Fixes #15188
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
β¦dopted or could-not-adopt, routes workflow-path PRs to the workflows capability blocker (#15206) Let hive decide β adopt-supersede settled the operator-action ledger as applied ("done") as soon as the adoption/supersede request label landed, and the β hover kept saying so while nothing happened. - #14822 edits .github/workflows: the adoption engine's fence refused the supersession (adoption-stalled:contributor-lane: workflow-path) and the row fell back to a bare Needs human decision. The policy now decides such PRs as capability-gap (recommend-only), the ledger records blocked, and the badge names the capability:workflows-permission blocker with what a person can do. - #14947: the re-adoption after the copy #14977 was closed was replayed by the mutation journal; that fix landed in #15209 (prior_copy claim input, replayed provenance resolved). This PR layers the ledger / hover states over it. - settledDelegatedOutcome: adopt-supersede β executing, dedup β no-effect, capability-gap β blocked. The tracker derives the β state from the stage record (adopted as #N / could not adopt / still executing / stuck) and exposes progress, blocker and human to the SPA hover. Fixes #15188 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Summary
Queue requests now resolve the identity they will record through
dashboard.authorized_usersand require an owner or merger, matching the merge sweep. An empty allowlist or untrustedinternalactor receives a clear 403 before any GitHub approval or label is posted. Explicitly trusted actors continue to queue normally.The sweep posts one App-authored
untrusted-mergernotice per head, deduplicated through PR comments across restarts and the mutation boundary. This also covers authorization revoked before the serialized lane's final re-check. Merge-time authorization remains fail-closed.Related issues
Fixes #14938
Testing
gofmt -lon all changed Go files andgit diff --check: clean.Contributor checklist
v6release line.β hive: backend=codex
π Hive Agent:
contributor| SHA:c0fae61aa