Skip to content

🐛 [v6] serialized lane: a hold label on the front PR never releases the front, so the lane is blocked until the front timeout #14934

Closed

Description

@Danathar

Target: v6.

Found in the v6 serialized merge lane live exercise (#7563, step 4). Code cited at 44534cd40.

Executive summary

In a repository using the serialized merge lane, one pull request at a time sits at the "front" and is the only one allowed to merge. If someone puts the hold label on that front PR, the lane is supposed to drop it from the front right away ("a hold label is present") and promote the next PR. It doesn't. The sweep sees the label and skips the PR before it ever reaches the lane, so the lane never learns about the hold. The held PR keeps the front, and every other PR waits until the front timeout (60 minutes by default). The fix: when a hive-serialized repo's sweep skips a queued PR for a label, it should still hand the PR to the lane front-only, as it already does for its other rejections.

Evidence

On a self-hosted v6 hive at dd406b3, in repo Danathar/hive-lane-sandbox (merge_strategy: hive-serialized, required check test, strict):

C's check had finished green at about 01:24Z. The lane still showed C as updating, because the lane never evaluated it again.

Root cause

src/pkg/github/automerge/automerge_sweep.go at 44534cd40:

  • :943, in SweepQueuedAutoMerges's per-issue loop: if reason := c.prefilterQueuedIssue(issue, label); reason != "" { … continue }.
  • prefilterQueuedIssue (:2189) calls labelBlockReason (:2130). That returns label:hold for a held PR (also label:needs-human, label:do-not-merge*, label:needs-rebase and sentinel).
  • Because of the continue, trySweepQueuedPR (:2586) is never called. That is the function whose own rejections go through rejectBeforeLane (:1964, called at :2602). rejectBeforeLane asks the lane, front-only, to re-evaluate the PR, and the lane then leaves the front with defaultBlocked's reason, "a hold label is present" (src/pkg/mergelane/lane.go:488-495).

The self-authored sweep has the same shape: a held PR continues at :1105 before trySweepSelfAuthoredPR (:1640, rejectBeforeLane at :1659). Fix both.

Wanted behavior

In a hive-serialized repo, when a queued (or self-authored) PR is skipped by a label prefilter, it still gets the front-only lane evaluation that rejectBeforeLane performs. A front PR with hold (or any label defaultBlocked/the lane's Blocked option refuses) leaves the front on the next sweep with the lane's reason, and the next waiting PR is promoted in the same transaction. Once the label is removed, the PR rejoins at the back (this part already works).

Acceptance criteria

  • On a hive-serialized repo, a queued PR at the front that gains hold leaves the front on the next queued sweep. The front-exit reason is "a hold label is present", and the next waiting PR gets front-enter.
  • Same for the self-authored sweep path.
  • A held PR that is not at the front is still skipped without being admitted to the lane. rejectBeforeLane uses FrontOnly: true, so it must not add the PR to waiting.
  • direct repos behave exactly as today: no lane call.
  • The prefilter stays cheap. Do not add a PullRequests.Get for every held PR on non-serialized repos. Only make the extra call when the repo is serialized (c.serializedLane(displayRepo)).

Test plan

  • src/pkg/github/automerge/automerge_lane_test.go: add TestLaneSweep_HeldQueuedFrontLeavesTheLane, modeled on TestLaneSweep_RejectedPRIsHandedToTheLaneFrontOnly (:262). Queue a PR, label it hold, and assert that the fake gate receives a FrontOnly request for it and that the sweep result is a skip.
  • Add the equivalent for the self-authored path.
  • Add a negative case: a direct repo with a held PR makes no gate call.
  • Run cd src && go test ./pkg/github/automerge/ ./pkg/mergelane/. Use a short checkout path; pkg/agent tests overflow sun_path from deep paths.

Out of scope / do not change

  • Do not weaken the hold. A held PR must never merge. The lane's own policyProblem check must stay.
  • Do not change labelBlockReason's set of labels.
  • Do not change the front timeout or its extensions.

Activity

  1. hivecommons-hive commented on Oct 28, 2026

    @hivecommons-hive
    Contributor

    🔒 Claimed by @thatguywob (contributor on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 30m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.

  2. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Oct 28, 2026
  3. added
    stage/010-actionableTriaged; eligible for the hive to pick up
    and removed
    stage/020-claimedClaimed by the scanner or a relay contributor
    on Oct 28, 2026
  4. hivecommons-hive commented on Oct 28, 2026

    @hivecommons-hive
    Contributor

    🔓 Claim by @thatguywob released (lease revoked).

  5. added
    hive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmation
    and removed on Oct 28, 2026
  6. hivecommons-hive commented on Oct 28, 2026

    @hivecommons-hive
    Contributor

    Verified on v6: fixed by #14945. Queued sweep now calls rejectPrefilteredBeforeLane on every prefilter rejection (src/pkg/github/automerge/automerge_sweep.go:990); self-authored sweep does so for held PRs (:1169, reason label:hold) and other prefilter rejections (:1192). The helper (:2014-2020) returns early for non-serialized repos (no extra PullRequests.Get/lane call), fetches the PR only on the queued path, and calls rejectBeforeLane front-only, so a held front leaves with the lane's reason and the next PR is promoted, while a held non-front PR is never admitted. Covered by TestLaneSweep_HeldQueuedFrontLeavesTheLane (queued/self-authored, serialized/direct). All acceptance criteria met.


    🐝 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

  7. github-actions commented on Oct 28, 2026

    @github-actions
    Contributor

    @Danathar this issue was closed by @hivecommons-hive[bot] as completed.

    If this was closed by a merged PR, the fix only takes effect once it ships in a tagged release and your deployment updates to it — check your running version against the fix before concluding the fix failed.

    If you are still seeing the problem, comment /reopen and it will be reopened for you — you do not need write access. Please add what you are still observing (running version, logs, steps) so it is not closed the same way again.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.hive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions