Skip to content

Commit

Permalink
Wait for GHA eval results instead of falling back to local evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage committed Jan 5, 2025
1 parent ad39cac commit 4d0b8c0
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions nixpkgs_review/review.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 4d0b8c0

Please sign in to comment.