Repository navigation
🐛 fix(automerge): tighten pin-only exception trust check - #16394
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@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
|
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Review findings from The code is fail-closed and I found no way for an untrusted commit to pass it, so this is not a security regression. But the new check rejects two commit shapes that trusted hive PRs carry today, which would make the exception a no-op for the lane it was built for. A maintainer should decide whether that is intended before this merges. 1. Commits with no GitHub-resolved identity are refused (medium, correctness). 2. Both are arguably acceptable if chosen; neither is mentioned in the PR body or #16380, which only asked that pushed commits be trusted. Options a human might pick: (a) accept as-is and document the restriction; (b) compare 3. Docs still describe the old contract (low, docs-currency). Verified otherwise: the helper is wired into both callers ( |
There was a problem hiding this comment.
Conclusion: the direction is right (commit-level trust, fail closed), but the committer/author check as written will refuse the exception for the very PRs it exists to admit, because it keys on GitHub account resolution of each commit rather than on the pushed identity.
Finding (medium) — src/pkg/github/automerge/automerge_human_paths.go:122-146
pinOnlyCommitsUntrusted requires trusted(rc.Author) && trusted(rc.Committer) for every commit, where trusted(nil) → SafeGetLogin → "" → false. rc.Author / rc.Committer are GitHub's resolved accounts, which are null whenever the git author/committer email is not attached to a GitHub account. That is the normal state for the hive's own pin bumps: hive#16391 (cli-pin-bump/omp, one commit be417774) returns
author: null, committer: null, commit.author.name: hive-release[bot]
from GET /pulls/16391/commits. Under this PR that commit yields "PR has a commit not authored and committed by a trusted author" even though the PR opener is trusted and the diff is pin-only, so the exception can never admit a pin bump whose bot identity is a git-level name rather than a GitHub account.
A second, related gap: commits created through the GitHub API or signed by GitHub (Dependabot, Renovate with platformCommit, web-UI commits) resolve committer to web-flow, which no trusted_authors list will contain. For those bots author is trusted and committer is not, so they are held too.
Neither case is covered by the new test table (automerge_human_paths_test.go:404-409 synthesises author=committer=login for every commit), which is why CI is green.
Suggestion: anchor trust on the author (rc.Author trusted, or — for unmapped identities — rc.Commit.Author.Email/Name equal to a configured identity), and accept committer == web-flow only when rc.Commit.Verification.Verified is true. Keep the count check (pr.GetCommits() != total) — that part is sound. Add the two cases above to the table so the exception is proven to admit at least one real-shaped bot commit.
The ctx threading, pagination cap reuse (stageDCOMaxPages) and /approve sharing the helper all read correctly.
— hive reviewer · author model: claude-fable-5.1
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Needs a decision, not a merge:
Head: verdict requires_human @cd1b154, 70/70 checks green, DCO yes, soak 0s of 10m0s. What to do: approve this head ( How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
Owner decision: superseded by #16400, which is the chosen verified-provenance implementation and now references #16380. Do not merge these competing edits together. Null/unmapped accounts and unsigned commits remain on the human path; web-flow is allowed only as a verified committer, not added as a trusted PR opener. #16399 stays open for its remaining upstream-reference work. Relay #16398 must share the chosen proof before landing. |
The pin-only exception judged trust from the PR opener's login alone. It now also requires every commit on the PR to be authored and committed by a trusted author, and fails closed when the commit list is unavailable or incomplete. /approve shares the same helper, so its reply stays consistent with the sweep.
Closes #16380
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88