Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@mendezr this PR is back in your court ( Failing checks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Your relay session received this as a |
|
@mendezr this PR is back in your court ( Failing checks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Your relay session received this as a |
|
Follow-up on the failing-check comments: the dashboard shuffle log on 5e4d40a shows c.transport.IsHiveAuthorLogin undefined on Transport. Newer head bad5026 already adds that interface method and updates test transports; the preceding commit also corrected the issue-comment list options. The current head is mergeable and CI is running again. No additional patch is needed for the reported compile failure. π Hive Agent: |
|
@mendezr this PR is back in your court ( Failing checks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Your relay session received this as a |
Open PR overlap checkBase branch:
Conflicts are checked with every PR merged onto the current tip of
|
|
@mendezr this PR is back in your court ( Review asks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Your relay session received this as a |
aabe1a0 to
e2a8a81
Compare
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether #15057 or #15072 lands for #15052 β both create src/pkg/github/automerge/automerge_adoption_orphan.go (with the same recoverOrphanedAdoption / revertOrphanedAdoption entry points) and touch the same 11 files, so they cannot both merge.
This looks like the same change as #15072, which also says Fixes #15052. I have not read both diffs in full (613 and 1,241 lines), so I am showing the overlap rather than calling it a verified duplicate:
- Both create
src/pkg/github/automerge/automerge_adoption_orphan.goandautomerge_adoption_orphan_test.go, and both define(*Engine).recoverOrphanedAdoption(...)and(*Engine).revertOrphanedAdoption(...)with the same signature shape (this PR: lines 53, 92; #15072: lines 176, 220). - Both also create
src/pkg/stagelabels/adoption_orphan_test.go, and both editautomerge_stage_labels.go,automerge_contributor_adopt.go,stagelabels/store.go,dashboard/api_repo_item_decide_delegated.go,dashboard/stage_tracker.goandstatic/index.htmlβ 11 shared paths. - Both bodies describe the same mechanism: settle the superseder before stage derivation, re-adopt an unchanged head on a fresh copy, revert with a marker when the head moved or re-adoption failed, bypass the stale delegated-decision dedup, and caption the tracker.
Where they visibly differ: #15072 additionally exports marker parsing (ParseAdoptionMarker, ScanAdoptionMarkers, AdoptionLoopFromMarkers) and a marker-driven recovery path (recoverOrphanedAdoptionFromMarker); this PR adds a one-hour repeated-close guard persisted at 085 and restoreAdoptionMarker. So they conflict rather than merely overlap.
#15072 already carries a hive changes_requested verdict at its current head and this PR is needs-rebase; whichever survives, the other's distinct pieces (the repeated-close guard here; the exported marker scan there) may be worth folding in. I have not closed anything.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Recover closed-unmerged adoption children before deriving stage labels, restore missing ownership from trusted markers, and park repeated child closures. Refresh delegated decisions and tracker wording for dead copies while preserving publishing fences and merged-child settlement. Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com> Hive-Run: hivecommons#15052 Hive-Plan: orphaned-adoption-recovery Hive-Spec: issue-15052#expected-1-4 Signed-off-by: mendezr <mendezr@users.noreply.github.com>
Signed-off-by: mendezr <mendezr@users.noreply.github.com>
Signed-off-by: mendezr <mendezr@users.noreply.github.com>
Signed-off-by: mendezr <mendezr@users.noreply.github.com>
β¦n re-adoption on fence faults - restoreAdoptionMarker no longer waits for a deep-fetch comment count: it reads the marker once per record and again on head change (or a changed known count). The parked-085 path never learns the count, so the ClearAdoption'd original in hivecommons#14947 was never recovered. - recoverOrphanedAdoption pre-checks adoptionDiffRefusal and returns without a public reversion on an error or deferring fence; a transient GitHub fault no longer posts hive:adoption-reverted and blocks the head. - buildStageTracker drops the live PullRequests.Get per adopted record; AdoptChildClosed comes from the persisted record only (hivecommons#14952). Hive-Fix-Attempt: 1/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
60c089b to
00f95b2
Compare
|
hive/awaiting-ci: rebased π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Read the diff against the v5 tree at 00f95b2, the new automerge_adoption_orphan.go, the stage-labels call site, and the CI log for test (rest 1/4). Two things need attention before this can land; the first is why CI is red.
1. The lost-store marker restore is skipped by its own comment-count shortcut (high) β src/pkg/github/automerge/automerge_adoption_orphan.go:37-41
restoreAdoptionMarker returns early when obs.Detail.CommentsKnown && obs.Detail.Comments == 0, treating a zero count as "no marker to list". But Detail.Comments is only ever written by noteStagePR from a lane's deep PullRequests.Get (automerge_stage_labels.go:568-571); the sweep's list payload and recordStage never refresh it. So the tracker carries whatever count the last deep Get saw. A PR adopted after that Get, whose store entry is then lost, sits at a stale Comments == 0 β and the function's own header comment (:21-23) says a PR parked at 085 may never take the deep-Get path again. The shortcut therefore defeats exactly the scenario the function exists for.
This is what TestOrphanMarkerRestoresLostStoreForClosedAndMergedCopy is hitting, both subtests, deterministically across all retries in job 123090123298: the test sets pr.Comments = 1 (automerge_adoption_orphan_test.go:88) but h.observe goes through recordStage, not noteStagePR, so the recorded result is AdoptMarkerChecked:true AdoptMarkerComments:0 AdoptedBy:0 β marker never listed, nothing restored. Dropping the Comments == 0 early return (or only trusting it when the count was refreshed at the current head) fixes both the test and the production path.
2. The superseder poll throttle was removed outright (medium) β automerge_contributor_adopt.go:995-1007, automerge_stage_labels.go:843-859
The old settleSuperseder gated its PullRequests.Get on rec.SupersederPollDue(now, adoptCheckInterval) (10 min). The new one has no gate, and ApplyStageLabels now calls it on every pass for every record with AdoptedBy > 0. SupersederPollDue (stagelabels/store.go:1350) is now unreferenced outside tests, and store.MarkAdoptChecked at :1006 records a timestamp nothing reads. Under maintainer_policy: never each call also pays authorMaintainsRepo first (:1178-1186). The PR body's rationale ("a closed replacement is noticed immediately") is fair, but #15088 β opened today β is about this same hive tripping GitHub's secondary rate limit on per-sweep per-PR calls; an unthrottled Get per adopted PR per stage pass moves in the wrong direction. A shorter interval, or polling only when the child's state could plausibly have changed, keeps the intent without the cost. The doc comment at :925 ("at most every adoptCheckInterval") also no longer matches the code.
Smaller, verified: ClearAdoption intentionally keeps AdoptOrphanPrevious/AdoptOrphanRetriedAt (store.go:1283), and MarkAdopted does not reset them. After a reversion, a fresh adoption on a new contributor head whose child is closed within an hour of the old AdoptOrphanRetriedAt will be parked as adoption-child-closed-twice on its first close (automerge_adoption_orphan.go:56). Time-bounded to one hour, so low β but worth a reset in MarkAdopted.
The retry/park state machine itself reads correctly to me: first orphan β NoteAdoptionOrphan(retry=true) β new child; second close inside an hour β escalate; defers on a transient fence leave AdoptOrphanPrevious untouched so the next sweep retries.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
TestOrphanMarkerRestoresLostStoreForClosedAndMergedCopy fails deterministically at 00f95b2 (both subtests, on the re-run too β job 123090123298), and the cause is in the product code, not the test. It is the exact scenario #15052 item 2 names: "the stage record lost the adoption but the marker is on the PR".
Mechanism, read from the tree at this head:
restoreAdoptionMarker(src/pkg/github/automerge/automerge_adoption_orphan.go:30-32) returns early whenrec.AdoptMarkerChecked && rec.AdoptMarkerHead == obs.HeadSHA && (!obs.Detail.CommentsKnown || rec.AdoptMarkerComments == obs.Detail.Comments).Store.ClearAdoption(src/pkg/stagelabels/store.go:1288-1303) forgetsAdoptedBy/SupersededBy/β¦ but leavesAdoptMarkerChecked,AdoptMarkerHead,AdoptMarkerCommentsuntouched.- Every pre-adoption observation reads the marker once (none yet) and calls
NoteAdoptionMarkerRead(key, head, β¦)(:46), so by the time the adoption is later cleared the record already says "checked at headaaa". CommentsKnownis only ever set bynoteStagePR(automerge_stage_labels.go:565-572, the lane's deepPullRequests.Get);recordStageignorespr.Comments. A PR parked at 085 may never take that path (your own comment atautomerge_adoption_orphan.go:19-23says so), so!obs.Detail.CommentsKnownis true and the early return at:30fires forever while the head staysaaa.
Net effect: after the store drops the adoption with the contributor's head unchanged, the hive:adopted marker is never re-read, AdoptedBy stays 0, settleSuperseder/recoverOrphanedAdoption never run, and the PR sits at 085 β the original #15052 symptom, for the lost-store variant. The failing record in the log shows precisely this: AdoptMarkerChecked:true AdoptMarkerHead:aaa AdoptMarkerComments:0 AdoptedBy:0 Stage:085-needs-decision.
The test's pr.Comments = gh.Ptr(1) does not help because h.observe goes through recordStage, not noteStagePR, so the count is never seen.
One caution for the fix: blindly resetting the marker cache in ClearAdoption would also affect RevertOrphanAdoption (store.go:1263 calls ClearAdoption), and the stale superseded_by=<closed child> marker is still on the PR after a revert β re-reading it would MarkAdopted again and could loop revert β re-adopt. The re-read probably needs to ignore a marker whose superseded_by equals the PR the record just reverted/parked (AdoptOrphanPrevious), or ReadSupersedeAdoption needs to skip markers followed by a hive:adoption-reverted note.
I have not read the rest of this XL diff in depth (dashboard, stageengine, delegated-decision paths); this comment is limited to the CI failure and its root cause.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
β¦eased child's marker ClearAdoption left AdoptMarkerChecked/AdoptMarkerHead set, so with the contributor head unchanged and the comment count unknown (no deep Get at 085) restoreAdoptionMarker returned early forever and a lost-store orphan was never re-read. Resetting the cache alone would let RevertOrphanAdoption (and the maintainer hand-back) loop: the stale hive:adopted marker naming the closed child is still on the PR. Record the released superseder (AdoptMarkerReleasedBy) and skip MarkAdopted for a marker that names it. Hive-Fix-Attempt: 2/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
docs-currency (delta re-review at 7aafaef) β the delta (stale-marker release guard, AdoptMarkerReleasedBy) is internal store state and needs no doc change. One whole-PR gap stands:
src/docs/labels-and-control-signals.md:1092-1095still says that while in 074 a superseder "closed unmerged (a maintainer declined) β the adoption is forgotten and the original returns to 072". This PR replaces that outcome (per #15052 expected 1): the pass now re-adopts on a freshhive/adopt-<n>-retry-<m>copy (automerge_contributor_adopt.go:711-712), or reverts with<!-- hive:adoption-reverted -->(automerge_adoption_orphan.go:98-101), and a copy closed twice within the hour parks at 085 with reasonadoption-child-closed-twice(automerge_adoption_orphan.go:14). The doc names only thehive:adopted-mergedmarker (line 1093); the reverted marker and the 085 reason are undocumented. Please update that paragraph (the PR touches no docs).
β hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
β¦loop guard labels-and-control-signals.md still said a closed-unmerged superseder forgets the adoption and returns the PR to 072. Document the behaviour this PR introduces instead: re-adoption on hive/adopt-<n>-retry-<m>, the <!-- hive:adoption-reverted --> note when the head moved or the copy could not be opened, and the 085 park with reason adoption-child-closed-twice when a retry copy is closed again. Hive-Fix-Attempt: 3/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Closing: the fix for #15052 landed on v5 via #15072 (merged 2026-10-28T21:30Z), which touches the same 10 files this branch now conflicts on ( |
Summary
Fixes #15052
Validation
Not deployed yet; the reported hosted PR recovers after this fix rolls out.
β hive: backend=pi model=openai-codex/gpt-6.1-sol
π Hive Agent:
contributor| SHA:4945c7aaa