From 0dfc21ca9f877806bfa9d3cd49432da78466757c Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Tue, 2 Dec 2025 16:45:41 +0000 Subject: [PATCH] Remove "Updates to locked dependencies" section from changelog (#19254) --- changelog.d/19254.removal | 1 + scripts-dev/release.py | 50 +-------------------------------------- 2 files changed, 2 insertions(+), 49 deletions(-) create mode 100644 changelog.d/19254.removal diff --git a/changelog.d/19254.removal b/changelog.d/19254.removal new file mode 100644 index 0000000000..ee527cef99 --- /dev/null +++ b/changelog.d/19254.removal @@ -0,0 +1 @@ +Remove the "Updates to locked dependencies" section from the changelog due to lack of use and the maintenance burden. \ No newline at end of file diff --git a/scripts-dev/release.py b/scripts-dev/release.py index 17eadbf6c3..3aed4b2f76 100755 --- a/scripts-dev/release.py +++ b/scripts-dev/release.py @@ -32,7 +32,7 @@ import time import urllib.request from os import path from tempfile import TemporaryDirectory -from typing import Any, Match +from typing import Any import attr import click @@ -968,10 +968,6 @@ def generate_and_write_changelog( new_changes = new_changes.replace( "No significant changes.", f"No significant changes since {current_version}." ) - new_changes += build_dependabot_changelog( - repo, - current_version, - ) # Prepend changes to changelog with open("CHANGES.md", "r+") as f: @@ -986,49 +982,5 @@ def generate_and_write_changelog( os.remove(filename) -def build_dependabot_changelog(repo: Repo, current_version: version.Version) -> str: - """Summarise dependabot commits between `current_version` and `release_branch`. - - Returns an empty string if there have been no such commits; otherwise outputs a - third-level markdown header followed by an unordered list.""" - last_release_commit = repo.tag("v" + str(current_version)).commit - rev_spec = f"{last_release_commit.hexsha}.." - commits = list(git.objects.Commit.iter_items(repo, rev_spec)) - messages = [] - for commit in reversed(commits): - if commit.author.name == "dependabot[bot]": - message: str | bytes = commit.message - if isinstance(message, bytes): - message = message.decode("utf-8") - messages.append(message.split("\n", maxsplit=1)[0]) - - if not messages: - print(f"No dependabot commits in range {rev_spec}", file=sys.stderr) - return "" - - messages.sort() - - def replacer(match: Match[str]) -> str: - desc = match.group(1) - number = match.group(2) - return f"* {desc}. ([\\#{number}](https://github.com/element-hq/synapse/issues/{number}))" - - for i, message in enumerate(messages): - messages[i] = re.sub(r"(.*) \(#(\d+)\)$", replacer, message) - messages.insert(0, "### Updates to locked dependencies\n") - # Add an extra blank line to the bottom of the section - messages.append("") - return "\n".join(messages) - - -@cli.command() -@click.argument("since") -def test_dependabot_changelog(since: str) -> None: - """Test building the dependabot changelog. - - Summarises all dependabot commits between the SINCE tag and the current git HEAD.""" - print(build_dependabot_changelog(git.Repo("."), version.Version(since))) - - if __name__ == "__main__": cli()