Skip to content

πŸ› adoption: resolve conflicts for offline clankers instead of returning the PR - #15491

Merged
clubanderson merged 4 commits into
v5from
fix/offline-clanker-adopt
Oct 29, 2026
Merged

clubanderson merged 4 commits into
v5from
fix/offline-clanker-adopt

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15490

Why

PR #15307 (thatguywob's clanker, fork, role/trusted) sat 13h as "Returned to @thatguywob's clanker" with the clanker offline. It was adopted at 07:12Z, but the supersede's replay of v5 onto hive/adopt-15307 is a plain GitHub merge: on a conflict it deleted the branch, posted "Supersede failed" and handed the PR back to a contributor that cannot act. The next sweep re-adopted, but the branch push was answered by the mutation journal as "already applied" (identical claim inputs), so the replay merged into nothing, the attempt was recorded as opened-nothing and the PR parked at store 085 adoption-stalled:supersede-failed:conflicting (GitHub label still stage/072) β€” a state the 072-only adoption block never re-enters. Adoption never used the fixer's rebase-resolve episode (only the merge-train / hive-authored / push-reachable routes do), and the App token cannot push the fork head (that is #15133 itself).

What changes

  • Fixer resolves instead of give-up. supersedeAdoptedPR: with a RebaseResolver wired, a replay conflict keeps hive/adopt-<n>, opens the copy with a conflict note and requests the fixer's rebase-resolve episode requested_by: adoption under the existing two-attempt guard (RebaseRequest.RequestedBy, Options.RebaseEpisode, AdoptionRebaseRequester). Store records AdoptCopyConflicting; cleared when the copy reads mergeable; close-first closes the original through the existing supersede path. Without a resolver the old behaviour is preserved.
  • Second failure β†’ 085. Copy episode exhausted β†’ copy stage/085 rebase-failed-twice, original adoption-stalled:rebase-failed-twice; popover question "rebase failed twice" with Adopt into fresh branch / Close as superseded. Stage engine: PRPassFacts.RebaseFailedTwice, Fixingβ†’NeedsDecision edge, derive parity.
  • stage-stalled escape. An attempt that opened nothing is re-admitted after governor.labels.stage.adoption.offline_grace (default 30m) while the clanker is offline / unregistered / has no presence (adoptionRetryDue). Push and replay journal claims carry an attempt stamp so a retry recreates the branch an earlier attempt deleted.
  • Tracker. adopted_by_state: resolving-conflicts β†’ single caption "Adopting Β· fixer resolving conflicts" (πŸ› tracker: readable progress label when a chevron action is runningΒ #15416 rule); 085 captions for both reasons; Settings help/search for offline_grace; static/index.html regenerated.
  • Comments. AdoptionStalledComment is reason-aware (names the two options for rebase-failed-twice).
  • Docs: operator-reference adoption paragraph, labels-and-control-signals diagram + stalled reasons; changelog fixed-offline-clanker-adopt-rebase.md.

Tests (no sleeps)

pkg/github/automerge/automerge_adoption_offline_rebase_test.go:

  • admission table: online clanker β†’ wait; offline + clean β†’ update-branch/supersede; offline + dirty β†’ fixer episode requested with requested_by: adoption; opened-nothing + offline past grace β†’ re-admitted; within grace β†’ wait.
  • supersede routes table: conflict with resolver β†’ copy opened + AdoptCopyConflicting; without resolver β†’ old give-up.
  • exhausted episode β†’ original 085 adoption-stalled:rebase-failed-twice, copy 085 rebase-failed-twice.
  • retry under the journal boundary recreates a deleted hive/adopt-<n> (attempt-stamped claim).

pkg/dashboard: TestStageTrackerAdoptionCopyResolvingConflicts. Full suites green: automerge, stagelabels, stageengine/..., config, dashboard, writeback (incl. TestDirectWriteRatchet), cmd/hive.

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

time event
04:55:22 opened; 04:55:30 hive:contributor-auto-promoted author=thatguywob merged=5
04:58:50 overlap bot: conflicts with v5
05:12:06 <!-- hive:contributor-nudge head=a46bcae… n=1 mode=queued --> β†’ stage/072
05:49:03 <!-- hive:stage-regressed --> 080 β†’ 072: conflicting
06:32 trusted-author conflict route: 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 (at a46bcae867d2) 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 (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…"
now tracker: stage 72 "Returned to @thatguywob's clanker" presence {offline, clanker, last_seen 07:39:59Z}; store: stage 085 adoption-stalled:supersede-failed:conflicting adopted_by=null

Pod log (kubectl logs deploy/hive -c hive), repeating every ~45 s, no adoption line after 07:15Z:

{"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",…]}

…ng the PR

A returned-to-contributor PR whose clanker is offline was adopted once, but
the supersede's replay of the base onto hive/adopt-<n> is a plain GitHub
merge: on a conflict it deleted the branch, posted 'Supersede failed' and
handed the PR back to a contributor who cannot act. The next attempt's
branch push was answered by the mutation journal as already applied, so the
replay merged into nothing, the attempt was recorded as opened-nothing and
the PR parked at 085 adoption-stalled:supersede-failed in a state the
072-only adoption block never re-enters (#15307).

With a RebaseResolver wired the copy now opens anyway and the fixer's
rebase-resolve episode takes it (requested_by: adoption, two attempts);
exhausted β†’ 085 rebase-failed-twice (copy) / adoption-stalled:rebase-failed-twice
(original) with Adopt into fresh branch / Close as superseded. An attempt
that opened nothing is re-admitted after adoption.offline_grace (30m) while
the clanker stays offline, and each attempt's push is a fresh journal claim.
Tracker: 'Adopting Β· fixer resolving conflicts'.

Fixes #15490

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 29, 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 29, 2026
Generated by changelog-fragment-guard from the PR title (#5675).
Edit the wording freely, or replace this file with the no-changelog
label if the change is not user-visible.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 29, 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
#15478 πŸ› fix(dashboard): share tracker row pill assembly; fix shrink-priority comment same files src/pkg/dashboard/static/index.html
#15485 ✨ auto-merge: breaking-titled or needs-owner-merge PRs wait for a human same files src/cmd/hive/main.go
src/docs/operator-reference.md
src/pkg/config/config.go
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/stage_tracker_decision.go
src/pkg/dashboard/static-src/js/tracker-words.js
src/pkg/dashboard/static/index.html
src/pkg/github/automerge/automerge_sweep.go
src/pkg/stagelabels/human.go
#15405 πŸ› fix: require verified signature for email-only hive commit identity match same files src/docs/operator-reference.md
#15496 πŸ› fix(stagelabels): bound retention of trust-promotion records in Prune same files src/pkg/stagelabels/store.go
#15497 πŸ“– docs: monitoring a hive with Prometheus and Grafana same files src/docs/operator-reference.md
#15468 πŸ› tracker: reporter-trust hold reads 'Triage needed' same files src/docs/operator-reference.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static-src/js/tracker-words.js
src/pkg/dashboard/static/index.html
#15471 πŸ› fix(hotspot): stop proposing source splits for generated files whose source is already split same files src/docs/operator-reference.md
#15308 ✨ feature: enqueue eligible PRs into GitHub native merge queues same files src/docs/labels-and-control-signals.md
src/pkg/github/automerge/automerge_sweep.go
#15425 πŸ› fix: identify tracker claims from the local ledger same files src/pkg/dashboard/static/index.html
#15473 πŸ› dashboard: Merged counter is an odometer at rest and the pill bee is 28 px same files src/pkg/dashboard/static/index.html

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@clubanderson
clubanderson merged commit 87f900d into v5 Oct 29, 2026
75 of 76 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/offline-clanker-adopt branch October 29, 2026 20:08
@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

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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant