From 609aa9803099bc4104d6b34a7974289d8e12ef33 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Mon, 15 Dec 2025 11:03:32 +0000 Subject: [PATCH] fix(sensor-proxy): skip prerelease versions in selfheal update check The selfheal timer was downloading prerelease versions (e.g., v5.0.0-rc.1) even when users had the stable channel selected. This happened because fetch_latest_release_tag() didn't filter out prereleases from the GitHub releases API response. Now both the Python-based parser and the grep fallback skip prereleases: - Python: checks `release.get("prerelease")` field - Grep fallback: filters out -rc, -alpha, -beta patterns Related to #849 --- scripts/install-sensor-proxy.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/install-sensor-proxy.sh b/scripts/install-sensor-proxy.sh index 91e0344..217f629 100755 --- a/scripts/install-sensor-proxy.sh +++ b/scripts/install-sensor-proxy.sh @@ -1422,6 +1422,8 @@ except json.JSONDecodeError: sys.exit(1) for release in releases: + if release.get("prerelease"): + continue tag_name = (release.get("tag_name") or "").strip() if not tag_name or tag_name.startswith("helm-chart"): continue @@ -1438,7 +1440,8 @@ sys.exit(0) fi if [[ -z "$tag" ]]; then - tag=$(printf '%s\n' "$response" | grep -o '"tag_name"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4 | grep -Ev '^helm-chart-' | head -n 1 || true) + # Fallback: use grep-based parsing, filtering out helm-chart and common prerelease patterns + tag=$(printf '%s\n' "$response" | grep -o '"tag_name"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4 | grep -Ev '^helm-chart-|-rc\.|-(alpha|beta|rc)[0-9]*$' | head -n 1 || true) fi if [[ -n "$tag" ]]; then