Skip to content

fix(pr-merge): enable-auto-merge retries a persistent arm failure on one PR as a network blip and fails every run #9620

Closed

Description

@github-actions

Filed by the lane sweep (run) from slice A. A model wrote the fenced text below from CI data, which can carry text written to steer it; every cited line was checked against main when filed. Rewrite the issue in your own words before marking it agent-ready.

Problem

Partial evidence: the unit lists 5 failed runs of pr-merge.yml (40058246788, 40055782220, 40054462236, 40052832024, 40052731381) out of 10 run ids. In each, job enable-auto-merge failed at step 'Arm and disarm auto-merge' with the same error '#9540 arm: fetch failed', then 'Process completed with exit code 1.'. The message carries no '(cause: ...)' suffix, so the log cannot tell a dropped socket from a deterministic client error. The same PR failed across runs hours apart, so it is not transient. Each run spent the 3-attempt retry, and the job stays red on every schedule and workflow_run trigger until someone looks.

Root cause

transient() treats any TypeError named 'fetch failed' as a retryable network error whatever its cause. withRetry therefore resends a request that fails the same way each time. The final report comes from describe(error), which prints the cause only when error.cause exists, so a causeless 'fetch failed' gives no diagnosis. main() counts the failed arm and returns exit 1 on every run with no per-PR backoff or skip, so one PR keeps the job red.
.github/scripts/pr-merge/enable-auto-merge.mjs:183:   (error?.name === "TypeError" && error.message === "fetch failed") ||
.github/scripts/pr-merge/enable-auto-merge.mjs:764:         console.log(`::error title=enable-auto-merge::#${pull.number} ${action}: ${describe(error)}`);
.github/scripts/pr-merge/enable-auto-merge.mjs:772:     return failed === 0 ? 0 : 1;

Proposed fix

Log the error name and cause code, via errorLabel(), in the final '<action>:' error line and in any warning for a causeless 'fetch failed', so a persistent failure is diagnosable. Find why the arm POST for #9540 fails deterministically, for example a request-shape or header problem. Report a candidate that has failed the same way on consecutive runs as a hold (a notice or a needs-human note) instead of a red job, or record the failure and skip it with a bound.

Where

workflow .github/workflows/pr-merge.yml
job enable-auto-merge

Activity

  1. added
    needs-triage
    on Oct 24, 2026
  2. added
    status: confirmed
    and removed
    needs-triage
    on Oct 24, 2026
  3. kyle-sexton commented on Oct 24, 2026

    @kyle-sexton
    Member

    Triaged (Issue Triage session): confirmed lane defect, priority medium, owner: Automation Lanes. Owner rule 2026-10-24: conveyor-stopping blockers are fixed ASAP.

  4. kyle-sexton commented on Oct 24, 2026

    @kyle-sexton
    Member

    Spec (owner, 2026-10-24): When one pull request's auto-merge arm is refused or fails on the network, pr-merge skips that pull request with a warning and the run stays green; the run still fails on an outage, a token or permission error, or a rate limit. Implemented by #9680. Printing the error name and cause code for a causeless fetch failed is out of scope for #9680 and tracked separately.

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

    status: confirmed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions