From 5f005a1f90429aaf2ed3debddd91deb9826a87be Mon Sep 17 00:00:00 2001 From: Tristan Simas Date: Sat, 24 Oct 2026 23:27:21 -0400 Subject: [PATCH 1/2] Withdraw the review status when a PR goes back or under review Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013ejYrMLnLWah8wCDDcb57V From b3a4f58ec7d411eebdc16beaeeecc582e939fb4a Mon Sep 17 00:00:00 2001 From: Tristan Simas Date: Sat, 24 Oct 2026 23:28:47 -0400 Subject: [PATCH 2/2] Test that judge reviewing withdraws an accepted head's status Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013ejYrMLnLWah8wCDDcb57V --- tests/test_head_review.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_head_review.py b/tests/test_head_review.py index c7b97c4e26..f34fbedc60 100644 --- a/tests/test_head_review.py +++ b/tests/test_head_review.py @@ -92,6 +92,20 @@ def test_judge_ok_and_back_dispatch_orderless_prs_without_positional_edit_ids(he assert len(tuple(call for call in github.calls() if f"statuses/{request.head}" in call[1])) == 2 +def test_judge_reviewing_after_ok_withdraws_the_accepted_status_on_that_head(head_bus): + """GitHub keeps the newest status per context on a commit, so reviewing an approved head + holds it out of the merge queue until a new ok.""" + comms, github, request = head_bus + context = order.Commander.read_root(comms.root) + common = ["--repo", request.repo.to_wire(), "--pr", str(request.pr), "--head", request.head, + "--why", ACCEPTED.text] + judge.main(["ok", *common], context) + judge.main(["reviewing", *common], context) + posts = tuple(call for call in github.calls() if f"statuses/{request.head}" in call[1]) + assert [next(part for part in post if part.startswith("state=")) for post in posts] == [ + "state=success", "state=pending"] + + def test_moved_head_posts_and_records_nothing(head_bus): comms, github, request = head_bus moved = replace(request, head="a" * 40)