ci: review-gate passes when cubic is out of quota and CodeRabbit reviewed

Merged
RI
19h ago
+10-0

cubic's free review quota is used up, so review-gate failed on every pull request even when CodeRabbit had reviewed it. With this change the gate passes with a warning when cubic reports its limit is reached and CodeRabbit finished a review of the same commit. It still fails when neither bot reviewed: cubic out of quota and CodeRabbit rate limited, or CodeRabbit skipped the commit.

Summary by CodeRabbit

  • Bug Fixes
    • Review gating now handles cubic quota exhaustion separately. The gate passes with a warning only when CodeRabbit has successfully reviewed the current commit; otherwise, it fails. Other cubic results still require a successful “AI review completed” result, so their existing review requirements remain unchanged.

Verification

  • Gate step run locally against a fake gh returning fixed check-run JSON, 10 cases, all as expected:
    • cubic out of quota, CodeRabbit finished on the same commit: pass with warning
    • cubic out of quota, CodeRabbit rate limited: fail
    • cubic out of quota, CodeRabbit skipped the commit: fail
    • cubic out of quota, CodeRabbit "No files to review": fail
    • cubic out of quota, CodeRabbit path filters excluded all files: fail
    • cubic error: fail; cubic missing: fail
    • both reviewed: pass; cubic reviewed with CodeRabbit rate limited: pass with warning; cubic reviewed with CodeRabbit "No files to review": pass (unchanged)
  • Live on this PR: commit 03ea4a6 failed with CodeRabbit rate limited (expected), then passed after CodeRabbit finished. Head 7ebe09f: review-gate passed with "cubic is out of review quota; CodeRabbit reviewed this commit."
  • bash -n and YAML parse of the workflow pass.