Skip to content

🐛 fix: hold beats queued Adopt now caption; share duration-default helper - #15704

Merged
hivecommons-hive[bot] merged 9 commits into
v5from
scanner/fix-15665
Oct 30, 2026
Merged

hivecommons-hive[bot] merged 9 commits into
v5from
scanner/fix-15665

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

#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

…lper

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@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 30, 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 hanthor 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 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
#15717 🐛 fix: never-policy 072 row stops promising adoption it can't back same files src/pkg/dashboard/stage_tracker_adoption.go

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR 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 30, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: moving case held: ahead of case forcedPending: is the right precedence; held is derived from it.Modifiers at :112, which stage_tracker_build.go:153 populates before stageTrackerTakeover runs 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 returns nil when 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; orDefault in stage_tracker_presence.go:232 keeps its name and dashboard already imported automerge in 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

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 060-reviewed → 050-review-pending: required-check-pending:build-and-test

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-643 sets due from the forced flag and then returns on adoptionBlocked(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. Reordering case held first in stage_tracker_takeover.go:116 and the !slices.Contains(it.Modifiers, modHold) guard at stage_tracker_adoption.go:132 match that. I also checked that the dashboard's notion of hold is as wide as the engine's: holdLabels (bands.go:571) folds do-not-merge and do-not-merge/* into modHold (stage_tracker_caption.go:95-98), the same spellings adoptionBlocked honours at :220.
  • DurationOr. orDefault's d <= 0 → def and durationOr's d > 0 → d are the same function; both now delegate, and the unexported durationOr is 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

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 060-reviewed → 050-review-pending: required-check-pending:build-and-test

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026
@hivecommons-hive hivecommons-hive Bot added the stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) label Oct 30, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-645 before the forced branch at :655 runs, and nothing on that early-return path clears the forced request — so under a hold the record keeps AdoptionForced() true indefinitely. That is exactly why the old switch (forcedPending before held) read "queued" forever; putting case held first in stage_tracker_takeover.go:116 and gating the forced caption in stage_tracker_adoption.go:132 on !modHold makes 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's hold modifier 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/ForcedAt on 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.DurationOr is a straight extraction; the single orDefault caller (stage_tracker_presence.go:145) and durationOr callers in automerge_adoption_clock.go keep identical semantics (d > 0), and dashboard already imported automerge so 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

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 060-reviewed → 050-review-pending: required-check-pending:build-and-test

@hivecommons-hive hivecommons-hive Bot added stage/100-merge-queue Lane admitted: soaking, merge-eligible or waiting for tide / the merge window and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026
@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/100-merge-queue Lane admitted: soaking, merge-eligible or waiting for tide / the merge window labels Oct 30, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 060-reviewed → 050-review-pending: required-check-pending:build-and-test

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

— hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

— hive: agent=adjudicator-4 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

— hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/100-merge-queue Lane admitted: soaking, merge-eligible or waiting for tide / the merge window and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 62606b8 into v5 Oct 30, 2026
76 of 77 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-15665 branch October 30, 2026 09:45
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#15704d70725c` sha256:64f07f2beffa3bd0e930f731ae58eb7c8a29e5da0364a333a87ac02a36d958ce — download from the dashboard or `hivectl review evidence #15704`.

@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

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/100-merge-queue Lane admitted: soaking, merge-eligible or waiting for tide / the merge window labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 100-merge-queue → 060-reviewed: required-check-pending:Sign-off survives the squash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/M Denotes a PR that changes 30-99 lines, ignoring generated files. stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started)

Projects

None yet

0 participants