Skip to content

✨ feat(automerge): adopted PRs merge under the hive's own authority - #14489

Merged
hivecommons-hive[bot] merged 2 commits into
v5from
fix/adopted-pr-automerge
Oct 27, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
v5from
fix/adopted-pr-automerge

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Why

Owner decision (@clubanderson, 2026-10-27): "If items are adopted, then the hive agents own it and they should be eligible for auto merge."

Contributor PRs the hive adopted in place (stage/074-adopted-by-hive, e.g. #14440 / #14456 / #14457) could never auto-merge: review and stage treated them as hive-owned, but all three merge tiers still gated on the original author's trust (untrusted-author-role, not-app-authored, contributor-lane:claim-tier-untrusted). Because no lane ever admitted them, the 074 → 095/097 transition-table edges never fired and the PRs needed a human /lgtm forever.

What

  • Contributor lane gains an adoption admission path (checked before registry/marker): if the stage store records a live in-place adoption whose AdoptedHead equals the head under evaluation, the PR is admitted under the hive's own authority with reason contributor-lane:adopted-by-hive. Author tier / claim marker / author_association are not consulted for that head.
  • Everything else is unchanged: CI green on the adopted head, reviewer verdict, DCO, workflow-path / tests-removed fences, reporter-trust hold, changes-requested, release hold, soak, human-merge paths, head re-verification before merge.
  • Safety: superseding adoptions are not admitted on the original PR (the hive/adopt-<n> App PR merges via the self-authored lane); a contributor push over the adopted head yields (074 → 072, existing behaviour) and the normal contributor gates apply again.
  • Config: governor.labels.stage.adoption.auto_merge (default on) on the existing adoption block.
  • Merge comment names the adopted head and label for audit.

Tests

Table-driven TestTrySweepContributorLanePRAdoptedByHiveAdmission (adopted head merges without trust; NONE association merges; workflow / test-removal fences hold; red CI holds; contributor pushed over head → back to author gates; yielded; supersede not admitted; no record; toggle off; valid claim still merges) plus helper tests and the config getter default. No time.Sleep.

Not in scope

#14457's check-failing:overlayfs-exec-guard is a cancelled run (treated red, correctly), not stale state — noted on the issue as a separate gap.

Fixes #14488

An in-place adoption (stage/074-adopted-by-hive) made the hive the owner
of the PR for review and stage purposes, but every auto-merge tier still
gated on the ORIGINAL author's trust (role, registry tier, claim marker,
author_association). An untrusted contributor's adopted PR therefore sat
CI-green and approve-verdicted forever, needing a human /lgtm.

The contributor lane now admits a PR whose stage record carries a live
in-place adoption of exactly the head under evaluation (the head the hive
adopted or pushed) under the hive's own authority, admit reason
contributor-lane:adopted-by-hive. All other gates are unchanged (CI,
reviewer verdict, DCO, diff fences, soak, human-merge paths, head
re-verification). Superseding adoptions are not admitted on the original
PR; a contributor push over the adopted head yields as before.

Toggle: governor.labels.stage.adoption.auto_merge (default on).

Fixes #14488

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@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 clubanderson 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 dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 27, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this repository have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply.

@github-actions

github-actions Bot commented Oct 27, 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
#14474 🐛 fix(automerge): close the adopted PR when its superseder merges from any stage same files src/pkg/github/automerge/automerge_stage_labels.go

@hivecommons-hive hivecommons-hive Bot added author/human A person pushed this PR themselves dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 27, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • test (dashboard shuffle 1/3)
  • test (rest 1/4)
  • test (rest 2/4)

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

… red-CI case

- agent_runtime_golden.json: new Adoption.AutoMerge leaf (nil default)
- Settings UI: reference governor.labels.stage.adoption.auto_merge in the
  adoption help copy and search text (settings parity)
- red-CI case: declare the fixture's check required so a failing run is a
  definite red instead of the unknown-required-set ci-unverified hold

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act labels Oct 27, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit bea5704 into v5 Oct 27, 2026
81 of 82 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/adopted-pr-automerge branch October 27, 2026 01:46
@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
Evidence bundle `#1448953d8a68` sha256:65a3772527b883d489dc656f0d78a7b77eff6b6979297c5d799e56e1986ff7d2 — download from the dashboard or `hivectl review evidence #14489`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 53d8a68.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/human A person pushed this PR themselves dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/L Denotes a PR that changes 100-499 lines, ignoring generated files. stage/050-review-pending Review swarm requested; awaiting a verdict for the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopted PRs (stage/074) still gated on original author's trust tier; never auto-merge

1 participant