Skip to content

Commit

Permalink
contributing: Add more known authors to release notes (#3795)
Browse files Browse the repository at this point in the history
To match the commits to their GitHub names, we need to translate some of the names and emails to GitHub names. Some of these were missing. Now the script also generates a list of authors who need that update.

Now it prefers the new Git translation list over Subversion (and we now fall back to actually showing the issues if nothing was found in Git or Subversion lists).
  • Loading branch information
wenzeslaus authored and neteler committed Jun 15, 2024
1 parent 993fa05 commit 5115132
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 14 deletions.
20 changes: 15 additions & 5 deletions utils/generate_release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,15 @@ def notes_from_git_log(start_tag, end_tag, categories, exclude):
key="svn_name",
value="github_name",
)
github_name_by_git_author_file = config_directory / "git_author_github_name.csv"
github_name_by_git_author = csv_to_dict(
config_directory / "git_author_github_name.csv",
github_name_by_git_author_file,
key="git_author",
value="github_name",
)

lines = []
unknow_authors = []
for commit in commits:
if commit["author_email"].endswith("users.noreply.github.com"):
github_name = commit["author_email"].split("@")[0]
Expand All @@ -217,10 +219,7 @@ def notes_from_git_log(start_tag, end_tag, categories, exclude):
# Emails are stored with @ replaced by a space.
email = commit["author_email"].replace("@", " ")
git_author = f"{commit['author_name']} <{email}>"
if (
git_author not in svn_name_by_git_author
and git_author in github_name_by_git_author
):
if git_author in github_name_by_git_author:
github_name = github_name_by_git_author[git_author]
github_name = f"@{github_name}"
else:
Expand All @@ -230,6 +229,7 @@ def notes_from_git_log(start_tag, end_tag, categories, exclude):
github_name = f"@{github_name}"
except KeyError:
github_name = git_author
unknow_authors.append((git_author, commit["message"]))
lines.append(f"{commit['message']} by {github_name}")
lines = remove_excluded_changes(changes=lines, exclude=exclude)
print_notes(
Expand All @@ -242,6 +242,16 @@ def notes_from_git_log(start_tag, end_tag, categories, exclude):
),
categories=categories,
)
processed_authors = []
if unknow_authors:
print(
f"\n\nAuthors who need to be added to {github_name_by_git_author_file}:\n"
)
for author, message in unknow_authors:
if author in processed_authors:
continue
print(f"{author} -- authored {message}")
processed_authors.append(author)


def create_release_notes(args):
Expand Down
32 changes: 23 additions & 9 deletions utils/git_author_github_name.csv
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
git_author,github_name
Alberto Paradís Llop <albertoparadisllop gmail.com>,albertoparadisllop
Alessandro Frigeri <alessandro.frigeri gmail.com>,afrigeri
Alexandre Detiste <alexandre.detiste gmail.com>,a-detiste
Andrea Giudiceandrea <andreaerdna libero.it>,agiudiceandrea
Anna Petrasova <kratochanna gmail.com>,petrasovaa
Bas Couwenberg <sebastic xs4all.nl>,sebastic
Bernhard M. Wiedemann <bwiedemann suse.de>,bmwiedemann
Brendan Harmon <brendan.harmon gmail.com>,baharmon
Christoph Reiter <reiter.christoph gmail.com>,lazka
Corey White <smortopahri gmail.com>,cwhite911
Florian Weimer <fweimer redhat.com>,fweimer-rh
Hamed Elgizery <hamedashraf2004 gmail.com>,HamedElgizery
Jürgen Fischer <jef norbit.de>,jef-n
Owen Smith <ocsmit protonmail.com>,ocsmit
Ken Mankoff <mankoff gmail.com>,mankoff
Luís de Sousa <luis.de.sousa protonmail.ch>,ldesousa
Māris Nartišs <maris.gis gmail.com>,marisn
Markus Neteler <neteler osgeo.org>,neteler
Maximilian Stahlberg <viech unvanquished.net>,Viech
Nicklas Larsson <n_larsson yahoo.com>,nilason
nilason <n_larsson yahoo.com>,nilason
Stefan Blumentrath <stefan.blumentrath gmx.de>,ninsbl
Anna Petrasova <kratochanna gmail.com>,petrasovaa
Māris Nartišs <maris.gis gmail.com>,marisn
Ondrej Pesek <pesej.ondrek gmail.com>,pesekon2
Bas Couwenberg <sebastic xs4all.nl>,sebastic
積丹尼 Dan Jacobson <jidanni jidanni.org>,jidanni
Owen Smith <ocsmit protonmail.com>,ocsmit
Paulo van Breugel <paulo ecodiv.earth>,ecodiv
Stefan Blumentrath <stefan.blumentrath gmx.de>,ninsbl
Yann Chemin <dr.yann.chemin gmail.com>,YannChemin
Yann Chemin <ychemin gmail.com>,YannChemin
Alberto Paradís Llop <albertoparadisllop gmail.com>,albertoparadisllop
Andrea Giudiceandrea <andreaerdna libero.it>,agiudiceandrea
Maximilian Stahlberg <viech unvanquished.net>,Viech
ymdatta <ymdatta.work gmail.com>,ymdatta
積丹尼 Dan Jacobson <jidanni jidanni.org>,jidanni

0 comments on commit 5115132

Please sign in to comment.