Skip to content

Commit 991113a

Browse files
keertkcopybara-github
authored andcommitted
Updates/fixes to relnotes script
- Replace removeprefix since this requires python 3.9 - Include authors/co-authors with @users.noreply.github.com in acknowledgement section (we're currently not adding contributors w/o public emails) PiperOrigin-RevId: 534091486 Change-Id: I455f96310062069148d2a28758e65f9f5675d3ff
1 parent 16c86f1 commit 991113a

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

scripts/release/relnotes.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,7 @@ def get_external_authors_between(base, head):
138138
authors = git("log", f"{base}..{head}", "--format=%aN|%aE")
139139
authors = set(
140140
author.partition("|")[0].rstrip()
141-
for author in authors
142-
if not (author.endswith(("@google.com", "@users.noreply.github.com")))
143-
)
141+
for author in authors if not (author.endswith(("@google.com"))))
144142

145143
# Get all co-authors
146144
contributors = git(
@@ -149,9 +147,7 @@ def get_external_authors_between(base, head):
149147

150148
coauthors = []
151149
for coauthor in contributors:
152-
if coauthor and not re.search(
153-
"@google.com|@users.noreply.github.com", coauthor
154-
):
150+
if coauthor and not re.search("@google.com", coauthor):
155151
coauthors.append(
156152
" ".join(re.sub(r"Co-authored-by: |<.*?>", "", coauthor).split())
157153
)
@@ -162,11 +158,12 @@ def get_external_authors_between(base, head):
162158
# Get last release and make sure it's consistent with current X.Y.Z release
163159
# e.g. if current_release is 5.3.3, last_release should be 5.3.2 even if
164160
# latest release is 6.1.1
165-
current_release = git("rev-parse", "--abbrev-ref", "HEAD")
166-
current_release = re.sub(
167-
r"rc\d", "", current_release[0].removeprefix("release-")
168-
)
161+
current_release = git("rev-parse", "--abbrev-ref", "HEAD")[0]
162+
if not current_release.startswith("release-"):
163+
print("Error: Not a release- branch")
164+
sys.exit(1)
169165

166+
current_release = re.sub(r"rc\d", "", current_release[len("release-"):])
170167
is_major = bool(re.fullmatch(r"\d+.0.0", current_release))
171168

172169
tags = [tag for tag in git("tag", "--sort=refname") if "pre" not in tag]

0 commit comments

Comments
 (0)