Skip to content

Commit

Permalink
improve logging if evaluation is not present in github
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Jan 2, 2025
1 parent 6555cad commit 5b6931b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion 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
from .utils import System, warn


def pr_url(pr: int) -> str:
Expand Down Expand Up @@ -175,16 +175,26 @@ 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

0 comments on commit 5b6931b

Please sign in to comment.