Merge pull request #2312 from rdbtCVS/t3/preserve-release-issue-wrapping

🤖 Agent: verified by Ludovic's AI agent (contrib gate 20): release notes keep wrapped known issues. It passed in this wave's union with main on the Mac mini: the selected parity harnesses (332/332, then 122/122 on the final union), clippy -D warnings and the tests, and lan_e2e with the host on its server thread and in-frame (18/18 each). Thanks @rdbtCVS!
This commit is contained in:
Ludovic Marie
2026-10-27 08:51:48 +01:00
committed by GitHub
2 changed files with 37 additions and 3 deletions
+26 -2
View File
@@ -240,10 +240,34 @@ class ReleaseTrainTests(unittest.TestCase):
def test_known_issues_are_the_bullets_of_the_file(self):
with tempfile.TemporaryDirectory() as temp:
path = Path(temp, "known-issues.md")
path.write_text("# Known issues\n\nSome text.\n\n- One.\n- Two, with **bold**.\n continued\n")
self.assertEqual(train.known_issues(path), ["- One.", "- Two, with **bold**."])
path.write_text("# Known issues\n\nSome text.\n\n- One.\n- Two, with **bold**. \n"
" continued with `code`\n\tand a [link](https://example.com). \n- Three.\n")
self.assertEqual(train.known_issues(path),
["- One.", "- Two, with **bold**. continued with `code` and a [link](https://example.com).",
"- Three."])
self.assertEqual(train.known_issues(Path(temp, "missing.md")), [])
def test_known_issues_do_not_include_unrelated_text(self):
with tempfile.TemporaryDirectory() as temp:
path = Path(temp, "known-issues.md")
for separator in ["\n", " \n", "# Heading\n", "Some text.\n"]:
with self.subTest(separator=separator):
path.write_text(" Intro.\n- One.\n continued.\n" + separator + " Not an issue.\n- Two.\n")
self.assertEqual(train.known_issues(path), ["- One. continued.", "- Two."])
path.write_text("# Known issues\n\nNo issues.\n")
self.assertEqual(train.known_issues(path), [])
path.write_text("")
self.assertEqual(train.known_issues(path), [])
def test_notes_keep_the_wrapped_shaderpacks_issue(self):
with tempfile.TemporaryDirectory() as temp:
path = Path(temp, "known-issues.md")
path.write_text("- Shader packs have been removed for now. Packs in your\n"
" `shaderpacks` folder are left where they are.\n")
_, body = train.notes("game", "v0.2.70", [pr(1)], train.known_issues(path))
self.assertIn("### Known issues\n- Shader packs have been removed for now. Packs in your "
"`shaderpacks` folder are left where they are.\n", body)
if __name__ == "__main__":
unittest.main()
+11 -1
View File
@@ -347,7 +347,17 @@ def bullet(pr):
def known_issues(path=ROOT / "docs" / "known-issues.md"):
if not path.exists():
return []
return [line.rstrip() for line in path.read_text().splitlines() if line.startswith("- ")]
issues = []
in_bullet = False
for line in path.read_text().splitlines():
if line.startswith("- "):
issues.append(line.rstrip())
in_bullet = True
elif in_bullet and line.startswith((" ", "\t")) and line.strip():
issues[-1] += " " + line.strip()
else:
in_bullet = False
return issues
def line_intro(kind, version, previous):