Skip to content

Commit 41dc97e

Browse files
apolcyncopybara-github
authored andcommitted
Handle backport PRs without piper info in release notes automation
Example commits on v1.67.x that are failing the current regex match: ``` commit 1eb5673 Author: apolcyn <[email protected]> Date: Mon Sep 16 12:35:34 2024 -0700 [objc] backport grpc#37690 to v1.67.x (grpc#37712) Backport grpc#37690 cc @HannahShiSFB @sampajano Co-authored-by: Hannah Shi <[email protected]> commit ace22e3 Author: apolcyn <[email protected]> Date: Thu Sep 12 10:16:46 2024 -0700 [ruby] reduce an INFO log to DEBUG (backport grpc#37633) (grpc#37686) Backport grpc#37633 to 1.67 Note grpc#37633 is not yet merged b/c of the master branch freeze. Merging on 1.67 with the idea that grpc#37633 will merge as soon as the master branch is unfrozen. ``` PiperOrigin-RevId: 681960402
1 parent 00545fa commit 41dc97e

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tools/release/release_notes.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,16 @@ def get_commit_detail(commit):
104104
detail += "- " + title
105105
if not title.endswith("."):
106106
detail += "."
107-
matches = re.search("PiperOrigin-RevId: ([0-9]+)$", output)
108-
cl_num = matches.group(1)
109-
detail += (
110-
" ([commit](https://github.com/grpc/grpc/commit/"
111-
+ commit
112-
+ ")) ([CL](https://critique.corp.google.com/cl/"
113-
+ cl_num
114-
+ "))"
107+
detail += " ([commit](https://github.com/grpc/grpc/commit/{}))".format(
108+
commit
115109
)
110+
matches = re.search("PiperOrigin-RevId: ([0-9]+)$", output)
111+
# backport commits might not have PiperOrigin-RevId
112+
if matches is not None:
113+
cl_num = matches.group(1)
114+
detail += " ([CL](https://critique.corp.google.com/cl/{}))".format(
115+
cl_num
116+
)
116117
return detail
117118

118119

0 commit comments

Comments
 (0)