Skip to content

Returned-to-contributor PR with an offline clanker is never adopted when the rebase conflicts #15490

Closed

Description

@clubanderson

What the owner saw

hive#15133 / PR #15307 (thatguywob's clanker, fork branch fix/15133-workflow-follow-through, role/trusted, author/clanker) sat for 13h on the Activity Monitor as "Returned to @thatguywob's clanker" with a red offline dot on the waiting-on chip and needs rebase. Owner: "if clanker is offline, then why is it not being adopted?"

Short answer

It was adopted — once — at 07:12Z, 15 minutes after the clanker went quiet. The adoption is a supersede (fork head → hive/adopt-15307 → copy PR), and before opening the copy it replays the base onto the copy branch with a plain GitHub merge (Repositories.Merge v5 → hive/adopt-15307). That merge hit a conflict in src/pkg/dashboard/api_repo_item_decision_test.go, and a replay conflict is terminal for the head: delete the branch, post "Supersede failed", hand the PR back. The fixer's rebase-resolve episode (the thing that actually resolves conflicts, #15104) is wired for the merge-train and for hive-authored / push-reachable PRs only — adoption never asks for it, and the App token cannot push to the fork head (that is literally what #15133, the PR's own subject, is about). Three minutes later the recorded attempt (adopted_head=a46bcae…, adopted_by=0) read as "adoption attempted, nothing opened" → stage 085 adoption-stalled:supersede-failed:conflicting in the store, while the GitHub label stayed stage/072 — so the row kept saying "Returned to …". From there nothing re-evaluates: the 072 nudge/adoption block of the sweep only runs for a PR at 072/071, and the record is now 074/085 → the offline clanker is never adopted again.

Decision chain (code)

  1. automerge_stage_labels.go sweep: want.Stage == 072 + author/clanker → adoptContributorPR → adoptionDue (presence offline ≥ after_offline 15m) → due (07:12Z).
  2. adoptContributorPR → store.MarkAdopted(key, head, 0) ("record the attempt first") → supersedeAdoptedPR.
  3. supersedeAdoptedPR: pushBranch (journaled effects claim branch_push inputs {pr, head_sha, adopt:true}) → supersedeHeadConflicts(obs) → replaySupersedeOntoBase = plain Repositories.Merge(base→branch); 409 → ClearAdoption, NoteAdoptionBlocked(supersede-conflict), delete hive/adopt-15307, comment <!-- hive:adoption-supersede-conflict -->. No fixer.
  4. Next sweep (07:13:33Z): record no longer "adopted" → adoptionDue fires again → MarkAdopted(head, 0) → pushBranch: the mutation journal answers the identical claim with "external mutation already applied; treating as idempotent success" (pkg/convergence/mutation/boundary.go) → branch is not recreated → replay merge fails (non-409, branch gone) → returns error with the attempt recorded.
  5. Sweep 07:15:01Z: rec.AdoptionAttemptedNothingOpened(head) → AdoptionLive → 074 → escapeStalledAdoption → adoptionStalledReason = supersede-failed:conflicting → 085 + <!-- hive:adoption-stalled … --> "hive has nothing it can push". Held every sweep since.
  6. The 072-only interrupt block never runs for a 074/085 record → no re-admission while the clanker stays offline (last seen 07:39:59Z). The trusted-author conflict route in cmd/hive/merge_eligibility.go tried the fork head once at 06:32Z (rebase-attempts.json) — the App can't push a fork — and then automerge skip … reason=label:needs-rebase tier=trusted-author every ~45s.

So: not "never adopted", but adopted, gave up on the first conflict, and parked in a state the adoption sweep never re-enters. The expected behaviour (operator-reference "adopt" / offline clanker) is that a trusted clanker PR whose clanker is offline gets the fixer's rebase-resolve episode on a hive copy branch, not a git merge that gives up.

Timeline #15307 (UTC, 2026-10-29)

time event
04:55:22 opened; prow approval notifier; 04:55:30 hive:contributor-auto-promoted author=thatguywob merged=5
04:58:50 overlap bot: "This PR conflicts with v5 itself"
05:12:06 <!-- hive:contributor-nudge head=a46bcae… n=1 mode=queued --> → stage/072
05:49:03 <!-- hive:stage-regressed --> stage 080 → 072: conflicting
06:32 trusted-author conflict route records rebase attempt 1 on fork head a46bcae (App cannot push the fork)
07:12:24 <!-- hive:adoption-supersede-conflict head=a46bcae… --> "Supersede failed … Merging v5 into the copy branch hive/adopt-15307 stopped on a git conflict … Files changed on both sides: src/pkg/dashboard/api_repo_item_decision_test.go … Reason: supersede-conflict"
07:13:33 store: adopted_head=a46bcae… adopted_by=null adopt_mode=supersede adopted_at=2026-10-29T03:13:33-04:00 (second attempt, nothing opened)
07:15:01 <!-- hive:adoption-stalled head=a46bcae… reason=adoption-stalled:supersede-failed:conflicting --> "has not moved for 1m and the hive has nothing it can push … Blocker: the hive tried to re-home this PR onto hive/adopt-15307 (``) and could not open the superseding PR. Moving to stage/085-needs-decision"
07:39:59 clanker last heartbeat (presence.state=offline since)
08:04:12 prow adds needs-rebase
16:22:14 <!-- hive:stage-stalled --> "stage 080-awaiting-merge-admission: no activity for 30m0s: merge-train:queued-behind#15424…"
17:5x tracker row: stage 72 caption "Returned to @thatguywob's clanker" presence {state: offline, kind: clanker, last_seen: 07:39:59Z, next: wait}; store record: stage 085 reason adoption-stalled:supersede-failed:conflicting adopt_escalated_reason=… adopted_by=null

Log lines (pod hive, kubectl logs deploy/hive -c hive), every ~45 s since:

{"level":"INFO","msg":"automerge skip","repo":"hive","pr":15307,"reason":"not-app-authored"}
{"level":"INFO","msg":"automerge skip","repo":"hive","pr":15307,"reason":"label:needs-rebase","tier":"trusted-author"}
{"level":"INFO","msg":"merge train","repo":"hive","lane":"trusted-author","base":"v5","front":15444,"order":[15444,15445,15307],"size":3,"overlap_files":["src/pkg/dashboard/api_repo_item_decision_test.go",…]}

No adoption / supersede log line for 15307 appears after 07:15Z — nothing re-evaluates it. (Earlier #15299/#15303 had the same shape.)

Fix

  • Replay conflict with a RebaseResolver wired → open the copy anyway (hive branch, hive-authored, pushable), request the fixer's rebase-resolve episode with requested_by: adoption under the existing two-attempt guard; original marked adopt_copy_conflicting; close-first closes it through the existing path. Row: "Adopting · fixer resolving conflicts".
  • Episode exhausted → copy 085 rebase-failed-twice, original 085 adoption-stalled:rebase-failed-twice, popover options Adopt into fresh branch / Close as superseded.
  • stage-stalled escape: an attempt that opened nothing is re-admitted once the clanker has stayed offline/unregistered for governor.labels.stage.adoption.offline_grace (default 30m); its branch push is a fresh journal claim (stamped per attempt) so the branch an earlier attempt deleted is recreated.

Activity

  1. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Oct 29, 2026
  2. added a commit that references this issue on Oct 29, 2026
    87f900d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions