diff --git a/nixpkgs_review/review.py b/nixpkgs_review/review.py index a3db522..f0ee363 100644 --- a/nixpkgs_review/review.py +++ b/nixpkgs_review/review.py @@ -4,6 +4,7 @@ import subprocess import sys import tempfile +import time from dataclasses import dataclass, field from enum import Enum from pathlib import Path @@ -296,14 +297,20 @@ def build_pr(self, pr_number: int) -> dict[System, list[Attr]]: pr = self.github_client.pull_request(pr_number) packages_per_system: dict[System, set[str]] | None = None - if self.use_github_eval and all(system in PLATFORMS for system in self.systems): - # Attempt to fetch the GitHub actions evaluation result - print("-> Attempting to fetch eval results from GitHub actions") - packages_per_system = self.github_client.get_github_action_eval_result(pr) + if self.use_github_eval: + assert all(system in PLATFORMS for system in self.systems) + print("-> Fetching eval results from GitHub actions") - if packages_per_system is not None: - print("-> Successfully fetched rebuilds: no local evaluation needed") + packages_per_system = self.github_client.get_github_action_eval_result(pr) + timeout: int = 10 + while packages_per_system is None: + print(f"...Results are not (yet) available. Retrying in {timeout}s") + packages_per_system = self.github_client.get_github_action_eval_result( + pr + ) + time.sleep(timeout) + print("-> Successfully fetched rebuilds: no local evaluation needed") else: packages_per_system = None