Skip to content

fix(ingest): a review requested on a draft runs to the end - #39

Merged
PastaPastaPasta merged 2 commits into
mainfrom
fix/draft-explicit-review
Oct 5, 2026
Merged

PastaPastaPasta merged 2 commits into
mainfrom
fix/draft-explicit-review

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Collaborator

Problem

On dashpay/platform#5285 (a draft), ticking Request normal review on the gate comment started run 3512. Five minutes later the run was cancelled and the comment went back to "Review not started yet because this PR is a draft" with the box unticked. It happened again on every re-tick (live events 13:33, 13:40, 14:01, 14:05 UTC on 2026-10-05):

head.requeued  5681b073 re-opened by manual
run.spawned    attempt 1 sha=5681b073
head.closed    pr_draft
run.cancelled  cancel requested

The box re-queues the head. Then the next PR-ingest pass sees isDraft and close_pr_heads(..., "pr_draft") closes every queued and running head for the PR, so the reaper cancels the run.

Fix

  • ingest_repo (draft branch): a head for the draft's current commit is kept when someone asked for it, meaning any trigger except new_pr/new_push. Automatic heads, and heads for older commits, still close as before.
  • update_queue_comments (deferred pass): on a draft whose commit is being reviewed or has been reviewed, the worker's comment is no longer overwritten with the draft comment. A box ticked on an older draft comment still counts. After a failed review the draft comment and its boxes come back, because mentions and review requests are ignored on drafts and the boxes are the only way to retry.

Behaviour change worth knowing: if a review was explicitly requested (box, mention, review request) and the PR is then converted to draft on the same commit, that review now finishes instead of being cancelled.

Tests

test_review_requested_on_a_draft_runs_to_the_end replays the #5285 sequence: tick box → ingest while queued → ingest while running → done → failed → stale ticked box → push to the draft. It fails on main at the "still queued after ingest" assertion. test_automatic_head_on_a_pr_turned_draft_is_closed keeps the old behaviour for automatic heads. make check: 425 passed.

🤖 Generated with Claude Code

PastaPastaPasta and others added 2 commits October 5, 2026 10:14
Ticking "Request normal/priority review" on a draft's gate comment
re-queued its head, and the next PR-ingest pass closed it as `pr_draft`
because the PR was still a draft, cancelling the run a few minutes after
it started and putting the draft body back with the box unticked
(dashpay/platform#5285, run 3512, 2026-10-05).

The draft branch of `ingest_repo` now keeps a head for the draft's
current commit when someone asked for it (any trigger but new_pr /
new_push); automatic heads and heads for older commits still close.
The deferred-comment pass no longer overwrites the worker's running,
done or failed body on such a draft, but still honours a box ticked on
an older draft body.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Mentions and review requests are ignored on drafts, so the boxes are the
only way to retry there.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@PastaPastaPasta
PastaPastaPasta merged commit 3ce53da into main Oct 5, 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