Repository navigation
π fix: reject carried approvals in the hold guard - #15893
Conversation
Keep copied operator admission from standing in for review of a drifted head. Add regression coverage that requires a re-hold despite a carried approval by a trusted merger. Hive-Run: #15698 Hive-Plan: carried-approval-hardening Hive-Spec: #15698#exclude-carried-approvals Signed-off-by: mendezr <mendezr@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 No conflicting open PRs or same-file overlaps were found. |
There was a problem hiding this comment.
Read the guard and both writers of approval records at head 37e0c94 (same code as the adopted head of #15722, which I reviewed earlier). This looks correct to me, and the carried changes_requested is a style follow-up, not a blocker.
src/cmd/hive/main_helpers.go:74rejects bodies prefixedapprove (carried; the only writer of that body iscarryAdmissionToCopyatsrc/pkg/github/automerge/automerge_operator_admission.go:123("approve (carried from #%d head %s)"), verified on both the PR head and currentv5.- The hive base-refresh carry (#15649) still works:
src/pkg/github/pr_decision_base_refresh.go:295-297copies the record and rewrites onlyHeadSHA/CarriedFromHead, so a directapprovekeeps its body and lifts the hold, while an adoption-carried record that is later base-refreshed stays rejected. - The new table row in
hold_guard_test.gorecords the carried body on the current head for an owner, so it fails without the guard change. - The carried finding (shared
review.HumanChangeRequestCarriedBodyPrefixconstant across producer and guard) is a reasonable hardening, but #15698 itself specifies the remedy as "exclude bodies prefixedapprove (carried", which is exactly what this does. Per #15698 I would land this as-is and track the shared-constant refactor separately rather than hold a green security fix on wording.
CI green apart from the arm64 build still running.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Reviewed (correctness / security) β looks correct to me; the one open question on #15722's head is answered by the code.
What I checked, from the tree at 37e0c94:
- The concern that a
"approve (carried"prefix check would also reject approvals the hive legitimately carries over its own base refresh (#15649): it does not.src/pkg/github/pr_decision_base_refresh.go:296-298copiesprevand rewrites onlyHeadSHA/CarriedFromHead, leavingBodyas the human wrote it (approve), so that carry still passesmain_helpers.go:74. The only producer of theapprove (carried from #N head β¦)body iscarryAdmissionToCopyatsrc/pkg/github/automerge/automerge_operator_admission.go:123β the adoption carry this PR means to exclude. An adoption-carried record that is later base-refreshed keeps the prefix and stays rejected, which is the fail-closed direction. - The new
hold_guard_test.gocase ("carried approval on the current head") records aKind: approvedecision on the current head by an owner with the carried body; without themain_helpers.go:74check that returns the login and the drift path is skipped, so the test fails without the fix.
The style note already posted on #15722 (shared constant for the prefix instead of a literal in two packages) stands as a non-blocking follow-up; the author deferred it there and I would not hold this head for it.
β 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 Looks correct to me at f33135a. The diff is byte-identical to #15722's head (verified with
The one carried-over review ask is still unaddressed, and the adoption body says it should be handled here: producer and consumer share a bare string literal across two packages, and the test builds its own copy of the literal rather than importing the producer's. A reworded Review findings from docs-currency (read head f33135a): behavior and changelog fragment are consistent; two comment-currency notes, advisory only.
|
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Supersedes #15722 (adopted in place, re-homed because a review finding on the adopted head sat unaddressed past the stage dwell; original commits by @mendezr preserved).
Fixes #15698
This branch is #15722's head
37e0c945b923as pushed by @mendezr (forkmendezr/hive), unchanged. Last lane reason on the original:contributor-lane:changes-requested.Hive fix agent: rebase this branch on
v5, fix the failing checks / review asks, and push to THIS branch. Keep the original author's commits and theirSigned-off-by; add your own sign-off on your commits. Do not open another PR.Open review finding carried over from #15722: the review swarm's latest verdict on
37e0c945b923requested changes (changes_requested); read the swarm's review on #15722, address it here, and let the swarm re-review this PR. Green CI alone is not done.