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
This commit is contained in:
rcourtman 2025-12-15 11:03:32 +00:00
parent 06ae5295b3
commit 609aa98030

View file

@ -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