aboutsummaryrefslogtreecommitdiff
path: root/scripts/preview.py
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-02 02:45:20 +0300
committerGitHub <noreply@github.com>2026-09-02 02:45:20 +0300
commitcc88b3b8e5bb9f7d9f23ed6ae85a52fd7b5b9ed6 (patch)
tree4d37c760099070f1a1488b61c7b7271875aafef8 /scripts/preview.py
parent18e69891dca486d669a584facd80644bb51f54a2 (diff)
feat: add stable client endpoint compatibility (#3509)
* feat: add stable client endpoint compatibility * fix: keep portable-pty patch checks composable * ci: run maintenance checks in pull requests * fix: reject endpoint errors from terminal clients * feat: keep compatible servers running across updates
Diffstat (limited to 'scripts/preview.py')
-rw-r--r--scripts/preview.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/preview.py b/scripts/preview.py
index 16c52b6e..935ee9b7 100644
--- a/scripts/preview.py
+++ b/scripts/preview.py
@@ -38,6 +38,7 @@ TYPE_HEADINGS = {
}
TYPE_ORDER = ("Added", "Fixed", "Performance", "Maintenance", "Other")
COMMIT_RE = re.compile(r"^(?P<kind>[a-z]+)(?:\([^)]+\))?!?:\s+(?P<body>.+)$")
+ENDPOINT_PROTOCOL_SOURCE_PATH = Path("src/protocol/endpoint.rs")
def run_git(args: list[str]) -> str:
@@ -48,6 +49,18 @@ def normalize_version(version: str) -> str:
return version.strip().removeprefix("v")
+def read_endpoint_protocol_generation(
+ source_path: Path = ENDPOINT_PROTOCOL_SOURCE_PATH,
+) -> int:
+ content = source_path.read_text(encoding="utf-8")
+ match = re.search(r"pub const ENDPOINT_PROTOCOL_GENERATION: u32 = (\d+);", content)
+ if not match:
+ raise ValueError(
+ f"could not read ENDPOINT_PROTOCOL_GENERATION from {source_path}"
+ )
+ return int(match.group(1))
+
+
def latest_stable_tag(ref: str | None = None) -> str:
args = ["describe", "--tags", "--match", "v[0-9]*", "--abbrev=0"]
if ref:
@@ -215,11 +228,13 @@ def build_manifest(
current = read_json(output) or {}
builds = current.get("builds") if isinstance(current.get("builds"), dict) else {}
builds = dict(builds)
+ endpoint_generation = read_endpoint_protocol_generation()
builds[build_id] = {
"base_version": normalize_version(base_version),
"commit": commit,
"built_at": built_at,
"protocol": protocol,
+ "endpoint_generation": endpoint_generation,
"tag": tag,
"assets": assets,
}
@@ -239,6 +254,7 @@ def build_manifest(
"commit": commit,
"built_at": built_at,
"protocol": protocol,
+ "endpoint_generation": endpoint_generation,
"notes": notes.strip(),
"assets": assets,
"builds": ordered_builds,