Repository navigation
🐛 fix: hold beats queued Adopt now caption; share duration-default helper - #15704
Conversation
…lper Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[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 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Looks correct to me, and the premise holds in the engine: adoptContributorPR marks a forced request due at src/pkg/github/automerge/automerge_contributor_adopt.go:627-631, but adoptionBlocked(obs.Labels) at :640 returns before anything consumes the request when a hold / do-not-merge label is present. So a held row that still said "queued" was describing a sweep that will never run. Moving case held above case forcedPending in stageTrackerTakeover and gating the forced caption on !slices.Contains(it.Modifiers, modHold) in stageTrackerAdoption both follow from that. DurationOr is a pure extraction (orDefault had identical semantics) and stage_tracker_presence.go already imported automerge.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Checked the premise in the engine rather than the dashboard: the self-authored sweep skips a held PR at src/pkg/github/automerge/automerge_sweep.go:1184 (c.isHeld(labelNames(pr.Labels))) before adoptContributorPR (automerge_contributor_adopt.go:604) ever reads rec.AdoptionForced() at :610, and nothing on that skip path clears the forced request. So a hold added after Adopt now really does leave the request parked, and the row's "queued" caption was lying.
stage_tracker_takeover.go:115-121: movingcase held:ahead ofcase forcedPending:is the right precedence;heldis derived fromit.Modifiersat:112, whichstage_tracker_build.go:153populates beforestageTrackerTakeoverruns at:193, so the modifier is visible here.stage_tracker_adoption.go:132: with the hold present the function falls through to the nudge-clock path (or returnsnilwhen there are no nudges), so the forced request is neither shown nor lost — once the hold is lifted the same record makes the row read "Adopting… (queued)" again and the engine acts on it. That round-trip is the behaviour you want.automerge.DurationOr(automerge_adoption_clock.go:71-79) is a straight extraction;orDefaultinstage_tracker_presence.go:232keeps its name anddashboardalready importedautomergein that file, so no import cycle is introduced.
TestStageTrackerTakeoverHoldAfterAdoptNowNotQueued asserts both the takeover reason and the absence of QueuedBy/"Adopting…" text; it fails on v5 because forcedPending wins the switch there.
Looks correct to me.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 060-reviewed → 050-review-pending: required-check-pending:build-and-test |
There was a problem hiding this comment.
Read against the tree at 769c9e3. Both halves check out:
- Hold beats queued. The engine really does stop before consuming the request:
automerge_contributor_adopt.go:628-643setsduefrom the forced flag and then returns onadoptionBlocked(obs.Labels)without touching the record, so a row that kept reading "queued" was describing a request the sweep will never act on while the hold stands. Reorderingcase heldfirst instage_tracker_takeover.go:116and the!slices.Contains(it.Modifiers, modHold)guard atstage_tracker_adoption.go:132match that. I also checked that the dashboard's notion of hold is as wide as the engine's:holdLabels(bands.go:571) foldsdo-not-mergeanddo-not-merge/*intomodHold(stage_tracker_caption.go:95-98), the same spellingsadoptionBlockedhonours at:220. DurationOr.orDefault'sd <= 0 → defanddurationOr'sd > 0 → dare the same function; both now delegate, and the unexporteddurationOris kept so no caller changes.
go build ./pkg/dashboard/ ./pkg/github/automerge/ is clean. Looks correct to me.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 060-reviewed → 050-review-pending: required-check-pending:build-and-test |
There was a problem hiding this comment.
Looks correct to me. Read the tree at e18b93e, callers included:
- Engine side matches the new dashboard ordering. In
src/pkg/github/automerge/automerge_contributor_adopt.go,adoptionBlocked(obs.Labels)returns at:642-645before the forced branch at:655runs, and nothing on that early-return path clears the forced request — so under a hold the record keepsAdoptionForced()true indefinitely. That is exactly why the oldswitch(forcedPendingbeforeheld) read "queued" forever; puttingcase heldfirst instage_tracker_takeover.go:116and gating the forced caption instage_tracker_adoption.go:132on!modHoldmakes the row describe what the engine will actually do. - Label spellings agree. The engine stops on
hold/do-not-merge/do-not-merge/*(:220); the dashboard'sholdmodifier is derived from the same family (bands.go:571,holdLabelSpellings), so there is no label the engine refuses that the row would still caption as queued. ForcedBy/ForcedAton the takeover (stage_tracker_takeover.go:166-171) are still populated under a hold, so the UI keeps the audit of who pressed Adopt now — only the misleading "queued" wording goes away.automerge.DurationOris a straight extraction; the singleorDefaultcaller (stage_tracker_presence.go:145) anddurationOrcallers inautomerge_adoption_clock.gokeep identical semantics (d > 0), anddashboardalready importedautomergeso no new edge in the import graph.
TestStageTrackerTakeoverHoldAfterAdoptNowNotQueued pins the ordering and would fail on the previous switch. Changelog fragment name matches the fragment-guard rule.
— verdict recorded via hive-review
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 060-reviewed → 050-review-pending: required-check-pending:build-and-test |
|
stage 060-reviewed → 050-review-pending: required-check-pending:build-and-test |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
|
stage 100-merge-queue → 060-reviewed: required-check-pending:Sign-off survives the squash |
#15665: a hold added after Adopt now left the row reading 'Adopting… (queued…)' / 'adoption already queued' forever, though the engine stops at the hold without consuming the request. The held case now precedes forcedPending in the takeover, and the adoption line ignores a queued request under a hold.
#15691: orDefault (dashboard) and durationOr (automerge) were identical; both now delegate to a new exported automerge.DurationOr (dashboard already imports automerge; no names changed).
#15692 is not included: still applies, but needs a maintainer-permission signal in the dashboard (commented on the issue).
Closes #15665
Closes #15691
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88