Skip to content

Review the live head when a persona review request trails a push - #51

Merged
matthewp merged 1 commit into
mainfrom
fix/review-request-live-head
Sep 29, 2026
Merged

matthewp merged 1 commit into
mainfrom
fix/review-request-live-head

Conversation

@matthewp

Copy link
Copy Markdown
Contributor

Changes

  • Fixes persona review requests being silently dropped after a push. On Deduplicate CSS for components used both statically and with client:only on the same page astro#18176 the author persona pushed and requested astro-reviewer 3 seconds later; GitHub's review_requested payload still named the previous head, so review setup saw a different live head, returned stale, and exited. The reviewer never ran and the request stayed pending with nothing to retry it.
  • Persona-triggered reviews (review request or assignment) now review the pull request's live head instead of rejecting a mismatch. The request applies to the pull request, not a commit. Label-triggered reviews keep the existing stale check.
  • The author workflow waits (up to ~10s) for GitHub to report the pushed commit as the head before requesting reviews again, which removes the race at the source for Factory's own author. It proceeds either way.
  • The review workflow now logs a warning when a review doesn't start (ignored/stale with the reason), and an info line when it reviews a head newer than the trigger's.

Testing

  • tests/review-persona.test.ts: a persona review whose trigger names an older head is ready and reviews the live head (base SHA unchanged).
  • tests/persona-handoff.test.ts: waitForPullHead returns once the head matches (case-insensitive) and gives up without throwing after its attempt budget.
  • The existing label-trigger test still asserts a moved head is stale.

Docs

  • No docs update needed: this restores the documented persona review loop.

On withastro/astro#18176 the author persona pushed a commit and requested
a review 3 seconds later. GitHub's review_requested payload still named
the previous head, so loadReviewSetup saw the live head differ and
returned stale. The reviewer never ran, and the request stayed pending
with nothing to retry it.

- Persona-triggered reviews (review request or assignment) review the live
  head instead of rejecting a mismatch. Label-triggered reviews keep the
  stale check, since a label applies to a specific commit.
- The author workflow waits (up to ~10s) for GitHub to report the pushed
  commit as the PR head before requesting reviews again.
- The review workflow logs a warning when a review doesn't start, and an
  info line when it uses a head newer than the trigger's.
@matthewp
matthewp merged commit 581d5e0 into main Sep 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant