Skip to content

Commit 1c6f16b

Browse files
authored
Merge branch 'main' into fi-only-use-canonical-name
2 parents f5f8b43 + e61318f commit 1c6f16b

File tree

2 files changed

+60
-45
lines changed

2 files changed

+60
-45
lines changed

dev/update_changelog.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,32 @@ def _update_changelog(prs: set[PullRequest], tag: str, new_tag: str) -> bool:
287287
# Find the end of the Unreleased section
288288
end_index = content.find(f"## {tag}", end_index)
289289

290+
# Check for repeated PRs
291+
_check_repeated_prs(content)
292+
290293
# Finalize content update
291294
file.seek(0)
292295
file.write(content)
293296
file.truncate()
294297
return True
295298

296299

300+
def _check_repeated_prs(content: str) -> None:
301+
"""Check for repeated PRs in the changelog."""
302+
found_pairs = re.findall(r"\[#(\d+)\]\(https://github.com/adap/flower/pull/(\d+)\)", content)
303+
304+
count_prs = {}
305+
for pr, pr_http in found_pairs:
306+
if pr_http != pr:
307+
print(f"PR #{pr} has inconsistent http link.")
308+
if pr not in count_prs:
309+
count_prs[pr] = 0
310+
count_prs[pr] += 1
311+
for pr, count in count_prs.items():
312+
if count > 1:
313+
print(f"PR #{pr} is repeated {count} times.")
314+
315+
297316
def _insert_entry_no_desc(
298317
content: str, pr_reference: str, unreleased_index: int
299318
) -> str:

0 commit comments

Comments
 (0)