Skip to content

🐛 fix(automerge): never supersede a hive-authored PR for a missing sign-off - #16648

Merged
clubanderson merged 1 commit into
v5from
fix/self-adoption-signoff
Nov 4, 2026
Merged

clubanderson merged 1 commit into
v5from
fix/self-adoption-signoff

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #16647

Hive closed its own approved, green PR (#16619, author = project.ai_author) and re-authored it as #16634 under signoff-rehome, losing the approval and CI history.

Root cause: no commit lacked a sign-off. dcoCommitStatsDetailedForAuthor counted the App-signed commit 59809967 (signed as the App, not the PR author) as squashUnsafeHive because the PR author was not [bot]-suffixed — but the author is the hive. inPlaceRehomeReason → AdoptReasonSignoffRehome → escapeStalledAdoption → supersedeAdoptedPR never checked for a hive author or an existing operator approval.

Changes

  • StageLabelPolicy.HiveAuthor (wired to hiveIdentity(cfg).Matches); hive-authored PRs are self-squash in stageDCO, so squashUnsafeHive is zero for them.
  • signoff-rehome never supersedes a hive-authored PR: in-place amend when the branch is pushable, otherwise stays put. A head with an operator approval is never rehomed.
  • signBranch always emits a Signed-off-by trailer on the App's re-author commit (ensureSignedOffBy).
  • Push relay refuses a commit authored by a hive identity without a sign-off (unsignedHiveCommits).

Tests: (a) hive-authored PR with squash-unsafe commit stays in place, (b) external fork PR still supersedes, (c) approved head is not superseded; plus ensureSignedOffBy, unsignedHiveCommits, and the push-relay refusal. go test ./pkg/github/automerge/ ./pkg/github/ ./cmd/hive/ passes.

…-off

The squash-attribution rule in stageDCO counted an App-signed commit on a
PR by hive's own ai_author as squash-unsafe, so signoff-rehome closed the
approved, green PR and re-authored it as a new one. Hive-authored PRs are
now self-squash, signoff-rehome amends them in place (or leaves them) and
never rehomes an operator-approved head. The App's signed re-author
commit always carries a Signed-off-by trailer and the push relay refuses
a hive-identity commit without one.

Fixes #16647

Signed-off-by: Andrew 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 hanthor 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 Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 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.

No conflicting open PRs or same-file overlaps were found.

@clubanderson
clubanderson merged commit 655fa3f into v5 Nov 4, 2026
82 of 86 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/self-adoption-signoff branch November 4, 2026 19:11
@github-actions

github-actions Bot commented Nov 4, 2026

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 Bot added a commit that referenced this pull request Nov 5, 2026
…epair (#16698)

#16648 let a hive-authored PR on a pushable base-repo head be amended in
place whatever its unsigned commits were linked to, because commits the
hive's agents push as project.ai_author counted as "other" (only App-bot
linkage made a commit the hive's). As a result a collaborator with push
access who added an unsigned commit to a hive branch got a Signed-off-by
asserted for them by the App.

The hive/other split now also counts commits GitHub links (by author
login) to one of the hive's identities (StageLabelPolicy.HiveAuthor), so
#16648's case still amends in place, and in-place repair again requires
every unsigned commit to be the hive's. A hive-authored PR carrying
anyone else's unsigned commit waits for a person; it is still never
superseded.

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hive superseded its own PR #16619 for a missing sign-off instead of signing in place

1 participant