fix(actions): recover current startup failures - #1846
Merged
Merged
Conversation
Signed-off-by: Seongho Bae <[email protected]>
Contributor
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughStartup-failure 실행을 현재 PR 헤드 기준으로 복구하고, Strix 이벤트를 라이브 PR 메타데이터와 대조하도록 변경했습니다. 승인된 PR은 단일 동시성 그룹에서 처리하며 이전 스캔을 취소합니다. ChangesStartup-failure 복구
Strix 헤드 승인 및 동시성
Estimated code review effort: 4 (Complex) | ~45 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant inspect_pr
participant recover_current_head_startup_failures
participant GitHub_Actions_API
participant restamp_pr_head_after_startup_failure
inspect_pr->>recover_current_head_startup_failures: 현재 PR 헤드 복구 검사
recover_current_head_startup_failures->>GitHub_Actions_API: head_sha 기준 workflow runs 조회
GitHub_Actions_API-->>recover_current_head_startup_failures: 최신 startup_failure 실행 반환
recover_current_head_startup_failures->>restamp_pr_head_after_startup_failure: guarded same-tree restamp
restamp_pr_head_after_startup_failure-->>inspect_pr: 복구된 실행 ID 반환
sequenceDiagram
participant Strix_event
participant admit_current_head
participant GitHub_PR_API
participant strix
Strix_event->>admit_current_head: 이벤트 메타데이터 전달
admit_current_head->>GitHub_PR_API: 라이브 PR 정보 조회
GitHub_PR_API-->>admit_current_head: 현재 상태와 base/head 반환
admit_current_head-->>strix: 승인된 저장소와 PR 번호 전달
strix->>strix: 동일 PR 동시성 그룹에서 이전 실행 취소
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
seonghobae
added a commit
that referenced
this pull request
Sep 5, 2026
…UB_ACTIONS-agnostic recover_current_head_startup_failures() only runs inside inspect_pr() when os.environ["GITHUB_ACTIONS"] == "true" (#1846), so it silently never fired in a developer's local shell -- but GitHub Actions sets that variable for the entire job, including the pytest process that runs this very test file. 14 pre-existing tests (12 sharing the cancel_stale_pr_runs stub, 2 closing empty PRs) call inspect()/inspect_pr() with dry_run=False and never anticipated this side effect, so in CI they hit the real recovery path: one cluster used the fixture's placeholder headRefOid="head" and blew up in validate_git_sha, the other supplied a real sha but its narrow `run` stub didn't accept the recovery path's extra kwargs. Stub recover_current_head_startup_failures to a no-op `[]` in each, matching the existing pattern already used by test_inspect_pr_recovers_startup_failure_before_other_actions for the one test that intentionally exercises this integration. Reproduced and verified with GITHUB_ACTIONS=true set locally under both Python 3.12 and the CI-pinned 3.14: full suite 2833 passed, 1 skipped, 21 subtests, 100% coverage on the previously-failing job's tracked modules. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Merged
4 tasks done
seonghobae
added a commit
that referenced
this pull request
Sep 5, 2026
…UB_ACTIONS-agnostic (#1896) recover_current_head_startup_failures() only runs inside inspect_pr() when os.environ["GITHUB_ACTIONS"] == "true" (#1846), so it silently never fired in a developer's local shell -- but GitHub Actions sets that variable for the entire job, including the pytest process that runs this very test file. 14 pre-existing tests (12 sharing the cancel_stale_pr_runs stub, 2 closing empty PRs) call inspect()/inspect_pr() with dry_run=False and never anticipated this side effect, so in CI they hit the real recovery path: one cluster used the fixture's placeholder headRefOid="head" and blew up in validate_git_sha, the other supplied a real sha but its narrow `run` stub didn't accept the recovery path's extra kwargs. Stub recover_current_head_startup_failures to a no-op `[]` in each, matching the existing pattern already used by test_inspect_pr_recovers_startup_failure_before_other_actions for the one test that intentionally exercises this integration. Reproduced and verified with GITHUB_ACTIONS=true set locally under both Python 3.12 and the CI-pinned 3.14: full suite 2833 passed, 1 skipped, 21 subtests, 100% coverage on the previously-failing job's tracked modules. Co-authored-by: Claude Sonnet 5 <[email protected]>
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.
Summary
startup_failureruns with one guarded same-tree head refresh, because GitHub rejects rerunning pre-job failuresworkflow-repository-PRprovider queuepull_request_targetandrepository_dispatchStrix evidence for one PR withcancel-in-progress: true, while preserving push/schedule runsRoot-cause evidence
startup_failurewas created after central07db37e; the retired CodeQL case is explicitly excluded.POST /actions/runs/32985871408/rerunreturns403 This workflow run cannot be retried.github.event_name, splitting native and dispatched evidence for the same repository/PR, and usedcancel-in-progress: false.Verification
python -m pytest -q tests/test_required_workflow_queue_contract.py tests/test_pr_review_merge_scheduler.py tests/test_codeql_pr_workflow_contract.py tests/test_codeql_scan_dispatch_workflow_contract.py tests/test_code_scanning_required_workflow_contract.py tests/test_central_required_workflow_ruleset_audit.py— 418 passedactionlint -no-color .github/workflows/strix.ymlbash -n scripts/ci/test_strix_quick_gate.shgit diff --checkbash scripts/ci/test_strix_quick_gate.shpassed on baseed6d2b53; after base moved tod6c636a9, the harness has unrelated OpenCode expectation failures introduced by fix(actions): admit live review heads before cancellation #1845. This PR does not alter those OpenCode/Noema files or assertions.Scope guard
scripts/ci/contextual_orchestrator_review_sidecar.shand its direct contract test are intentionally untouched. No product code changes.Summary by CodeRabbit
버그 수정
검증