Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
fix(release): measure candidate soak from release publication
pulse-triage[bot]7db3192a3fa2
diff --git a/scripts/release_control/resolve_release_promotion.py b/scripts/release_control/resolve_release_promotion.pyindex 3b99bc9a3c..d1034bea9b 100644--- a/scripts/release_control/resolve_release_promotion.py+++ b/scripts/release_control/resolve_release_promotion.py@@ -177,19 +177,26 @@ def head_descends_from(commit: str) -> bool:return result.returncode == 0-def tag_created_unix(tag: str) -> int:+def release_published_unix(tag: str) -> int:+ # A tag may predate publication (lightweight tags even use commit time).+ # Never fall back to Git timestamps when release evidence is unavailable.result = subprocess.run(- ["git", "for-each-ref", "--format=%(creatordate:unix)", f"refs/tags/{tag}"],+ ["gh", "release", "view", tag, "--json",+ "tagName,isDraft,isPrerelease,publishedAt"],cwd=REPO_ROOT,- env=git_env(),check=True,capture_output=True,text=True,)- value = result.stdout.strip().splitlines()- if not value or not value[0].strip():- raise ValueError(f"Could not determine creation time for promoted prerelease tag {tag}.")- return int(value[0].strip())+ release = json.loads(result.stdout)+ if (release.get("tagName") != tag or release.get("isDraft") is not False+ or release.get("isPrerelease") is not True+ or not release.get("publishedAt")):+ raise ValueError(f"Promoted candidate {tag} must be a published prerelease.")+ published = datetime.fromisoformat(release["publishedAt"].replace("Z", "+00:00"))+ if published.tzinfo is None:+ raise ValueError(f"Publication time for promoted candidate {tag} must include a timezone.")+ return int(published.timestamp())def normalize_whitespace(value: str) -> str:@@ -339,7 +346,7 @@ def resolve_metadata(tag_exists_fn: Callable[[str], bool] = tag_exists,tag_commit_fn: Callable[[str], str] = tag_commit,head_descends_from_fn: Callable[[str], bool] = head_descends_from,- tag_created_unix_fn: Callable[[str], int] = tag_created_unix,+ release_published_unix_fn: Callable[[str], int] = release_published_unix,now_unix_fn: Callable[[], int] = lambda: int(time.time()),) -> dict[str, str]:stage = release_stage(version)@@ -511,7 +518,7 @@ def resolve_metadata(f"Stable promotion {tag} must descend from promoted prerelease tag {promoted_from_tag}.")- promoted_tag_ts = tag_created_unix_fn(promoted_from_tag)+ promoted_tag_ts = release_published_unix_fn(promoted_from_tag)soak_hours_value = int((now_unix_fn() - promoted_tag_ts) / 3600)soak_hours = str(soak_hours_value)# The release train governs v6.5.0 and later. Earlier lines shippeddiff --git a/scripts/release_control/resolve_release_promotion_test.py b/scripts/release_control/resolve_release_promotion_test.pyindex 2632709105..b059735559 100644--- a/scripts/release_control/resolve_release_promotion_test.py+++ b/scripts/release_control/resolve_release_promotion_test.py@@ -5,6 +5,9 @@ from __future__ import annotationsfrom pathlib import Pathimport unittest+from unittest.mock import patch+import json+import subprocessimport resolve_release_promotion as resolver@@ -12,6 +15,31 @@ REPO_ROOT = Path(__file__).resolve().parents[2]class ResolveReleasePromotionTest(unittest.TestCase):+ def test_candidate_clock_uses_exact_release_publication(self) -> None:+ payload = dict(tagName="v6.5.0-rc.2", isDraft=False,+ isPrerelease=True, publishedAt="2026-09-05T00:00:00Z")+ with patch.object(resolver.subprocess, "run") as run:+ run.return_value.stdout = json.dumps(payload)+ self.assertEqual(resolver.release_published_unix("v6.5.0-rc.2"),+ 1788566400)+ self.assertEqual(run.call_args.args[0][:4],+ ["gh", "release", "view", "v6.5.0-rc.2"])+ self.assertEqual(run.call_count, 1)++ def test_candidate_clock_fails_closed_without_publication(self) -> None:+ payload = dict(tagName="v6.5.0-rc.2", isDraft=False,+ isPrerelease=True, publishedAt="2026-09-05T00:00:00Z")+ for change in (dict(isDraft=True), dict(isPrerelease=False),+ dict(publishedAt=None), dict(tagName="v6.5.0-rc.1"),+ dict(publishedAt="2026-09-05T00:00:00")):+ with self.subTest(change=change), patch.object(resolver.subprocess, "run") as run:+ run.return_value.stdout = json.dumps(payload | change)+ with self.assertRaises(ValueError):+ resolver.release_published_unix("v6.5.0-rc.2")+ with patch.object(resolver.subprocess, "run", side_effect=subprocess.CalledProcessError(1, "gh")):+ with self.assertRaises(subprocess.CalledProcessError):+ resolver.release_published_unix("v6.5.0-rc.2")+def test_published_release_versions_use_explicit_maturity_stages(self) -> None:for version, expected in (("6.5.0-alpha.1", "alpha"),@@ -251,7 +279,7 @@ class ResolveReleasePromotionTest(unittest.TestCase):tag_exists_fn=lambda tag: tag in {"v6.0.0-rc.2", "v5.1.14"},tag_commit_fn=lambda tag: "abc123",head_descends_from_fn=lambda commit: commit == "abc123",- tag_created_unix_fn=lambda tag: 100,+ release_published_unix_fn=lambda tag: 100,now_unix_fn=lambda: 100 + (73 * 3600),)self.assertEqual(metadata["promoted_from_tag"], "v6.0.0-rc.2")@@ -278,7 +306,7 @@ class ResolveReleasePromotionTest(unittest.TestCase):tag_exists_fn=lambda tag: tag in {"v6.1.0-rc.4", "v6.0.5"},tag_commit_fn=lambda tag: "rc4-commit",head_descends_from_fn=lambda commit: commit == "rc4-commit",- tag_created_unix_fn=lambda tag: 100,+ release_published_unix_fn=lambda tag: 100,now_unix_fn=lambda: 100 + (27 * 3600),)@@ -368,7 +396,7 @@ class ResolveReleasePromotionTest(unittest.TestCase):tag_exists_fn=lambda tag: tag in {"v6.2.0-rc.11", "v6.1.2"},tag_commit_fn=lambda tag: "rc11-commit",head_descends_from_fn=lambda commit: commit == "rc11-commit",- tag_created_unix_fn=lambda tag: 100,+ release_published_unix_fn=lambda tag: 100,now_unix_fn=lambda: 100 + (13 * 3600),)@@ -427,7 +455,7 @@ class ResolveReleasePromotionTest(unittest.TestCase):tag_exists_fn=lambda tag: tag in {"v6.3.0-rc.6", "v6.2.1"},tag_commit_fn=lambda tag: "rc6-commit",head_descends_from_fn=lambda commit: commit == "rc6-commit",- tag_created_unix_fn=lambda tag: 100,+ release_published_unix_fn=lambda tag: 100,now_unix_fn=lambda: 100 + (24 * 3600),)@@ -512,7 +540,7 @@ class ResolveReleasePromotionTest(unittest.TestCase):tag_exists_fn=lambda tag: tag in {"v6.4.0-rc.1", "v6.3.2"},tag_commit_fn=lambda tag: "rc-commit" if tag == "v6.4.0-rc.1" else "v632-commit",head_descends_from_fn=lambda commit: True,- tag_created_unix_fn=lambda tag: 100,+ release_published_unix_fn=lambda tag: 100,now_unix_fn=lambda: 100 + (73 * 3600),)@@ -552,7 +580,7 @@ class ResolveReleasePromotionTest(unittest.TestCase):"tag_exists_fn": lambda tag: True,"tag_commit_fn": lambda tag: "rc4-commit","head_descends_from_fn": lambda commit: True,- "tag_created_unix_fn": lambda tag: 100,+ "release_published_unix_fn": lambda tag: 100,"now_unix_fn": lambda: 100 + (27 * 3600),}with self.assertRaisesRegex(ValueError, "unsigned_windows_reason is required"):@@ -585,7 +613,7 @@ class ResolveReleasePromotionTest(unittest.TestCase):tag_exists_fn=lambda tag: True,tag_commit_fn=lambda tag: "abc123",head_descends_from_fn=lambda commit: True,- tag_created_unix_fn=lambda tag: 100,+ release_published_unix_fn=lambda tag: 100,now_unix_fn=lambda: 100 + (73 * 3600),)@@ -603,7 +631,7 @@ class ResolveReleasePromotionTest(unittest.TestCase):tag_exists_fn=lambda tag: tag in {"v6.0.0-rc.7", "v5.1.35"},tag_commit_fn=lambda tag: "rc7-commit",head_descends_from_fn=lambda commit: commit == "rc7-commit",- tag_created_unix_fn=lambda tag: 100,+ release_published_unix_fn=lambda tag: 100,now_unix_fn=lambda: 100 + (163 * 3600),)@@ -767,7 +795,7 @@ class ResolveReleasePromotionTest(unittest.TestCase):tag_exists_fn=lambda tag: True,tag_commit_fn=lambda tag: "abc123",head_descends_from_fn=lambda commit: True,- tag_created_unix_fn=lambda tag: 100,+ release_published_unix_fn=lambda tag: 100,now_unix_fn=lambda: 100 + (2 * 3600),)@@ -785,7 +813,7 @@ class ResolveReleasePromotionTest(unittest.TestCase):tag_exists_fn=lambda tag: True,tag_commit_fn=lambda tag: "abc123",head_descends_from_fn=lambda commit: True,- tag_created_unix_fn=lambda tag: 100,+ release_published_unix_fn=lambda tag: 100,now_unix_fn=lambda: 100 + (2 * 3600),)@@ -807,7 +835,7 @@ class ReleaseTrainPromotionTest(unittest.TestCase):tag_exists_fn=lambda tag: tag in {f"v{promoted}", "v6.4.1"},tag_commit_fn=lambda tag: "abc123",head_descends_from_fn=lambda commit: commit == "abc123",- tag_created_unix_fn=lambda tag: 100,+ release_published_unix_fn=lambda tag: 100,now_unix_fn=lambda: 100 + (168 * 3600),changed_paths_fn=lambda base_tag: ["VERSION",@@ -876,6 +904,27 @@ class ReleaseTrainPromotionTest(unittest.TestCase):)self.assertEqual(metadata["hotfix_exception"], "true")+ def test_repaired_candidate_restarts_full_publication_soak(self) -> None:+ for version, hours in (("6.5.0", 168), ("6.5.1", 72)):+ tag = f"v{version}-rc.2"+ observed = []+ def publication(candidate):+ observed.append(candidate)+ return 200+ arguments = dict(+ promoted_from_tag_input=tag,+ tag_exists_fn=lambda candidate: candidate in {tag, "v6.4.1"},+ release_published_unix_fn=publication,+ )+ with self.subTest(version=version):+ with self.assertRaisesRegex(ValueError, "hours"):+ self.promote(version, now_unix_fn=lambda: 200 + hours * 3600 - 1,+ **arguments)+ metadata = self.promote(+ version, now_unix_fn=lambda: 200 + hours * 3600, **arguments)+ self.assertEqual(metadata["soak_hours"], str(hours))+ self.assertEqual(observed, [tag, tag])+def test_minor_releases_soak_seven_days_and_patches_seventy_two_hours(self) -> None:with self.assertRaisesRegex(ValueError, "release train requires 168 hours"):self.promote("6.5.0", now_unix_fn=lambda: 100 + (100 * 3600))