Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

ci(repo): stop an out-of-quota Copilot review from blocking every merge (#14965)

Nicholas Tindle12225b6a0aa9
diff --git a/.github/workflows/scripts/check_actions_status.py b/.github/workflows/scripts/check_actions_status.py
index 8b142f9381..d9e2710868 100644
--- a/.github/workflows/scripts/check_actions_status.py
+++ b/.github/workflows/scripts/check_actions_status.py
@@ -7,6 +7,18 @@ from typing import Dict, List, Optional, Tuple
CHECK_INTERVAL = 30
PASSING_CONCLUSIONS = {"success", "skipped", "neutral"}
+# Check runs whose outcome says nothing about the code: they post review
+# comments, and they conclude "failure" when the reviewer itself could not
+# run. GitHub's Copilot code review did exactly that on 2026-09-26 (HTTP 402,
+# "You have exceeded your monthly quota") and blocked every PR in the repo
+# through this check. Other review bots report "neutral" in that case, which
+# PASSING_CONCLUSIONS already accepts; this is the same treatment for one
+# that does not.
+ADVISORY_CHECK_RUNS = {"copilot-pull-request-reviewer"}
+
+
+def is_advisory(check_run: Dict) -> bool:
+ return str(check_run.get("name")) in ADVISORY_CHECK_RUNS
def get_environment_variables() -> Tuple[str, str, str, str, str]:
@@ -130,6 +142,12 @@ def process_check_runs(
all_others_passed = True
for run in check_runs:
+ if is_advisory(run):
+ print(
+ f"Ignoring advisory check run {run['name']} (ID: {run['id']}): "
+ "its result never gates a merge."
+ )
+ continue
if str(run["name"]) != "Check PR Status":
status = run["status"]
conclusion = run["conclusion"]
@@ -186,6 +204,7 @@ def main():
runs_in_progress = any(
str(run["name"]) != "Check PR Status"
+ and not is_advisory(run)
and run["status"] != "completed"
for run in check_runs
)
diff --git a/.github/workflows/scripts/test_check_actions_status.py b/.github/workflows/scripts/test_check_actions_status.py
index dd0461ca2a..2699b327c1 100644
--- a/.github/workflows/scripts/test_check_actions_status.py
+++ b/.github/workflows/scripts/test_check_actions_status.py
@@ -119,6 +119,37 @@ class ProcessCheckRunsTests(unittest.TestCase):
self.assertEqual(result, (False, False))
+ def test_ignores_an_advisory_reviewer_that_could_not_run(self):
+ """Copilot code review concludes "failure" when Copilot itself is out
+ of quota (HTTP 402); that says nothing about the code and must not
+ block the merge."""
+ copilot = {
+ "id": 7,
+ "name": "copilot-pull-request-reviewer",
+ "status": "completed",
+ "conclusion": "failure",
+ }
+ self.assertEqual(process_check_runs([copilot]), (False, True))
+
+ def test_an_advisory_reviewer_still_running_does_not_hold_the_check(self):
+ copilot = {
+ "id": 7,
+ "name": "copilot-pull-request-reviewer",
+ "status": "in_progress",
+ "conclusion": None,
+ }
+ self.assertEqual(process_check_runs([copilot]), (False, True))
+
+ def test_a_real_failure_beside_an_advisory_one_still_fails(self):
+ copilot = {
+ "id": 7,
+ "name": "copilot-pull-request-reviewer",
+ "status": "completed",
+ "conclusion": "failure",
+ }
+ failed = {"id": 8, "name": "test", "status": "completed", "conclusion": "failure"}
+ self.assertEqual(process_check_runs([copilot, failed]), (False, False))
+
def test_rejects_real_failure(self):
failed_check = {**CANCELED_CHECK, "conclusion": "failure"}