Skip to content

🐛 [v6] serialized lane: a 403/405/422 from the lane's merge call is recorded as an uncertain effect, so the front is stuck until the front timeout #14936

Closed

Description

@Danathar

Target: v6.

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

Executive summary

When the serialized lane tries to merge the front pull request and GitHub refuses with a definite "no" (403 Forbidden, 405 Not Allowed, 422 Unprocessable), the lane should record that the merge did not happen, leave the front, and let the next PR go. Instead, the lane's merge call passes GitHub's error through unchanged. The mutation layer therefore records "effect outcome uncertain, reconciliation required". The operation stays Unknown, and the PR keeps the front for the whole front timeout (60 minutes by default). The other merge paths already map these codes to "not applied" (mergeAPIErrorNotApplied). The lane's own merge call does not.

Evidence

Self-hosted v6 hive at dd406b3, repo Danathar/hive-lane-sandbox. Times are UTC; the hive logs in EDT:

In the meantime #1 was closed. The open-PR sweep no longer listed it, so nothing advanced it. The timeout only fired because another PR called into the lane.

Root cause

  • src/pkg/mergelane/gate.go at 44534cd40, (*RESTGitHub).Merge (:319; the effect closure at :345-350): the effect closure returns apiErr as is (if apiErr != nil { return effects.Result{}, apiErr }).
  • effects.Execute treats any error that is not marked effects.NotApplied as an uncertain outcome (src/pkg/convergence/mutation/executor.go:135).
  • src/pkg/github/automerge/automerge_sweep.go:3155, mergeAPIErrorNotApplied, already maps 405/409/403/422 to effects.NotApplied for the non-lane paths. The lane's call does not use it. Only 409 is special-cased after the fact, as ErrHeadMoved.

Wanted behavior

A definite GitHub refusal from the lane's merge call (403, 405, 409, 422) is recorded as "not applied". The lane records a refusal with GitHub's message, the PR leaves the front (or retries next round, whichever the lane already does for a non-merge), and the next PR is promoted without waiting for the timeout. A network error or 5xx stays uncertain, as today.

Acceptance criteria

  • In the lane's merge call, a 403/405/422 maps to effects.NotApplied, and a 409 still returns ErrHeadMoved.
  • A front PR whose merge gets one of those codes leaves the front within one lane round, with a reason that includes the status and GitHub's message, and does not wait for the front timeout.
  • 5xx and transport errors still produce an uncertain effect. Do not weaken exactly-once for genuinely unknown outcomes.
  • Shared helper: move or reuse mergeAPIErrorNotApplied rather than duplicating the status list. Watch the import direction; mergelane must not import automerge.

Test plan

  • src/pkg/mergelane/gate_test.go: a fake GitHub returning 403/422/405 from PUT /pulls/N/merge gives a not-applied result. A 500 gives an uncertain one.
  • src/pkg/mergelane/scenario_test.go: a front whose merge gets a 403 leaves before the timeout, and the next waiter is promoted.
  • Run cd src && go test ./pkg/mergelane/ ./pkg/convergence/....

Out of scope / do not change

  • The front timeout and its extension rules.
  • Reconciliation of genuinely unknown effects.

Activity

  1. hivecommons-hive commented on Oct 28, 2026

    @hivecommons-hive
    Contributor

    🔒 Claimed by agent scanner (agent on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 2h0m0s 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. github-actions commented on Oct 28, 2026

    @github-actions
    Contributor

    Closed by #14949 (merged to v6).

  4. hivecommons-hive commented on Oct 28, 2026

    @hivecommons-hive
    Contributor

    🔓 Claim by agent scanner released (holding agent relaunched).

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

    @hivecommons-hive
    Contributor

    Fixed by #14949 (#14949, merged). Closing because Hive's PR claim metadata says this PR was the full fix.

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