Skip to content

πŸ› fix(automerge): gate contributor-lane unattended merge on vetted identity - #12051

Merged
hivecommons-hive[bot] merged 2 commits into
v5from
scanner/fix-12041
Oct 15, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
v5from
scanner/fix-12041

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Implements the maintainer-approved direction on #12041 (option A, hardened; default stays on). The hive:claim kind=contributor marker on its own proves only a lease, so the contributor-lane tier now also requires an operator-vetted, verified identity before it merges unattended.

What changed

  • Marker carries tier + verification. claims.ClaimMarker stamps tier=<profile tier> and verified=<true|false> on contributor claims. issueclaim.ParseMarker reads them, and a contributor marker without them parses as newcomer/unverified, so existing markers are refused.
  • Verified identity. A profile is marked verified (github_verified_at) only when the contributor proves the login through the authenticated POST /api/contribute/reissue-token flow. Self-asserted registration never sets it. claimIssueForContributor passes the tier and verified state into the ledger claim, and renewals keep them.
  • verifyContributorClaim accepts only tier ∈ auto_merge.contributor_lane.require_tiers (new key, default [trusted, merger], which accepts only operator-granted tiers trusted|merger|advisor; newcomer/contributor fail validation) and verified=true. New skip reasons: contributor-lane:claim-tier-untrusted and contributor-lane:claim-unverified.
  • Additional gates:
    • Skip when author_association is not OWNER/MEMBER/COLLABORATOR/CONTRIBUTOR (contributor-lane:author-association; covers NONE, first-time and missing).
    • Skip when the diff touches .github/workflows/** or .github/actions/** (contributor-lane:workflow-path).
    • Skip when the diff deletes a test file or guts test lines, using Sentinel's test_removal thresholds (contributor-lane:tests-removed).
    • human_merge_paths stays enforced by the existing gate.
  • Reviewer required: with no reviewer agent configured the tier now skips (contributor-lane:no-reviewer) instead of passing.
  • Settings β†’ Features: require_tiers input plus a one-line warning under the toggle describing what it grants. The GET/PUT /api/config/auto-merge API validates the tiers.
  • Docs: hive-merge.md (gates plus the operator workflow: verify login β†’ grant trusted β†’ their relay PRs merge unattended; nobody else's do) and operator-reference.md rows. Includes a changelog fragment.

Tests: table cases for each new skip reason; marker round-trip with and without the new fields; ledger/hub tier+verified propagation; reissue sets verification; config/API validation of require_tiers. There is also a regression test showing that a newcomer claim (and a legacy unstamped claim) is refused even with green CI, a soaked head and an approving verdict.

Choice notes: the default stays on, as the maintainer decided. It now fails closed: nobody qualifies until an operator grants a required tier to a contributor who has verified their login. I kept the require_reviewer_verdict: false opt-out for approval, but a configured reviewer is now mandatory either way.

Closes #12041

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

…tity

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <scanner@hive.kubestellar.io>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 15, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nicholasjackson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 15, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: f1f47309a

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#12025 ✨ keep unstick steps running in conserve API budget mode same files src/docs/operator-reference.md

Signed-off-by: scanner <scanner@hive.kubestellar.io>

# Conflicts:
#	src/pkg/config/automerge_trusted_bot_test.go
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: merged origin/v5 to resolve the conflict in automerge_trusted_bot_test.go (kept both new tests). CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: dcb5f71a7

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit e59e627 into v5 Oct 15, 2026
68 of 71 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-12041 branch October 15, 2026 16:32
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: server-tests is red on the v5 baseline itself (HEAD e59e627, run 38769872799 β€” dashboard/test/throughput-sla.test.js), not caused by this PR's automerge diff. Deferring to the shared incident #12085 (fix in flight via #12086); the sweep will re-run and merge once the baseline is green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

hivecommons-hive Bot pushed a commit that referenced this pull request Oct 15, 2026
…e auto-merge tier (#12167)

The contributor lane (#12051) only merged a non-App PR when it closed an
issue whose App-authored hive:claim marker named the author with a
require_tiers tier and verified=true. The operator's own registry tier had
no effect: mrbobbytables is trusted in hive's registry, yet #12045
("Part of #12002", a reference not a closing keyword) skipped with
contributor-lane:no-linked-issue and #11756 (claimed outside the relay)
with contributor-lane:no-claim.

Add a registry admission path: when the PR author's contributor-registry
profile carries a tier in require_tiers, the tier requirement is satisfied
without a linked issue or marker (auto_merge.contributor_lane.
registry_tiers_sufficient, default true). The sweep logs
contributor-lane:registry-trusted and the merge comment names the path.
Every other gate (author_association, diff fences, CI, reviewer verdict,
soak, labels, human-merge paths) is unchanged, and a non-trusted or absent
registry entry falls through to the marker path with its reasons intact.

The lookup is injected as automerge.Options.ContributorRegistryTier
(dashboard.ContributorTrustTierByLogin in cmd/hive) so tests fake it.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

0 participants