fix(opencode): break runner-capacity dispatch deadlock - #1823
Merged
Conversation
Send the trusted opencode-review repository dispatch directly from the required workflow so sixty polling jobs cannot starve the scheduler that produces their verdicts. Signed-off-by: Seongho Bae <me@seonghobae.me> Commit-Message-Assisted-by: Claude (via Claude Code)
|
Warning Review limit reachedNext included review available in 17 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
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. Comment |
This was referenced Sep 4, 2026
seonghobae
added a commit
that referenced
this pull request
Sep 4, 2026
) Both are required-check tests that were broken org-wide, for every PR regardless of its own diff -- reproduced fresh on unmodified main. Root causes: tests/test_central_required_workflow_exact_inventory.py: its hard-coded EXPECTED_REQUIRED_WORKFLOW_PATHS oracle still had 9 entries (including osv-scanner-pr.yml and scorecard-pr.yml). #1826 ("consolidate required OSV and Scorecard scans") intentionally shrank the production REQUIRED_WORKFLOW_PATHS tuple to 7 entries and updated its sibling test file (test_central_required_workflow_ruleset_audit.py) to match, but missed this independent-oracle file. Confirmed via docs/org-required-workflow-rollout.md and git history (git log -S) that the 7-path production state is the intentional, current design -- not a regression -- so the fix updates the stale oracle, not production. tests/test_opencode_required_verdict_regression.py: two separate gaps from #1823 ("break runner-capacity dispatch deadlock"), which replaced opencode-review.yml's old event_type:"merge-scheduler" dispatch (a minimal payload: target_repository/pr_number/base_branch/max_prs/trigger_reviews/ enable_auto_merge/etc.) with a direct event_type:"opencode-review" dispatch carrying exact base/head SHAs and a required_run_id: - test_required_workflow_cannot_succeed_with_an_echo_only_placeholder still asserted the old event_type string and two fields (trigger_reviews:true, enable_auto_merge:false) that no longer exist anywhere in the workflow. Updated to check the new event_type and required_run_id fields instead; dropped the assertion with no direct successor field. - The "Request current-head OpenCode review execution" step's env block grew three new vars (BASE_SHA, HEAD_REF, plus the always-present $GITHUB_RUN_ID) that the subprocess-harness test building this step's env by hand hadn't been updated to supply, so the script died on `set -u` before reaching the code under test. Added the three missing entries. Verified full local triad: coverage run -m pytest tests -> 2779 passed, coverage report --fail-under=100 -> 100%, interrogate -> 100%. Not fixed in this pass (separate, lower-priority prose drift, no test currently pins it): docs/org-required-workflow-rollout.md still says "9 entries... through osv-scanner-pr.yml", stale since #1826's consolidation. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
문제
조직의 60개 동시 실행 슬롯이 Required OpenCode Review의 판정 polling job으로 모두 채워지면, 각 job이 먼저 queue에 넣은
merge-scheduler가 실행될 runner를 얻지 못합니다. 실제opencode-reviewdispatch가 생성되지 않으므로 60개 job이 판정을 기다리며 3시간 동안 슬롯을 점유하는 자기 교착이 발생합니다.2026-09-04 실측:
in_progress: 정확히 60개.githubqueued: 1,911개Fail closed without a current-head OpenCode verdict단계에서 실행 중수정
required workflow가 이미 교환한 repository-scoped app token으로 기존
opencode-reviewdefault-branch dispatch를 직접 호출합니다. 대상 저장소, PR 번호, base/head ref와 SHA, 현재 required run ID를 기존 dispatch 계약 그대로 전달합니다.merge-scheduler중간 hop만 제거하며 판정 polling, exact-head 검증, fail-closed 동작은 유지합니다.검증
actionlint .github/workflows/opencode-review.ymluv run pytest -q tests/test_required_workflow_queue_contract.py→ 75 passedgit diff --check운영 후속
이 PR이 main에 반영된 뒤 기존 60개 교착 run을 정리하고 현재 head에 필요한 required checks를 다시 실행해야 합니다. 이는 새 실행이 먼저 실제 review dispatch를 생성할 수 있게 runner 슬롯을 비우기 위한 닭-달걀 복구입니다.