34 lines
1.4 KiB
Python
34 lines
1.4 KiB
Python
#!/usr/bin/env python3
|
|
"""Fail the final release gate until every target has traceable evidence."""
|
|
|
|
import json
|
|
import pathlib
|
|
import sys
|
|
|
|
manifest = json.loads(pathlib.Path("ci/conformance.json").read_text())
|
|
rows = manifest["targets"]
|
|
expected = {(board, chip) for board in manifest["boards"] for chip in manifest["chips"]
|
|
if manifest["vendors"][board] == manifest["vendors"][chip]}
|
|
actual = {(row["board"], row["chip"]) for row in rows}
|
|
if actual != expected or len(rows) != len(expected):
|
|
sys.exit(f"matrix mismatch: {len(actual)} present, {len(expected)} expected")
|
|
|
|
required = ("sdk_image_sha256", "stock_image_sha256", "stock_result",
|
|
"alkane_share_accept_capture", "simulator_trace_sha256",
|
|
"bench_validation")
|
|
incomplete = []
|
|
for row in rows:
|
|
missing = [field for field in required if not row.get(field)]
|
|
if row.get("stock_result") not in (None, "mines", "rejects"):
|
|
missing.append("stock_result invalid")
|
|
if row.get("stock_result") == "rejects" and not row.get("stock_first_rejection"):
|
|
missing.append("stock_first_rejection")
|
|
if missing:
|
|
incomplete.append((row["board"], row["chip"], missing))
|
|
if incomplete:
|
|
print(f"Conformance pending: {len(incomplete)}/{len(rows)} targets")
|
|
for board, chip, missing in incomplete[:8]:
|
|
print(f" {board} x {chip}: {', '.join(missing)}")
|
|
sys.exit(1)
|
|
print(f"Conformance complete: {len(rows)} targets")
|