Run the review checkers from the workflow's commit

Merged
JS
18h ago
+18-2

Problem and behavior

After #610 merged, reopening #608 failed interactive-review with
check-queue-review.py: error: the queue check requires --branch and --repo
(run 42356441759). The job checked out pull_request.base.sha, which still
pointed to main before #610, because that SHA moves only when the head does.
The new workflow therefore ran the old checker, and the old checker refused
the new arguments.

After this change, a pull request's run checks out github.sha, the base
branch's tip that the workflow file itself came from, and measures the change
against that commit. Merge groups keep merge_group.base_sha and still exit
before reading anything.

Approach

The workflow and the scripts it calls now come from one commit, so they cannot
disagree about flags. A test refuses pull_request.base.sha in the workflow.

Validation

  • scripts/run-python-tests.py tests/test_interactive_review_hook.py: 63 pass.
  • actionlint: clean.
  • Live check after merge: reopen #608. It should pass as a code owner's own
    work.

Summary by cubic

Fixes the interactive-review check failing on reopened pull requests after a review-gate merge. The job now checks out github.sha, the base branch tip the workflow file came from, so the checkers and the base they measure against always come from the same commit; previously it used pull_request.base.sha, which moves only when the head does, so a reopened PR ran an outdated checker that rejected the new flags. Merge-group runs still use merge_group.base_sha. A test now asserts the workflow's exact checkout ref and BASE_SHA expressions, not just that the old one is absent.