From 00cd203b2399342f07c9836537ce5481cafc28d7 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 23 Oct 2026 18:52:04 +0200 Subject: [PATCH] feat: add schema_version to release.json --- release.json | 1 + schemas/release.schema.json | 6 +++++- scripts/release_record.py | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/release.json b/release.json index 962167ef..3a4bb873 100644 --- a/release.json +++ b/release.json @@ -1,4 +1,5 @@ { + "schema_version": 1, "tag": "v2026.10.10", "packs": { "Batocera_43.1_BIOS_Pack.zip": { diff --git a/schemas/release.schema.json b/schemas/release.schema.json index 4c3574ca..11f43b8e 100644 --- a/schemas/release.schema.json +++ b/schemas/release.schema.json @@ -5,8 +5,12 @@ "description": "What the packs of the latest release hold, read from the archives when the release is cut.", "type": "object", "additionalProperties": false, - "required": ["tag", "packs"], + "required": ["schema_version", "tag", "packs"], "properties": { + "schema_version": { + "const": 1, + "description": "Format version of this record, raised when a field changes meaning or goes away." + }, "tag": { "type": "string", "pattern": "^v[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}$" }, "packs": { "type": "object", diff --git a/scripts/release_record.py b/scripts/release_record.py index 6737b509..979919a1 100644 --- a/scripts/release_record.py +++ b/scripts/release_record.py @@ -31,6 +31,9 @@ from common import ( ) RECORD = "release.json" +# The record's format, which release.schema.json pins: a reader holding the +# file alone can tell which shape it reads. +SCHEMA_VERSION = 1 # Each registered platform has a page at get// on the site: the # current pack's files, or the command when no release publishes one. The # address outlives every release, so a link written elsewhere keeps working. @@ -120,7 +123,7 @@ def _read_record(dist: Path, tag: str, owners: dict[str, list[str]]) -> dict: "assets": [path.name for path in paths], "platforms": owners[name], } - return {"tag": tag, "packs": packs} + return {"schema_version": SCHEMA_VERSION, "tag": tag, "packs": packs} def load_record(path: str | Path = RECORD) -> dict: