Skip to content

Commit

Permalink
Remove warning from github eval fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage committed Jan 5, 2025
1 parent d326eac commit 74322ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
17 changes: 1 addition & 16 deletions nixpkgs_review/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pathlib import Path
from typing import IO, Any, override

from .utils import System, warn
from .utils import System


def pr_url(pr: int) -> str:
Expand Down Expand Up @@ -175,32 +175,17 @@ def get_github_action_eval_result(
workflow_run["artifacts_url"],
)["artifacts"]

found_comparison = False
for artifact in artifacts:
if artifact["name"] != "comparison":
continue
found_comparison = True
changed_paths: Any = self.get_json_from_artifact(
workflow_id=artifact["id"],
json_filename="changed-paths.json",
)
if changed_paths is None:
warn(
f"Found comparison artifact, but no changed-paths.json in workflow {workflow_run['html_url']}"
)
continue
if (path := changed_paths.get("rebuildsByPlatform")) is not None:
assert isinstance(path, dict)
return path

if not found_comparison:
if workflow_run["status"] == "queued":
warn(
f"Found eval workflow run, but evaluation is still work in progress: {workflow_run['html_url']}"
)
else:
warn(
f"Found eval workflow run, but no comparison artifact in {workflow_run['html_url']}."
)

return None
3 changes: 2 additions & 1 deletion nixpkgs_review/review.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ def build_pr(self, pr_number: int) -> dict[System, list[Attr]]:
timeout: int = 10
print(f"...Results are not (yet) available. Retrying in {timeout}s")
while packages_per_system is None:
print(".", end="")
print("---------------")
# print(".", end="")
time.sleep(timeout)
packages_per_system = (
self.github_client.get_github_action_eval_result(pr)
Expand Down

0 comments on commit 74322ca

Please sign in to comment.