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): reject issue references in highlights
rcourtman4739d9af0735
diff --git a/scripts/release_control/render_release_body.py b/scripts/release_control/render_release_body.pyindex bc7526aff6..db69449047 100644--- a/scripts/release_control/render_release_body.py+++ b/scripts/release_control/render_release_body.py@@ -21,6 +21,15 @@ _VALIDATION_STATUS_BLOCK_RE = re.compile(_HIGHLIGHTS_HEADING_RE = re.compile(r"^(#{2,6})[ \t]+Highlights[ \t]*$", re.IGNORECASE)_HIGHLIGHT_BULLET_RE = re.compile(r"^-[ \t]+(.+)$")+_ISSUE_REFERENCE_RE = re.compile(+ r"(?:"+ r"(?<![A-Za-z0-9])#[0-9]+\b"+ r"|\b[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+#[0-9]+\b"+ r"|\bGH-[0-9]+\b"+ r"|https?://(?:www\.)?github\.com/[^/\s]+/[^/\s]+/(?:issues|pull)/[0-9]+\b"+ r")",+ re.IGNORECASE,+)_MAX_HIGHLIGHT_ITEMS = 3_MAX_HIGHLIGHT_LENGTH = 140@@ -104,7 +113,7 @@ def _highlight_items(text: str) -> list[str] | None:or "_" in itemor re.search(r"!?\[[^\]]+\]\([^\)]+\)", item)or re.search(r"<[^>]+>", item)- or re.search(r"\(#[0-9]+\)", item)+ or _ISSUE_REFERENCE_RE.search(item)):raise ReleaseBodyIntegrityError("Highlights bullets must use plain text without links, code, HTML, "diff --git a/scripts/release_control/render_release_body_test.py b/scripts/release_control/render_release_body_test.pyindex d1d40920ef..895b7df64f 100644--- a/scripts/release_control/render_release_body_test.py+++ b/scripts/release_control/render_release_body_test.py@@ -118,6 +118,67 @@ class RenderReleaseBodyTest(unittest.TestCase):):render_release_body.validate_release_notes_shape(formatted_notes, "6.2.0")+ def test_highlights_reject_bare_and_parenthesized_issue_references(self) -> None:+ for reference in ("#123", "(#123)"):+ with self.subTest(reference=reference):+ notes = f"""# Pulse v6.2.0 Release Notes++## Highlights++- Alerts recover cleanly after an update {reference}.++## Fixed++- Corrected a release issue.+"""++ with self.assertRaisesRegex(+ render_release_body.ReleaseBodyIntegrityError,+ "issue references",+ ):+ render_release_body.validate_release_notes_shape(notes, "6.2.0")++ def test_highlights_reject_common_github_issue_reference_variants(self) -> None:+ references = (+ "GH-123",+ "rcourtman/Pulse#123",+ "https://github.com/rcourtman/Pulse/issues/123",+ "https://github.com/rcourtman/Pulse/pull/123",+ )+ for reference in references:+ with self.subTest(reference=reference):+ notes = f"""# Pulse v6.2.0 Release Notes++## Highlights++- Alerts recover cleanly after an update {reference}.++## Fixed++- Corrected a release issue.+"""++ with self.assertRaisesRegex(+ render_release_body.ReleaseBodyIntegrityError,+ "issue references",+ ):+ render_release_body.validate_release_notes_shape(notes, "6.2.0")++ def test_highlights_preserve_legitimate_plain_text_with_hash_characters(self) -> None:+ notes = """# Pulse v6.2.0 Release Notes++## Highlights++- C# service checks now recover cleanly after interrupted updates.+- F# applications keep their configured display names.++## Fixed++- Corrected a release issue.+"""++ render_release_body.validate_release_notes_shape(notes, "6.2.0")+def test_release_notes_may_omit_highlights(self) -> None:notes = """# Pulse v6.2.1 Release Notes