Fix stable Statbel release identity
GeoIntel release gates / Compile, test, contracts and builds (push) Canceled after 0s
GeoIntel release gates / Python and npm vulnerability policy (push) Canceled after 0s
GeoIntel release gates / GIS image, SBOM and container scan (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-19 01:43:07 +02:00
parent 50897c3473
commit 2be63b9152
4 changed files with 28 additions and 1 deletions
+13 -1
View File
@@ -42,6 +42,12 @@ DEFAULT_EVIDENCE_ROOT = Path("/app/storage/operator-evidence/statbel-population-
YEAR_PATTERN = re.compile(r"^20[0-9]{2}$")
SHA256_PATTERN = re.compile(r"^[0-9a-f]{64}$")
ACTIONABLE_STATUSES = {"update_available", "not_loaded"}
STABLE_CATALOG_IDENTITY_FIELDS = (
"metadata_identifier",
"metadata_url",
"remote_version",
"capabilities_sha256",
)
def parse_args() -> argparse.Namespace:
@@ -431,7 +437,13 @@ def load_staged_plan(
def require_catalog_unchanged(plan: dict[str, Any], decision: dict[str, Any]) -> None:
if plan.get("release") != decision.get("release") or plan.get("catalog_identity") != decision.get("catalog_identity"):
planned_identity = plan.get("catalog_identity") or {}
current_identity = decision.get("catalog_identity") or {}
identity_changed = any(
planned_identity.get(field) != current_identity.get(field)
for field in STABLE_CATALOG_IDENTITY_FIELDS
)
if plan.get("release") != decision.get("release") or identity_changed:
raise RuntimeError("The official Statbel release evidence changed; create and review a new staged plan")