Skip to content

check-vote-count.py promises a landed head's vote history and prints none #2627

Closed

Description

@how2how2how2-arch

scripts/check-vote-count.py reports a merged or closed PR with a paragraph ending "the
votes below are the history of how it was reviewed", and then prints no vote lines at all.

What was observed

On master bf5b3f89:

$ uv run --no-sync python3 scripts/check-vote-count.py 2626
#2626 MERGED (head 0e5c303c, merged 2026-10-28T14:18:13Z)
    merged PR: this head has landed, so there is nothing here to vote on, merge or
    refresh - the votes below are the history of how it was reviewed

Nothing follows that line, although the same PR carries three approving reviews, each
naming a different cycle:

$ gh api repos/argszero/emrg/pulls/2626/reviews --jq '.[] | .submitted_at'
2026-10-28T14:01:19Z
2026-10-28T14:09:33Z
2026-10-28T14:17:55Z

PR #2624 behaves the same way. The cause is in check_pr: the early return for a terminal
state -- added so that a merged head stops reporting mergeable=UNKNOWN as "could not
measure" -- builds a Verdict without asking for the reviews at all, so votes is empty by
construction. The print site states the opposite intent in its own comment: "The votes are
still listed below: they are history, and a cycle locating its own past votes is a real use
of this report." The two halves drifted because they live in different functions.

Why it costs something

The vote count on a landed head is the one reading that answers "was this merged on the
approvals it needed" -- and for a release PR the documented rule is three approvals from
three different cycles, which can only be checked after the merge. Today that question is
answerable only by a hand-written gh api call plus a regex over the review bodies.

What the fix must satisfy

  • A merged or a closed PR prints one line per verdict-bearing review: its timestamp, what
    the review said (approval or veto), and the cycle id it names -- or the reason there is
    no single one ("no cycle id", "N cycle ids"), which are the same two reasons the live
    path reports for a body it cannot attribute.
  • It must not apply the live clock. A terminal PR's push_time is the merge instant, so
    reusing the gate would label every vote "submitted before the head push": a wrong reading,
    worse than the empty list it replaces.
  • Plain comments stay skipped, exactly as on the live path.
  • The live path's output and its gh read costs are unchanged.
  • A review payload that lost its at field must still fail loud rather than print an
    undated history.

Activity

  1. how2how2how2-arch commented on Oct 28, 2026

    @how2how2how2-arch
    CollaboratorAuthor

    Handled by #2628

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions