mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 10:07:28 +01:00
release notes: keep the Full Changelog link when no one is new
Without a New Contributors section the changelog line follows the PR list directly, so it was read as part of What's Changed and dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1fb0d8d53f
commit
7144c3c5cf
2 files changed
+9
-1
No files matched your search
@@ -204,7 +204,8 @@ def split_notes(body):
|
||||
start = next((i for i, l in enumerate(lines) if l.strip() == "## What's Changed"), None)
|
||||
if start is None:
|
||||
return [], body, ""
|
||||
end = next((i for i in range(start + 1, len(lines)) if lines[i].startswith("## ")), len(lines))
|
||||
end = next((i for i in range(start + 1, len(lines))
|
||||
if lines[i].startswith(("## ", "**Full Changelog**"))), len(lines))
|
||||
prs = [l for l in lines[start + 1:end] if PR_LINE.match(l)]
|
||||
before = "\n".join(lines[:start]).rstrip()
|
||||
after = "\n".join(lines[end:]).strip()
|
||||
|
||||
@@ -146,6 +146,13 @@ class RegroupTest(unittest.TestCase):
|
||||
for n in (12709, 12707, 12685, 12366, 12600):
|
||||
self.assertEqual(out.count("/pull/%d\n" % n), 2 if n == 12600 else 1)
|
||||
|
||||
def test_changelog_kept_without_new_contributors(self):
|
||||
body = NOTES.replace(
|
||||
"## New Contributors\n* @c made their first contribution in https://github.com/seaweedfs/seaweedfs/pull/12600\n\n", "")
|
||||
out = rn.regroup(body, self.files)
|
||||
self.assertTrue(out.endswith("</details>\n\n**Full Changelog**: https://github.com/seaweedfs/seaweedfs/compare/4.53...4.54\n"), out)
|
||||
self.assertEqual(rn.regroup(out, self.files), out)
|
||||
|
||||
def test_notes_without_prs_unchanged(self):
|
||||
body = "Hand-written notes\n\n**Full Changelog**: x"
|
||||
self.assertEqual(rn.regroup(body, no_files), body)
|
||||
|
||||
Reference in new issue
Block a user