Skip to content

πŸ› fix(adoption): keep a fork PR the hive cannot push to with its author until the 072 dwell - #15018

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/fork-pr-no-adopt
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/fork-pr-no-adopt

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

When a contributor's relay goes offline, the hive adopts its red PR after governor.labels.stage.adoption.after_offline (15m by default). For a fork PR whose branch the hive cannot push to, adoption has nothing to do. supersedeAdoptedPR correctly refuses to move fork code into the base repository (#14306), so the next pass parks the PR at stage/085-needs-decision as adoption-stalled:fork-rehome-refused. A maintainer is asked to rebase someone else's fork minutes after its author went quiet, before the author's relay has had any chance to pick up its queued fix-pr task.

This PR stops adopting such PRs. A fork PR the hive cannot finish on the fork's own branch now:

  • stays at stage/072-returned-to-contributor, with the nudge and the relay's queued fix-pr task;
  • goes to 085, with the same adoption-stalled:fork-rehome-refused reason and maintainer ask, only once its head has waited the 072 dwell (24h) since the nudge.

Evidence

From projectbluefin/utah#919 on 2026-10-27/28 (UTC), a fork PR from arteeh/utah:

  • 23:52Z: the PR was nudged at 072 on head f0b5e2f.
  • 00:08Z: the hive adopted it, and in the same pass posted adoption-stalled:fork-rehome-refused, saying the head "has not moved for 1m". The PR was parked at 085.

Unchanged

  • In-place adoption on a fork. When the contributor allows maintainer edits, the hive can push to the fork's branch, and that path works. fix(lifecycle): require a real upgrade instead of skipping no-op qualificationΒ projectbluefin/testsuite#1039, from kylerankin/testsuite, was adopted in place at 02:14Z on 2026-10-28. The hive pushed two fixes to the fork and the contributor lane merged it at 03:59Z.
  • Same-repository PRs, which still adopt and supersede after after_offline.
  • An explicit owner-delegated adoption (adopt-supersede). It is one recorded attempt, so it still goes through the supersede path and parks at once, and its label clears.
  • An in-place fork adoption that later loses push access or needs a re-home. It still parks immediately (TestAdoptedLostPushAccessOnForkIsRefusedImmediately).

Owner context

#14306 introduced the fork refusal and kept in-place fork adoption on purpose. In #14466, @clubanderson called the 085 park "the designed outcome" and named the WARN-level log as the defect (fixed in #14481). This PR keeps the park and its maintainer ask; it only stops reaching it through an adoption that can do nothing, 15 minutes in.

Change

  • adoptContributorPR (pkg/github/automerge/automerge_contributor_adopt.go): for a fork PR it cannot finish in place (in-place adoption off, no push access, or a DCO re-home needed), the hive records the decline on the head (MarkForkRehomeRefused), records no adoption, and returns. A declined head is not re-checked on later sweeps, so there is no GET or compare call per sweep. A new head re-arms the check.
  • escalateUnadoptableFork (new): it runs on a 072 PR whose head was declined. Once now βˆ’ NudgeStart β‰₯ Dwell(072), it marks the escalation and posts one ForkNotAdoptedComment per head. The comment uses the same adoption-stalled marker and the fork ask, now shared via forkRehomeBlockerText. A zero 072 dwell override (never stalled) never escalates.
  • ApplyStageLabels calls it after the 074 block and moves the verdict to 085.
  • Stage engine: a new pass fact, PRPassFacts.ForkEscalationReason, and passDecision applies it to a 072 verdict, so the enforce-mode derivation writes the same stage. The mutation check below shows the live sweep depends on it.
  • Docs: labels-and-control-signals.md (the 074 row, and the adoption rules list after reason=grace-elapsed), hive-merge.md (the adoption section) and running-at-level-6.md (the behind/conflicting fork PR row).
  • Changelog: changelog.d/fixed-fork-pr-not-adopted-without-push.md.

Testing

From src/ under /var/tmp, TZ=UTC, -count=1:

  • go test ./pkg/github/automerge/... ./pkg/stageengine/... ./pkg/stagelabels/...: all ok.
  • go vet is clean on both packages, and gofmt is clean.
  • check-docs-links.py, check-docs-citations.py and check-changelog-fragment.sh v6 pass.
Test Covers
TestAdoptionForkWithoutPushStaysWithAuthorUntilDwell (replaces TestAdoptionForkWithoutPushIsNotSuperseded) A fork PR with no maintainer edits, lane reason conflicting, relay offline. 30m in, it is still 072: no adoption, no 074, no note, no ref or PR. At 23h it is still 072. At 24h it is at 085 with the reason and one note naming the wait, the lane reason, the fork and the ask. The next pass holds 085 with no second note. A new head returns it to 072.
TestDelegatedAdoptionOfForkWithoutPushIsRecordedAndParked (new) An adopt-supersede request on the same PR is recorded as an attempt and parks at once, as before.
TestPRDeriverPassCarriesForkEscalation (new) The engine derives 085 and the reason from ForkEscalationReason, and 072 without it.
TestAdoptionForkWithPushStaysInPlace, TestAdoptedLostPushAccessOnForkIsRefusedImmediately, TestAlreadyAdoptedInPlaceForkDCOFailureIsNotRehomed Existing tests, unchanged and passing: the in-place fork paths.

Mutation checks

Each part was broken in turn and restored from a backup copy:

  • Decline removed: the dwell test fails.
  • Dwell wait removed: the dwell test fails.
  • Delegated request declined too: the delegated test fails.
  • Note posted every pass: the dwell test fails.
  • Engine ignores ForkEscalationReason: both the deriver test and the dwell test fail.

Not verified

  • Not run on a live hive.
  • A relay that is online but silent is also kept at 072 until the dwell. Today it is adopted after contributor_grace_online (2h) and then parked, so it reaches a person later than before.
  • Changing the fork's settings does not re-arm the check. If the contributor turns on maintainer edits after the decline, the same head is not re-checked; a new head re-arms it.

Contributor checklist

  • Changelog: changelog.d/fixed-fork-pr-not-adopted-without-push.md.
  • Targets v6.
  • The title uses the emoji convention.
  • Commits include DCO sign-off.
  • Docs updated (src/docs/labels-and-control-signals.md, src/docs/hive-merge.md, src/docs/running-at-level-6.md).
  • No secrets, credentials or local runtime state are committed.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

…or until the 072 dwell

A fork PR is never superseded or re-homed into the base repository
(hivecommons#14306), so adopting one the hive cannot push to only parked it at
stage/085 on the next pass, 15 minutes after the author's relay went
offline. Decline that adoption instead: the PR stays at 072 with its
nudge and the relay's fix-pr task, and escalateUnadoptableFork parks it at
085 with the same maintainer ask once the head has waited the 072 dwell
since the nudge. The stage engine reads the new pass fact
ForkEscalationReason so enforce-mode derives the same stage.

In-place fork adoption, same-repository adoption and explicit
owner-delegated adoption are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 28, 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 kellyaa 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added author/clanker A contributor's own hive authored this PR under their login 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 labels Oct 28, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 5aec2fd into hivecommons:v6 Oct 28, 2026
67 of 70 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#150188eff7a8` sha256:70f224bce721fceeb14dcd37d67acb6ba4f106492f917211ad7a280f0b974352 β€” download from the dashboard or `hivectl review evidence #15018`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @Danathar holds role owner and GitHub permission maintain on repo; CI green at 8eff7a8.

@hivecommons-hive hivecommons-hive Bot removed 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 labels Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/clanker A contributor's own hive authored this PR under their login dco All commits are DCO signed-off 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.

1 participant