Let the release metadata tests accept beta versions (#2844)

The release train now cuts a beta every two days before the release
candidate. Its first beta, v6.6.0-beta.1, failed its preparation checks
twice (#2835): the governance test that maps VERSION to its release
packet only matched -rc.N, and two tests required the release index to
say "current v6 release candidate packet" while the metadata tool writes
"current v6 beta packet" for a beta.

This accepts -beta.N where the packet paths are derived and derives the
expected index wording from the version. Release candidates and stable
releases are checked as before.

Checked on the exact #2835 snapshot plus this change: the governance
suite passes (69 tests) and
TestCurrentPrereleasePacketTracksInstallMetadata passes rather than
skips.
This commit is contained in:
rcourtman
2026-10-11 21:30:10 +01:00
committed by GitHub
2 changed files with 11 additions and 5 deletions
@@ -1352,15 +1352,20 @@ func TestCurrentPrereleasePacketTracksInstallMetadata(t *testing.T) {
"Separate standalone Proxmox sites that reuse a short node name no longer lose correct agent links when their provider-observed addresses uniquely disambiguate them",
)
}
// The release train's betas point at their packet as "beta", candidates as "release candidate".
packetLabel := "release candidate"
if strings.Contains(version, "-beta.") {
packetLabel = "beta"
}
assertFileContainsAll(t, repoFile("docs", "RELEASE_NOTES.md"),
"docs/releases/RELEASE_NOTES_v"+version+".md",
"docs/releases/V6_CHANGELOG_v"+version+".md",
"current v6 release candidate packet",
"current v6 "+packetLabel+" packet",
)
assertFileContainsAll(t, repoFile("docs", "UPGRADE_v6.md"),
"docs/releases/RELEASE_NOTES_v"+version+".md",
"docs/releases/V6_CHANGELOG_v"+version+".md",
"current v6 release candidate packet",
"current v6 "+packetLabel+" packet",
)
assertFileContainsAll(t, repoFile("deploy", "helm", "pulse", "Chart.yaml"),
"version: "+version,
@@ -267,8 +267,8 @@ def rc_packet_paths_for_version(version: str) -> tuple[str, str, str] | None:
def support_prerelease_packet_paths_for_version(version: str) -> tuple[str, str] | None:
"""Return release-notes and changelog paths for post-GA support RC versions."""
if not re.match(r"^6\.\d+\.\d+-rc\.\d+$", version):
"""Return release-notes and changelog paths for post-GA support beta and RC versions."""
if not re.match(r"^6\.\d+\.\d+-(?:rc|beta)\.\d+$", version):
return None
if version.startswith("6.0.0-rc."):
return None
@@ -1661,7 +1661,8 @@ class ReleasePromotionPolicyTest(unittest.TestCase):
release_notes = read(release_notes_path)
changelog = read(changelog_path)
self.assertIn("current v6 release candidate packet", release_index)
packet_label = "beta" if "-beta." in current_version else "release candidate"
self.assertIn(f"current v6 {packet_label} packet", release_index)
self.assertIn(release_notes_path, release_index)
self.assertIn(changelog_path, release_index)
self.assertTrue(release_notes_have_exact_title(release_notes, current_version))