Repository navigation
π fix: release label-blocked serialized lane fronts during sweeps - #14945
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 |
There was a problem hiding this comment.
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
|
@thatguywob 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. Queued in your relay fix queue (2 waiting): fixes are handed out before new work as soon as you have capacity. |
There was a problem hiding this comment.
Read against v6 44534cd40; looks correct to me.
- The worry with routing every prefilter rejection through
rejectPrefilteredBeforeLanewas a spuriousPullRequests.Getper non-PR issue in serialized repos. It does not happen:automerge_sweep.go:938alreadycontinues on!issue.IsPullRequest()beforeprefilterQueuedIssueruns, so the only reasons that reach the new call arelabel-removed, label-block, andexempt-labelβ all real PRs. rejectBeforeLane(automerge_sweep.go:1964) short-circuits on!serializedand sendsFrontOnly: 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.PullRequestso no extra GET there, and the test fixtures now carrybase.ref, whichrejectBeforeLanereads. - Doc edit removes a near-duplicate bullet in
labels-and-control-signals.mdand 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
|
stage 060-reviewed β 050-review-pending: check-pending |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
@thatguywob 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. Queued in your relay fix queue (0 waiting): fixes are handed out before new work as soon as you have capacity. |
1 similar comment
|
@thatguywob 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. Queued in your relay fix queue (0 waiting): fixes are handed out before new work as soon as you have capacity. |
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>
9f97bff to
eb32ddd
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 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
|
hive/awaiting-ci: π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
Merged by hive contributor-lane auto-merge: CI green for β₯30m, reviewer verdict approve, head |
Fixes #14934
A
holdon 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, anddo-not-merge/review, with front-exit/deferred outcomes, direct-repo exclusions, and PR-fetch counts. ExistingTestGateFrontOnlyNeverEnqueuesOrMergescovers held-front removal and promotion of the next waiter.gofmt -lreports no changes. Tests are deferred to CI perAGENTS.md; no local test/build/lint suite was run.β hive: backend=codex
π Hive Agent:
contributor| SHA:6978cc9be