Skip to content

Merge-queue dequeue: retry the live-state read and surface a failed read in the step summary (follow-up to the dequeue change) #2186

Closed

Description

@don-petry

Problem

mq_dequeue_if_unapproved (scripts/lib/merge-queue-dequeue.sh, added for "Remove a PR from the merge queue when the fleet withdraws its last approval", #2174) is called right after an approval was dismissed. If its single read of the PR's live queue and review state fails (a transient GraphQL error, a rate limit), it logs one ::warning:: and returns. A PR that is in the merge queue at that moment can then merge with no approval standing, and the only trace is a line in a run log nobody is watching.

Raised by CodeRabbit on the pull request for #2174 and accepted there as a known gap so the main fix was not held up.

Scope

  1. Retry the state read a small, bounded number of times with a short backoff before giving up (the call is cheap and the window that matters is seconds long).
  2. If it still cannot be read, write the unknown state to the job step summary as well as the warning, naming the PR and saying a maintainer should check the merge queue.
  3. Do not post a PR comment on this path: most PRs that reach it are not in the queue, and a "remove this from the queue" comment on those would be noise and would count against the comment gate.

Acceptance criteria

  1. A test where the first read fails and the second succeeds with a queued, unapproved PR: the PR is dequeued and one marker comment is posted.
  2. A test where every read fails: no dequeue call, no PR comment, a warning, a step-summary entry, exit status 0.
  3. The retry count and delay are overridable for tests, and the existing tests pass unchanged.

Activity

  1. github-actions commented on Oct 10, 2026

    @github-actions
    Contributor

    Thanks for filing this follow-up and for laying out the scope and acceptance criteria so clearly. The retry and step-summary approach looks well-defined. One question: for the bounded retry, do you have a preferred default attempt count and backoff (for example 3 attempts with 1–2 seconds between them), or should the implementer pick values that fit the window you expect the queue merge to take?

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions