Repository navigation
fix(ci): exempt draft PRs from the opencode-review required-check poll - #1560
seonghobae wants to merge 1 commit into
Conversation
Reproduced against current main (5686de4) after PR #1443 was closed as superseded by #1546's receipt-gate redesign: the redesign's PR_DRAFT plumbing only narrows which reviews opencode_review_receipt_gate.py's evaluate_receipts() accepts (rejecting a bot APPROVE on a draft) -- it never exempts a draft PR from needing a receipt at all. pr_review_merge_scheduler.py skips dispatching a review for an ordinary draft with no @opencode-agent mention, so nothing ever posts a verdict, and the "Fail closed without a current-head OpenCode verdict" step's while/sleep poll had no draft check at all -- it loops until the job's own ~360-minute runtime ceiling kills it. Add the same PR_DRAFT sourcing the sibling dispatch step already uses and an early exit mirroring the existing closed-PR exit. Minimal and scoped to the one missing exemption; the receipt-gate/scheduler architecture is otherwise untouched, per the #1443 closure's own guidance to fix this fresh against current main rather than revive that branch.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The code fix remains valid and current-main-based, but this PR is Draft and the connected |
Summary
#1443fixed the requiredopencode-review-targetcheck hanging forever on a draft PR. It was closed unmerged after#1546's receipt-gate redesign landed, on the premise that the redesign already handles drafts viapr_review_merge_scheduler.py's draft path andopencode_review_receipt_gate.py'sis_draftparameter.That premise is only half right. Reproduced against current
main(5686de41):evaluate_receipts'sis_draftonly narrows what counts as a valid receipt (if is_draft and state == "APPROVED": return False, "draft must never receive bot APPROVE") — it never exempts a draft PR from needing a receipt at all.pr_review_merge_scheduler.py's own draft path (inspect_pr'sif pr.get("isDraft")) skips dispatching a review entirely for an ordinary draft with no@opencode-agentmention (active_draft_review_requestis documented as "the sole automatic gate for draft review dispatch").Fail closed without a current-head OpenCode verdictstep'swhile :; do ... sleep 30; doneloop has no draft check at all — it polls until the job's own ~360-minute runtime ceiling kills it.#1443's underlying bug still reproduces on currentmain.Fix
Per that closure's own guidance ("any residual draft-queue issue must be reproduced against current main and fixed in the current receipt/scheduler boundary rather than reviving this stale branch"), this is a fresh, minimal fix on a new branch off current
main— not a revival of#1443's branch:Fail closedstep now also readsPR_DRAFT: ${{ github.event.pull_request.draft }}, matching the sibling dispatch step's existing sourcing convention exactly (deliberately not the livegh apirefetch#1443's branch had introduced).closedexit.The receipt-gate/scheduler architecture itself is otherwise untouched — this is scoped to the one missing exemption.
Test plan
test_fail_closed_step_exempts_a_draft_pr_before_polling,test_fail_closed_step_closed_still_takes_precedence_over_draft,test_fail_closed_step_still_polls_for_a_non_draft_pr— each executes the actual production step body via a fakeghthat fails loudly if invoked, proving the draft/closed exits short-circuit before any Reviews API call (and that a non-draft PR still reaches it).tests/test_opencode_required_verdict_regression.py— 25/25 passed.coverage run -m pytest tests) — 2249 passed, 1 skipped, 21 subtests, matching vanillamain's 2246 passed + 3 new tests.git stashthat the suite's one pre-existing coverage shortfall (99% vs 100%, inpr_review_fix_scheduler.py/pr_review_merge_scheduler.py— files this PR does not touch) is present on vanillamaintoo, unrelated to this change.ruff checkon the modified test file — clean.interrogateon the modified test file — 100%.run:script bodies passbash -n.Generated by Claude Code