Skip to content

Commit 0dfc21c

Browse files
Remove "Updates to locked dependencies" section from changelog (#19254)
1 parent ffd0b4c commit 0dfc21c

File tree

2 files changed

+2
-49
lines changed

2 files changed

+2
-49
lines changed

changelog.d/19254.removal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove the "Updates to locked dependencies" section from the changelog due to lack of use and the maintenance burden.

scripts-dev/release.py

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import urllib.request
3333
from os import path
3434
from tempfile import TemporaryDirectory
35-
from typing import Any, Match
35+
from typing import Any
3636

3737
import attr
3838
import click
@@ -968,10 +968,6 @@ def generate_and_write_changelog(
968968
new_changes = new_changes.replace(
969969
"No significant changes.", f"No significant changes since {current_version}."
970970
)
971-
new_changes += build_dependabot_changelog(
972-
repo,
973-
current_version,
974-
)
975971

976972
# Prepend changes to changelog
977973
with open("CHANGES.md", "r+") as f:
@@ -986,49 +982,5 @@ def generate_and_write_changelog(
986982
os.remove(filename)
987983

988984

989-
def build_dependabot_changelog(repo: Repo, current_version: version.Version) -> str:
990-
"""Summarise dependabot commits between `current_version` and `release_branch`.
991-
992-
Returns an empty string if there have been no such commits; otherwise outputs a
993-
third-level markdown header followed by an unordered list."""
994-
last_release_commit = repo.tag("v" + str(current_version)).commit
995-
rev_spec = f"{last_release_commit.hexsha}.."
996-
commits = list(git.objects.Commit.iter_items(repo, rev_spec))
997-
messages = []
998-
for commit in reversed(commits):
999-
if commit.author.name == "dependabot[bot]":
1000-
message: str | bytes = commit.message
1001-
if isinstance(message, bytes):
1002-
message = message.decode("utf-8")
1003-
messages.append(message.split("\n", maxsplit=1)[0])
1004-
1005-
if not messages:
1006-
print(f"No dependabot commits in range {rev_spec}", file=sys.stderr)
1007-
return ""
1008-
1009-
messages.sort()
1010-
1011-
def replacer(match: Match[str]) -> str:
1012-
desc = match.group(1)
1013-
number = match.group(2)
1014-
return f"* {desc}. ([\\#{number}](https://github.com/element-hq/synapse/issues/{number}))"
1015-
1016-
for i, message in enumerate(messages):
1017-
messages[i] = re.sub(r"(.*) \(#(\d+)\)$", replacer, message)
1018-
messages.insert(0, "### Updates to locked dependencies\n")
1019-
# Add an extra blank line to the bottom of the section
1020-
messages.append("")
1021-
return "\n".join(messages)
1022-
1023-
1024-
@cli.command()
1025-
@click.argument("since")
1026-
def test_dependabot_changelog(since: str) -> None:
1027-
"""Test building the dependabot changelog.
1028-
1029-
Summarises all dependabot commits between the SINCE tag and the current git HEAD."""
1030-
print(build_dependabot_changelog(git.Repo("."), version.Version(since)))
1031-
1032-
1033985
if __name__ == "__main__":
1034986
cli()

0 commit comments

Comments
 (0)