fix(test): align live-draft/head-mismatch test with #1697's contract - #1703
fix(test): align live-draft/head-mismatch test with #1697's contract#1703seonghobae wants to merge 1 commit into
Conversation
#1697 (fix(opencode): retire stale draft/head dispatches without false failure) deliberately reordered the "Request current-head OpenCode review execution" and "Fail closed" steps' checks so live-draft state is validated before live-head match, not after -- a currently-draft PR needs no review dispatched regardless of which head a stale/racing event names. That PR added thorough new coverage for the intended behavior in tests/test_opencode_required_verdict_regression.py, but left this sibling file's test_draft_exemption_fails_closed_when_live_head_moved pinned to the old pre-#1697 contract (fail closed, exit 1, on any head mismatch regardless of draft state) -- directly contradicting the new tests it added in the same PR. Reproduced identically on an unmodified origin/main worktree, confirming this is a real regression introduced by #1697 and not caused by anything on this branch. Updated the test to assert the same contract #1697's own new tests establish: draft state exempts dispatch even when the live head has also moved, with exit 0 and no error output. Verified: this test file alone (19 passed), and the full suite (2563 passed, 1 skipped, 21 subtests, 0 failed) on the fix commit. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019YgmaEKnPhrsbSyQBierFH
|
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 |
Duplicate of #1705This is the same fix for the same #1705 already carries this exact delta and has full verification behind it ( Closing this one as a full successor takeover by #1705, per this session's PR-closure policy (duplicate with an identical, already-verified successor) — not a bare close. No delta from this PR is lost; #1705 contains it. If #1705 doesn't land for any reason, please reopen this one rather than starting a third copy. Generated by Claude Code |
Evidence log — closure audit — 2026-09-02PR #1703 is closed and unmerged. Its exact head is Historical validation recorded on the PR body: focused The GitHub Actions records for that exact head are historical Gate decision: CLOSED / NOT A MERGE CANDIDATE. |
Description
While driving
docs/product-goal-directive.md's reconciliation work on a different branch, a routine full-suite run after merging currentmainin turned up 2 new failures intests/test_opencode_live_draft_state_regression.py::test_draft_exemption_fails_closed_when_live_head_moved(bothscriptparametrizations).Root-caused via an isolated
origin/mainworktree (confirms this is a pre-existing regression onmain, not caused by anything on the branch that surfaced it):#1697("fix(opencode): retire stale draft/head dispatches without false failure") deliberately reorderedopencode-review.yml's "Request current-head OpenCode review execution" and "Fail closed" steps so live-draft state is checked before live-head match, not after — a currently-draft PR needs no review dispatched no matter which head a stale/racing event or live re-fetch names, so the old ordering's hardexit 1on any head mismatch was pure red-X noise for an already-benign case.#1697added thorough new coverage for this intended behavior intests/test_opencode_required_verdict_regression.py(test_request_review_step_exempts_a_draft_pr_whose_live_head_has_moved,test_fail_closed_step_exempts_a_draft_pr_whose_live_head_has_moved), but left this sibling file'stest_draft_exemption_fails_closed_when_live_head_movedpinned to the old, pre-#1697 contract — directly contradicting the new tests added in the same PR. Sincemain's own required coverage-evidence check runs the full suite, every PR currently rebasing ontomain(including.github#1538, this session's own docs PR) would inherit this failure regardless of its own diff.Fix
Updated the test (renamed to
test_draft_exemption_applies_even_when_live_head_has_moved) to assert the same contract#1697's own new tests establish: draft state exempts dispatch withexit 0and no error output, even when the live head has also moved. No production code changed —#1697's reordering is the intentional, correct fix; this PR only brings the one stale test file back in sync with it.Verification
python3 -m pytest tests/test_opencode_live_draft_state_regression.py -q→ 19 passedpython3 -m pytest tests -q(full suite) → 2563 passed, 1 skipped, 21 subtests, 0 failedorigin/maingit worktree to confirm it predates and is independent of this fixType of change
Checklist
origin/maincheckout before touching anything🤖 Generated with Claude Code
https://claude.ai/code/session_019YgmaEKnPhrsbSyQBierFH
Generated by Claude Code