Skip to content

pr-queue: a gate pass older than the PR's latest comment should not count #93

Closed as not planned

Description

@scuttletoby

Follow-up from the #85 security quick check (#85 (comment), note n3).

When comment spam spends both the job token's REST and GraphQL limits, a gate run that should revoke a pass on the same head (a new NOT SAFE lens comment, a deleted override, a switch to draft) posts nothing. The older pass stays the newest check and the merge queue can merge on it (the queue uses its own token, so the spam does not slow it). A new head never reuses an older pass.

Cost to cause: about a thousand comment events in an hour from people allowed to comment (collaborators only on this fork). Very visible.

Proposed fix: the pr-queue counts a gate pass only if it was posted after the PR's latest comment / ready-state change. Otherwise the queue waits for the next gate run.

🤖 Generated with Claude Code

Activity

  1. scuttletoby commented on Nov 17, 2026

    @scuttletoby
    OwnerAuthor

    Closing: the main case is already covered by the gate, and the proposed queue rule would cost more than it closes (measured in #283, merged cd16b60, section "Not fixed here").

    • Already covered. head_gate.start() (fork-ci/actions/head-check/head_gate.py) posts an in-progress check run on the head, with the gate App's token, before it reads any comment. As the newest check run of that name it voids the older pass at once, whatever happens to the run after that (spent job-token limits included). So a revoking event (new NOT SAFE lens comment, deleted override, switch to draft) that starts a gate run removes the old pass even if the run then cannot read or post its verdict.
    • What is left. A gate run that never starts or cannot post the in-progress check (the App's own limit spent too, or Actions dropping the event). Reviews and inline review comments do not start the gate at all: that is head gate: reviews and inline review comments do not re-run the gate #88.
    • Why not the queue rule. The queue does not merge on the pass (GitHub auto-merge does, for an armed up-to-date PR). The queue rule would only bite if the queue disarmed up-to-date PRs, which it can only do when it runs (each push to main, every 15 min), cannot see deleted comments, and would disarm PRs in the normal seconds between any comment and the gate run it starts.

    Reopen if a run that never starts turns out to matter in practice.

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

    enhancementRequested improvement or new capability.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions