fix: read the buildbot system index for freshness

This commit is contained in:
Abdessamad Derraz committed 2026-10-17 20:44:47 +02:00
1 parent 33562e69aa
commit e93fe09a88
3 files changed
+56 -2

No files matched your search

+9 -2
View File
@@ -205,10 +205,17 @@ def main() -> None:
sys.exit(1)
# Unreachable upstream means the freshness question was not answered, and
# a zero exit says it was answered "fresh".
if report.get("error"):
# 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):
raise SystemExit(1)
def pending(report: dict) -> list[dict]:
"""Entries a maintainer has to act on: not tracked yet, or gone."""
return [e for e in report.get("entries", []) if e["status"] in ("NEW", "STALE")]
if __name__ == "__main__":
main()