Skip to content

Deduplicate pr_review.py wait's Liveness Triple and Its Back-to-Back Held Q_FULL Reads #2731

Closed

Description

@ptr727

scripts/pr_review.py wait carries two duplications that predate #2723 and that its local review raised as out of that change's scope.

  • The liveness triple is computed in two places. main computes head_review_done(pr, a.min_rounds), answered_outside_review(pr), and reviewer_login_drift(pr) inline on its first Q_LIVE read, and the Copilot poll re-reads the same three each iteration (through live_state once Share One Bounded Backoff Loop Between pr_review.py wait's Two Polls #2723's change lands). A stop reading added to one site and not the other gives the first evaluation a different stop decision from every later one. A pure helper taking the payload and min_rounds, called by both main and live_state, closes that.
  • A held wait reads Q_FULL twice back to back. snapshot is a Q_FULL read, and the held branch then opens its poll on a second Q_FULL read with nothing written in between. Opening the poll on snapshot saves one GraphQL call per held wait. Several existing held-wait tests count reads, so they move with it.

Done looks like

  • One helper computes the liveness triple, and both sites call it.
  • A held wait opens its poll on snapshot rather than a fresh Q_FULL read, with the held-wait tests updated to the new read count.

Raised in local review on #2723.

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

    chorescript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions