Repository navigation
✨ feat(github): enforce pin-only exception in merge-request relay - #16398
thatguywob wants to merge 1 commit into
Conversation
Apply the configured trusted-author pin policy only with a complete changed-file list and an exact requested head, rechecking the head after reading patches. Preserve the existing hold behavior on rejection and all later merge gates. Hive-Run: hivecommons#16265 Hive-Plan: merge-request-relay Hive-Spec: hivecommons#16265#Changes Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
Open PR overlap checkBase branch:
Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether the relay's pin-only exception may land without the per-commit trusted-author proof that #16394 adds to the sweep/approve gate, or whether #16394's check must be shared with (or ported to) Client.mergeRequestHumanMergePathRefusal first so the two merge lanes cannot disagree.
This widens an App merge path (auto_merge.human_merge_paths is the operator's only way to keep a file out of every App merge lane), so I'm routing the trust decision to a human rather than judging it alone. The code matches the spec in #16265 and is implemented carefully; the open question is parity with the sibling gate.
What I verified
src/pkg/github/human_merge_paths.go:269-298: the exception is only consulted aftermatchesis non-empty, requiresEnabled, a trusted PR author,req.ExpectSHAset and equal to the PR head, an exact reported changed-file count,intent.ClassifyPinOnlyok, and then a secondPullRequests.Getconfirming the head did not move while paging. Any failure falls through to the existingHoldForHumanMergePathspath — fail-closed as before. The relay is stricter than the sweep on head binding (ExpectSHAis mandatory).human_merge_paths.go:216-241:SetHumanMergePinOnlynormalises viarepoPolicyKey, clones slices, and zeroes a duplicate key (fails closed); reads takemergePolicyMu.RLock.src/cmd/hive/notifywire.go:38-44: installed next toSetHumanMergePaths, so a reload replaces (and a removed config clears) the policy.merge_request_watcher.gonon-GitHub forge branch is untouched, as the issue required.
Why I'm not calling it clean (intent-alignment, medium)
- #16394 (open, same queue) adds
pinOnlyCommitsUntrustedtoautomerge/automerge_human_paths.goso the sweep/approve gate proves every commit's author and committer is trusted, not just the PR opener — because anyone with push access to the head branch can add a commit under a trusted bot's PR.automerge_human_paths.go:87says the sweep lanes and/approve"share this helper so they never disagree"; this PR adds a third, independent copy of the trust check inClient(human_merge_paths.go:270-277) that checks onlypr.GetUser(). If #16394 lands, the relay becomes the weakest of the three lanes for the same config key, and the comment atautomerge_human_paths.go:87becomes untrue. - This is not a defect in the PR as scoped by #16265 (that spec names only the author login), which is why it is a decision and not a request for changes.
Not touched by me: #16394's own review.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Read the tree at What I verified:
One thing for the decider to weigh: a transient failure of the post-classification head re-fetch ( Checks |
|
Needs a decision, not a merge:
Head: verdict requires_human @aadac19, 64/64 checks green, DCO yes, soak 10m0s elapsed. How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
Needs a decision, not a merge:
Head: verdict requires_human @aadac19, 64/64 checks green, DCO yes, soak 10m0s elapsed. How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
Needs a decision, not a merge:
Head: verdict requires_human @aadac19, 64/64 checks green, DCO yes, soak 10m0s elapsed. How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
Needs a decision, not a merge:
Head: verdict requires_human @aadac19, 64/64 checks green, DCO yes, soak 10m0s elapsed. How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
clubanderson
left a comment
There was a problem hiding this comment.
Owner decision for reviewed head aadac19: the relay must not be a weaker path than the sweep and /approve. Use #16400 as the canonical commit-provenance policy, not #16394. Share the proof in a lower-level helper available to both Client and Engine, then apply it here before lifting a human-merge-path hold: trusted commit authors, verified signatures, allowed committer identity, readable complete commit list reaching the requested head, and head confirmation after fetching the proof. Add relay regressions for a foreign pushed commit, spoofed author with foreign signer, null/unmapped identities, unsigned commits, truncated/unreadable lists, moving head, and genuine verified bot commits. Preserve the existing complete-diff, exact requested SHA, native CI/review, hold and freshness gates. Do not grant blanket author trust to resolve this PR. Land only after the shared proof is present and canonical CI/review succeeds.
|
@thatguywob this PR is back in your court ( Review asks:
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. Your relay session received this as a |
|
/hive decision The narrow relay feature direction is approved, but this unchanged head aadac19 is NOT approved to merge. My changes-requested review stands. The implementation PR being opened from a fork by a non-approver does not authorize an opener-only exemption or a blanket trust grant; the actual relay proof must match the canonical policy already landed in #16400. Update this SAME PR from current v5, resolve its merge conflicts, and share the canonical complete-list, trusted-commit-author, allowed-committer and verified-signature proof across relay, sweep and approve. Unmapped identities, unsigned commits and incomplete or wrong-head lists remain held. Preserve complete-diff classification, current-head binding, native review/CI/merge fences and the ordinary human-merge-path hold whenever proof is insufficient. Add parity and rejection regressions, then obtain fresh actual head-bound review/CI. Do not lift the hold or merge the current opener-only implementation. This resolves the repeated policy question in favor of narrowly proven parity, not a bypass; keep implementation and follow-through in #16398 rather than a competing PR. |
… for a decision, not the fixer (#16676) A hive-superseding PR whose every reviewer perspective returned requires_human as a pure approver question (decision requested, no finding above info) was routed to the fixer by the superseder rule. The fixer had nothing to push, the cycle hit its cap, fixer-exhausted re-authored the change, and the next PR repeated it (#16398 -> #16456 -> #16607) while no operator was ever asked. Aggregation now keeps such a head requires_human with its decision question, RouteHuman parks it at 085 needs-decision with approve / request-changes actions, and the tracker's review chevron says the head is verified and waiting on sign-off. Fixes #16675 Signed-off-by: Andrew Anderson <andy@clubanderson.com> Co-authored-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Enforce
auto_merge.human_merge_pin_onlyin the GitHub merge-request relay. A configured trusted author may avoid the human-merge-path hold only when the complete changed-file list passesintent.ClassifyPinOnlyand the requested head matches before and after fetching patches. Rejections retain the existing hold/comment behavior and log the reason; all subsequent merge gates remain in place. Non-GitHub forge behavior is unchanged.Wire policy installation through config synchronization with defensive copies and reload clearing, document relay availability, and add the changelog fragment.
Validation: added httptest-backed relay cases for eligible pins, disabled policy, untrusted authors, mixed and unguarded edits, missing patches/counts, incomplete lists, mismatched/moving heads, missing requested head, and red CI, plus policy normalization/copy/reload coverage.
gofmt -landgit diff --checkpass. Tests were not run locally per AGENTS.md; CI provides the test verdict.Fixes #16265
— hive: backend=codex
🐝 Hive Agent:
contributor| SHA:aadac19fd