fix: an unanswered buildbot check exits 1

This commit is contained in:
Abdessamad Derraz committed 2026-11-06 03:28:14 +01:00
1 parent 74055a9f31
commit 2cb9a5a495
2 files changed
+34 -12

No files matched your search

+11 -4
View File
@@ -213,10 +213,12 @@ def main() -> None:
sys.exit(1)
# Unreachable upstream means the freshness question was not answered, and
# a zero exit says it was answered "fresh". A new asset nobody tracks, or
# a tracked one the buildbot dropped, is a change to act on: a zero exit
# there let the online pipeline call the system directory current.
if report.get("error") or pending(report):
# a zero exit says it was answered "fresh". An asset whose HEAD went
# unanswered is the same question left open, as check_freshness counts
# UNKNOWN. A new asset nobody tracks, or a tracked one the buildbot
# dropped, is a change to act on: a zero exit there let the online
# pipeline call the system directory current.
if report.get("error") or pending(report) or unanswered(report):
raise SystemExit(1)
@@ -225,6 +227,11 @@ def pending(report: dict) -> list[dict]:
return [e for e in report.get("entries", []) if e["status"] in ("NEW", "STALE")]
def unanswered(report: dict) -> list[dict]:
"""Tracked entries whose remote version could not be read."""
return [e for e in report.get("entries", []) if e["status"] == "UNKNOWN"]
if __name__ == "__main__":
from common import run_cli