fix(automation): recover organization loop without maintainer PAT - #1580
Conversation
|
Warning Review limit reachedNext included review available in 10 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 (3)
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
left a comment
There was a problem hiding this comment.
Exact-current-head orchestration wake for 556dee448b24116276673321fcae0fbf564b84c8 only. The source is non-destructively reconciled with protected main, the duplicate Ready-successor PR has been closed to retire its queued runs, and this comment is not approval or predecessor-evidence transfer.
|
|
Root cause
Protected-main scheduled run
33483275421failed before the organization coordinator started becausePR_REVIEW_MERGE_TOKENwas absent and the workflow accepted no other bounded maintainer credential. The failing job log showsGH_TOKENempty and exits withPR_REVIEW_MERGE_TOKEN is required; the subsequent receipt upload fails because the coordinator never creates its JSON receipt.This is a central control-plane credential-availability defect, not a product test failure, provider/model failure, transient network failure, or downstream repository defect. Protected
mainat branch creation still had the same PAT-only workflow. The broader #1545 branch contained an OIDC fallback but is a much broader stale bundle; this branch extracts only the credential-recovery boundary.Test-first evidence
RED exact head
d6a726219bb317f12748006acbce050b27715bbcadded only the missing-credential contract. HostedOrganization Commercial Readiness Loop Quality CIrun33490804781, job99801577027, failed exactly that new assertion becauseid-token: writewas absent: 1 failed, 34 passed.Focused GREEN predecessor head
46261f201ba5d1dde7c40023dc6bd7097240abb9: hosted quality run33491063381, job99802413728, completed success with 35 passed,organization_commercial_readiness_loop.py382/382 statements and 88/88 branches (100%), compileall, and clean-tree verification.Current exact head
556dee448b24116276673321fcae0fbf564b84c8is the same focused repair after a normal non-force sync merge with protectedmain. Current-headOrganization Commercial Readiness Loop Quality CIruns33492667608and33492728477both completed success. Security and review workflows remain authoritative at this head; queued/skipped/cancelled evidence is not treated as passing and this PR must not merge until required current-head gates are terminal-successful.The minimal implementation keeps
PR_REVIEW_MERGE_TOKENas first choice; grantsid-token: writeonly to the coordinator job; allows only the required OpenCode API endpoint for this fallback; requests a job-bound GitHub OIDC token with bounded timeouts; validates non-empty token fields; masks temporary tokens; exchanges for the existing short-lived OpenCode GitHub App token; and never accepts${{ github.token }}/GITHUB_TOKENas mutation authority.docs/doctoring/organization-commercial-readiness-loop.mdrecords the production RCA, security boundary, and post-integration acceptance criteria. Operational closure requires a protected-main run after integration that proceeds beyond the missing-PAT guard and emits the deterministic fleet receipt while preserving fail-closed governance.Review boundary
This replaces draft #1577 on the same focused branch because the connected GitHub ready-for-review mutation currently errors in its GraphQL response normalization. #1577 had no submitted reviews; closing it and opening this non-draft PR preserved the branch and commits without force push or rebase, while allowing the repository's normal independent review automation to run. This is not merge authorization: required security, provenance, and independent review gates remain authoritative. No self-approval or gate weakening is requested.