autopilot-code 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/run_autopilot.py +8 -2
package/package.json
CHANGED
package/scripts/run_autopilot.py
CHANGED
|
@@ -28,6 +28,8 @@ import shutil
|
|
|
28
28
|
|
|
29
29
|
STATE_DIR = ".autopilot"
|
|
30
30
|
STATE_FILE = "state.json"
|
|
31
|
+
GLOBAL_CONFIG_DIR = Path.home() / ".config" / "autopilot"
|
|
32
|
+
GLOBAL_STATE_FILE = GLOBAL_CONFIG_DIR / "state.json"
|
|
31
33
|
DEFAULT_HEARTBEAT_MAX_AGE_SECS = 60 * 60 # 1h
|
|
32
34
|
DEFAULT_MAX_DEPTH = 3
|
|
33
35
|
IGNORED_DIRS = {
|
|
@@ -621,9 +623,13 @@ def try_merge_pr(cfg: RepoConfig, issue_number: int, pr: dict[str, Any]) -> bool
|
|
|
621
623
|
has_failure = any(c.get("conclusion") == "FAILURE" for c in checks)
|
|
622
624
|
has_pending = any(c.get("conclusion") in ("PENDING", "QUEUED", None) for c in checks)
|
|
623
625
|
|
|
624
|
-
|
|
626
|
+
# If all checks are pending/queued and there are more than 0, it's pending
|
|
627
|
+
# But we should also check the rollup state if available
|
|
628
|
+
rollup_state = pr_details.get("statusCheckRollup", {}).get("state") if isinstance(pr_details.get("statusCheckRollup"), dict) else None
|
|
629
|
+
|
|
630
|
+
if has_failure or rollup_state == "FAILURE":
|
|
625
631
|
check_status = "FAILED"
|
|
626
|
-
elif has_pending:
|
|
632
|
+
elif has_pending or rollup_state == "PENDING":
|
|
627
633
|
check_status = "PENDING"
|
|
628
634
|
else:
|
|
629
635
|
check_status = "PASSED"
|