Skip to content

Commit e2ebe6b

Browse files
committed
Wait for GHA eval results instead of falling back to local evaluation
1 parent ad39cac commit e2ebe6b

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

nixpkgs_review/review.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import subprocess
55
import sys
66
import tempfile
7+
import time
78
from dataclasses import dataclass, field
89
from enum import Enum
910
from pathlib import Path
@@ -296,14 +297,20 @@ def build_pr(self, pr_number: int) -> dict[System, list[Attr]]:
296297
pr = self.github_client.pull_request(pr_number)
297298

298299
packages_per_system: dict[System, set[str]] | None = None
299-
if self.use_github_eval and all(system in PLATFORMS for system in self.systems):
300-
# Attempt to fetch the GitHub actions evaluation result
301-
print("-> Attempting to fetch eval results from GitHub actions")
302-
packages_per_system = self.github_client.get_github_action_eval_result(pr)
300+
if self.use_github_eval:
301+
assert all(system in PLATFORMS for system in self.systems)
302+
print("-> Fetching eval results from GitHub actions")
303303

304-
if packages_per_system is not None:
305-
print("-> Successfully fetched rebuilds: no local evaluation needed")
304+
packages_per_system = self.github_client.get_github_action_eval_result(pr)
305+
timeout: int = 30
306+
while packages_per_system is None:
307+
print(f"...Results are not (yet) available. Retrying in {timeout}s")
308+
time.sleep(timeout)
309+
packages_per_system = self.github_client.get_github_action_eval_result(
310+
pr
311+
)
306312

313+
print("-> Successfully fetched rebuilds: no local evaluation needed")
307314
else:
308315
packages_per_system = None
309316

0 commit comments

Comments
 (0)