Skip to content

ci(opencode): release required runner after dispatch - #1830

Merged
seonghobae merged 5 commits into
mainfrom
codex/opencode-rerun-handoff
Sep 4, 2026
Merged

ci(opencode): release required runner after dispatch#1830
seonghobae merged 5 commits into
mainfrom
codex/opencode-rerun-handoff

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

문제

Required OpenCode의 opencode-review-target job이 direct dispatch 뒤 current-head verdict를 최대 180분 polling하면서 hosted runner를 계속 점유했습니다. 60-job ceiling이 포화되면 dispatch 완료와 required-run wakeup까지 막는 self-deadlock이 재발할 수 있습니다.

변경

  • current-head verdict가 이미 있으면 즉시 성공합니다.
  • verdict가 없으면 기존 direct dispatch에 required_run_id를 전달한 뒤 Reviews API를 한 번만 확인하고 즉시 fail closed합니다.
  • opencode-review-dispatch.yml의 기존 exact-run wake seam이 verdict 게시 뒤 rerun-failed-jobs를 호출합니다.
  • rerun은 current-head receipt를 확인해 재-dispatch 없이 성공합니다.
  • polling loop, 60초 sleep, 180분 deadline과 해당 obsolete 테스트 502줄을 제거했습니다.

concurrency 판정

cancel-in-progress:true는 적용하지 않았습니다. GitHub concurrency 취소는 job step의 live-head admission보다 먼저 일어나므로, 지연된 stale 이벤트가 fresh run을 먼저 취소한 뒤에야 stale임을 알 수 있습니다. dispatch idempotency는 stale side effect를 막아도 이미 취소된 fresh run을 복구하지 못합니다. 따라서 same-PR group은 false를 유지하고, 기존 cleanup job이 live head를 재검증한 뒤 stale run만 정밀 취소합니다.

검증

  • actionlint .github/workflows/opencode-review.yml
  • focused pytest 143 passed:
    • tests/test_opencode_required_rerun_capacity.py
    • tests/test_opencode_required_verdict_regression.py
    • tests/test_opencode_live_draft_state_regression.py
    • tests/test_required_workflow_queue_contract.py
    • tests/test_central_required_workflow_exact_inventory.py
  • git diff --check origin/main...HEAD

Exact base included: dafb1e6974c51bc62ce5f606431922bcd0d36414
Exact head: 716d8827

Summary by CodeRabbit

  • 개선 사항

    • OpenCode 검증이 반복 폴링 대신 단일 확인 방식으로 변경되었습니다.
    • 검증 결과가 없으면 즉시 실패 처리되며, 인증된 검증 완료 후 실패한 작업만 자동으로 재실행됩니다.
    • 오래된 이벤트가 최신 검증 실행을 방해하지 않도록 실행 정리와 동시성 처리가 개선되었습니다.
  • 테스트

    • 단일 검증 요청, 정확한 실행 재시작, 오래된 이벤트 처리에 대한 회귀 테스트가 추가·갱신되었습니다.

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: fde7e705-d572-44f6-8fea-7bc9743a1eb6

📥 Commits

Reviewing files that changed from the base of the PR and between dafb1e6 and 716d882.

📒 Files selected for processing (7)
  • .github/workflows/opencode-review.yml
  • tests/test_opencode_live_draft_state_regression.py
  • tests/test_opencode_poll_rate_budget.py
  • tests/test_opencode_poll_self_retirement.py
  • tests/test_opencode_required_rerun_capacity.py
  • tests/test_opencode_required_verdict_regression.py
  • tests/test_required_workflow_queue_contract.py
💤 Files with no reviewable changes (2)
  • tests/test_opencode_poll_rate_budget.py
  • tests/test_opencode_poll_self_retirement.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Required OpenCode 검증의 장기 폴링과 재시도 로직을 제거했습니다. 대상 잡은 현재 헤드의 리뷰를 한 번 조회하고, 검증이 없으면 실패합니다. Dispatch 워크플로는 정확한 실패 실행을 재실행합니다. 관련 회귀 테스트를 갱신하고 용량 계약 테스트를 추가했습니다.

Required OpenCode 검증

Layer / File(s) Summary
단일 검증 및 fail-closed 실행
.github/workflows/opencode-review.yml, tests/test_required_workflow_queue_contract.py
대상 잡에서 180분 폴링, 재시도 카운터, 60초 대기, 반복 검증을 제거했습니다. 검증이 없으면 즉시 실패하고 dispatch 후 실패한 잡을 재실행합니다.
정확한 실행 재실행 계약
tests/test_opencode_required_rerun_capacity.py
Required 실행이 러너를 점유하지 않고 required_run_id로 재실행되는지 검증합니다. Dispatch가 현재 헤드의 정확한 실패 실행만 깨우는지 검증합니다.
검증 회귀 테스트 갱신
tests/test_opencode_live_draft_state_regression.py, tests/test_opencode_required_verdict_regression.py
테스트가 단일 Reviews API 조회와 새 fail-closed 메시지를 확인하도록 변경되었습니다. 제거된 폴링과 sleep 기반 재시도 관련 픽스처 및 설명을 삭제했습니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 716d8

Required OpenCode checks now release runners immediately when a verdict is absent, then rerun only the matching current-head failed check after publication. The updated workflow behavior and regression coverage show no remaining merge-readiness risk.

Sequence Diagram(s)

sequenceDiagram
  participant pull_request_target
  participant opencode-review-target
  participant opencode-review-dispatch
  pull_request_target->>opencode-review-target: Required 실행 시작
  opencode-review-target->>opencode-review-dispatch: required_run_id와 함께 dispatch
  opencode-review-dispatch->>opencode-review-target: 정확한 현재 헤드 검증 게시
  opencode-review-dispatch->>opencode-review-target: 실패한 정확한 실행 재실행
Loading

Possibly related PRs

Suggested reviewers: claude

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 77.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 4 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 dispatch 후 Required OpenCode 러너를 즉시 해제하는 주요 변경을 정확하고 간결하게 설명합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 77.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 4 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/opencode-rerun-handoff

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae
seonghobae merged commit 9db155a into main Sep 4, 2026
3 of 18 checks passed
@seonghobae
seonghobae deleted the codex/opencode-rerun-handoff branch September 4, 2026 05:20
seonghobae added a commit that referenced this pull request Sep 4, 2026
Re-investigation after the initial merge surfaced 2 more full-suite
regressions this PR's original scope caused, missed by the earlier
supersession check against #1830 alone:

- The proposed opencode-review-dispatch.yml wake-step redesign
  (pull_requests[]/PR-number matching, single lookup) contradicts
  #1830's OWN test (test_opencode_required_rerun_capacity.py), which
  still expects the original 12-attempt loop and .head_sha matching --
  a live design disagreement with already-shipped, already-tested
  behavior, not a stale assumption to just override.
- The proposed reconcile-opencode-required-verdict workflow_run:
  completed handler in pr-review-merge-scheduler.yml directly
  reintroduces the exact workflow_run-triggered fanout mechanism
  #1840 ("stop required-check completion fanout", merged 2026-09-04)
  deliberately removed in favor of native auto-merge.

Reverted both files to main's current content, removed the 4 test
files and 2 doc additions that only made sense under the reverted
design, and recomputed the now-restored opencode-review-dispatch.yml
blob-SHA pin. What survives, verified real and uncontested: adding
github-actions[bot] to opencode-review.yml's required-check verdict
lookup, matching scripts/ci/opencode_review_receipt_gate.py's own
FORMAL_AUTHORS allowlist. Rewrote the CHANGELOG and gap-baseline
entries to describe only this narrower, actually-landing scope.

Full suite: only the 1 pre-existing failure tracked by .github#1874
(unrelated stale hourly-cron test oracle) remains.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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