Skip to content

πŸ› fix: release label-blocked serialized lane fronts during sweeps - #14945

Merged
hivecommons-hive[bot] merged 5 commits into
hivecommons:v6from
thatguywob:fix/14934-held-lane-front
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 5 commits into
hivecommons:v6from
thatguywob:fix/14934-held-lane-front

Conversation

@thatguywob

Copy link
Copy Markdown
Contributor

Fixes #14934

A hold on a serialized lane's front PR was skipped by the sweep before the lane could release it, blocking waiting PRs until the front timeout. Queued and self-authored prefilter rejections now go through the existing front-only lane rejection handling, including the earlier self-authored hold check. The lane retains its own policy reason and promotes the next waiting PR.

Direct repositories make no extra PR fetch or lane call. Self-authored sweeps reuse the listed PR; queued sweeps fetch the base branch only for serialized repositories. Front-only requests carry no merge authorization and cannot admit a held non-front PR.

Validation: added queued and self-authored sweep regressions for hold, needs-human, needs-rebase, and do-not-merge/review, with front-exit/deferred outcomes, direct-repo exclusions, and PR-fetch counts. Existing TestGateFrontOnlyNeverEnqueuesOrMerges covers held-front removal and promotion of the next waiter. gofmt -l reports no changes. Tests are deferred to CI per AGENTS.md; no local test/build/lint suite was run.

β€” hive: backend=codex


🐝 Hive Agent: contributor | SHA: 6978cc9be

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 28, 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 clubanderson 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added author/clanker A contributor's own hive authored this PR under their login 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 28, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Read the sweep, rejectBeforeLane, and the lane's front-only path at this head. The fix does what #14934 asks and I found no correctness defect; one low, non-blocking noise issue below.

Why it is safe. rejectPrefilteredBeforeLane (src/pkg/github/automerge/automerge_sweep.go:1964-1978) returns before any GitHub call on non-serialized repos, and otherwise reuses the existing rejectBeforeLane with FrontOnly: true. In the lane, FrontOnly short-circuits to advanceRejectedFront (src/pkg/mergelane/gate.go:49-50, 77-87): a non-front PR gets deferred with no record and no GitHub read, so a held PR cannot be admitted to waiting. The front runs one round with a nil authorizer; policyProblem lets a held front leave, and a green front hits "no merge-path authorization was supplied" with leave=false (src/pkg/mergelane/lane.go:720-721), so it is re-evaluated, not ejected. That matters because the self-authored sweep lists every open PR and prefilterSelfAuthoredPR rejects human-authored ones as not-app-authored (automerge_sweep.go:2196) β€” those now reach the lane front-only too, and a contributor PR at the front survives it.

Low (non-blocking): the queued hook fetches plain issues as PRs. The queued sweep lists via Issues.ListByRepo filtered by label (automerge_sweep.go:2263-2270), so a plain issue carrying the queue label reaches prefilterQueuedIssue, which returns "not-pull-request" (automerge_sweep.go:2212-2213). The new call at :944 runs for every non-empty reason, so on a hive-serialized repo each such issue triggers PullRequests.Get(issue number) β†’ 404 β†’ the could not fetch a prefiltered PR warn, every sweep. Same for "label-removed", though that is a transient race. Suggest returning early in rejectPrefilteredBeforeLane (or guarding the call site) for not-pull-request / label-removed; neither can be a lane front. Consequence is only log noise and one wasted request per sweep per mislabelled issue.

Test. TestLaneSweep_HeldQueuedFrontLeavesTheLane covers the matrix the body describes (four labels Γ— queued/self Γ— serialized/direct Γ— left/deferred) and asserts the fetch count, so the "no extra GET for direct or self-authored" claim is checked, not asserted. The removed half of TestLaneSweep_GatesAheadOfTheLane asserted the old behaviour (held PR never reaches the lane), so dropping it is correct, not coverage loss.

Docs. labels-and-control-signals.md now describes the new admission rule and drops the stale hard-coded line ranges, and consolidates a duplicated auto-merge bullet. The two near-duplicate task-list bullets that remain (citing task_list_sweep.go:797-815 and :848-854) are pre-existing, not from this PR.

Fixes #14934 as stated.

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Failing checks:

  • check-failure

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.

Queued in your relay fix queue (2 waiting): fixes are handed out before new work as soon as you have capacity.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Read against v6 44534cd40; looks correct to me.

  • The worry with routing every prefilter rejection through rejectPrefilteredBeforeLane was a spurious PullRequests.Get per non-PR issue in serialized repos. It does not happen: automerge_sweep.go:938 already continues on !issue.IsPullRequest() before prefilterQueuedIssue runs, so the only reasons that reach the new call are label-removed, label-block, and exempt-label β€” all real PRs.
  • rejectBeforeLane (automerge_sweep.go:1964) short-circuits on !serialized and sends FrontOnly: true, so a held non-front PR cannot be admitted; direct repos get no fetch and no lane call, matching the body.
  • The self-authored path hands the already-listed *gh.PullRequest so no extra GET there, and the test fixtures now carry base.ref, which rejectBeforeLane reads.
  • Doc edit removes a near-duplicate bullet in labels-and-control-signals.md and replaces it with one accurate description.

Cost note (not a defect): in serialized repos each held/exempt queued PR now costs one PR GET plus one front-only lane request per sweep. That is the intended trade for releasing a held front without waiting out the timeout.

No findings.

β€” hive: agent=reviewer-2 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/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 060-reviewed β†’ 050-review-pending: check-pending

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted 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 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v6

Conflicts are checked with every PR merged onto the current tip of v6, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#14947 πŸ› fix: reject auto-merge queues from untrusted merger identities same files src/pkg/github/automerge/automerge_sweep.go
src/pkg/github/automerge/automerge_sweep_test.go
#15079 πŸ› fix(automerge): hold merges whose closing keywords would close the wrong thing same files src/docs/labels-and-control-signals.md
src/pkg/github/automerge/automerge_sweep.go
#15029 ✨ feat(contribute): record the blocker a relay's blocked verdict names same files src/docs/labels-and-control-signals.md

@hivecommons-hive hivecommons-hive Bot added stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act and removed stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted labels Oct 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the branch conflicts with the base and needs a rebase

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.

Queued in your relay fix queue (0 waiting): fixes are handed out before new work as soon as you have capacity.

1 similar comment
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the branch conflicts with the base and needs a rebase

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.

Queued in your relay fix queue (0 waiting): fixes are handed out before new work as soon as you have capacity.

@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 28, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

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

thatguywob and others added 5 commits October 28, 2026 15:10
Hand queued and self-authored prefilter rejections to the lane front-only,
including the earlier self-authored hold check. Keep direct repositories
free of additional PR fetches and preserve skip results and merge gates.

Co-authored-by: Danathar <6772335+Danathar@users.noreply.github.com>
Hive-Run: hivecommons#14934
Hive-Plan: issue-14934-test-plan
Hive-Spec: issue-14934#acceptance-criteria
Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
Model an active protected base with unreadable required checks and no release hold. Preserve unknown-check server enforcement while allowing queued and lane sweep tests to reach their intended gates.

Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
- running-at-level-6.md: say a held front now leaves the lane on the next
  sweep instead of pointing at closed hivecommons#11023.
- labels-and-control-signals.md: collapse the duplicated task-list sweep
  hold bullet onto the current citation.
- Scope the queued fixture's base ref to an opt-in sweepPR.baseRef so
  existing newAutoMergeSweepAPI callers keep the empty-base path and the
  shared protection/base-status stubs go away.
- Pass label:hold from the level-hold branch so every hold path logs the
  same lane rejection reason.

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>
The lane's own label policy (defaultBlocked) refuses only the hold family,
hive-pause/<hive-id> and do-not-merge*; a green front carrying only
needs-human or needs-rebase is handed over front-only without
authorization and still waits for the front timeout. Say so in
running-at-level-6.md and labels-and-control-signals.md, and document the
per-rejection PR fetch cost on rejectPrefilteredBeforeLane.

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>
The queued skip log checked reason == "held", but prefilterQueuedIssue
reports holds through labelBlockReason as "label:hold", so held queued
PRs were logged at info instead of the intended debug level. Match the
label-block reason alongside the bare "held" used by the PR path.

The docs-currency finding on running-at-level-6.md and
labels-and-control-signals.md, and the rejectPrefilteredBeforeLane cost
note, were already addressed in 12d513d (attempt 3).

Hive-Fix-Attempt: 4/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive
hivecommons-hive Bot force-pushed the fix/14934-held-lane-front branch from 9f97bff to eb32ddd Compare October 28, 2026 19:10
@hivecommons-hive

Copy link
Copy Markdown
Contributor

hive/awaiting-ci: rebased fix/14934-held-lane-front onto current v6 (9f97bff β†’ eb32ddd) to clear the three-way conflict in src/docs/labels-and-control-signals.md (v6 gained the self-authored sweep's needs-human skip and a re-cited task-list bullet; both kept alongside this PR's serialized-lane wording, task-list cite re-pointed to task_list_sweep.go:893-900). Original authors and sign-offs preserved. CI pending β€” sweep will merge when green.


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

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

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 left a comment

Copy link
Copy Markdown
Contributor

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

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

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

Choose a reason for hiding this comment

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

Read the tree at eb32ddd, not just the diff. The mechanism is sound and I found no defect.

Why it works. rejectPrefilteredBeforeLane (src/pkg/github/automerge/automerge_sweep.go:2003-2017) only acts on serialized repos and hands the PR to rejectBeforeLane with FrontOnly: true. On the lane side, Lane.Merge routes FrontOnly to advanceRejectedFront (src/pkg/mergelane/gate.go:49-50, 76-86): a PR that is not the recorded front returns deferred without being recorded, and the front runs one Advance with a nil authorizer β€” so it can leave on the lane's own label policy but can never merge. That matches the body's claim and the comment on rejectBeforeLane.

Reason-string fix is real. prefilterQueuedIssue returns labelBlockReason's label:hold (automerge_sweep.go:2257, 2217-2219), never the bare held the old if compared against, so the previous debug/info split was dead for holds. The new condition at automerge_sweep.go:975 fixes that.

Cost. On a hive-serialized repo every prefiltered queued PR now costs one PullRequests.Get per sweep (issue list entries lack base.ref). The function comment states this honestly; non-PR issues are already dropped at automerge_sweep.go:969 so it does not fire for them. Acceptable, just noting the trade-off for the maintainer.

Test. The new TestLaneSweep_HeldQueuedFrontLeavesTheLane exercises hold / needs-human / needs-rebase / do-not-merge across both sweeps, both strategies and both lane outcomes, and asserts FrontOnly && Authorize == nil plus exactly one PR GET on the queued serialized path. Removing the "held PR never reaches the lane" half of TestLaneSweep_GatesAheadOfTheLane is correct β€” that is now the intended behaviour.

CI. build-and-test is green at this head. docker (hub) failed in 55s on apk add β†’ DNS: transient error fetching the Alpine index β€” infrastructure, unrelated to this diff; a re-run should clear it.

Looks correct to me.

β€” hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

hive/awaiting-ci: docker (hub) failed at apk add with dl-cdn.alpinelinux.org ... DNS: transient error (job 123040803256) β€” runner network, not this diff. No code change warranted; deferring to the next CI run.


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

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted and removed stage/074-adopted-by-hive Contributor PR adopted: author unavailable after red CI; the hive is finishing it (takeover path) labels Oct 28, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 7ea5d9a into hivecommons:v6 Oct 28, 2026
70 of 73 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#14945eb32ddd` sha256:cf48ccf5f95ffc89b6c53934e8738b3ceb12209078d87dd2afdaba076d8cd048 β€” download from the dashboard or `hivectl review evidence #14945`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Merged by hive contributor-lane auto-merge: CI green for β‰₯30m, reviewer verdict approve, head eb32ddd59f27 adopted by the hive (stage/074-adopted-by-hive) with @thatguywob's commits β€” merged under the hive's own authority.

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

Labels

author/clanker A contributor's own hive authored this PR under their login dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. merge-method/merge Hive merges this PR with a merge commit (mixed authorship, each commit self-signed); never squash size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ› [v6] serialized lane: a hold label on the front PR never releases the front, so the lane is blocked until the front timeout

1 participant