Handle backport PRs without piper info in release notes automation

Example commits on v1.67.x that are failing the current regex match:

```
commit 1eb5673cdd
Author: apolcyn <apolcyn@google.com>
Date:   Mon Sep 16 12:35:34 2024 -0700

    [objc] backport https://github.com/grpc/grpc/pull/37690 to v1.67.x (#37712)

    Backport https://github.com/grpc/grpc/pull/37690

    cc @HannahShiSFB @sampajano

    Co-authored-by: Hannah Shi <hannahshisfb@gmail.com>

commit ace22e307d
Author: apolcyn <apolcyn@google.com>
Date:   Thu Sep 12 10:16:46 2024 -0700

    [ruby] reduce an INFO log to DEBUG (backport https://github.com/grpc/grpc/pull/37633) (#37686)

    Backport https://github.com/grpc/grpc/pull/37633 to 1.67

    Note https://github.com/grpc/grpc/pull/37633 is not yet merged b/c of
    the master branch freeze. Merging on 1.67 with the idea that
    https://github.com/grpc/grpc/pull/37633 will merge as soon as the master
    branch is unfrozen.
```

PiperOrigin-RevId: 681960402
pull/37841/head
Alexander Polcyn 2 months ago committed by Copybara-Service
parent 00545fa0fa
commit 41dc97e1d6
  1. 13
      tools/release/release_notes.py

@ -104,14 +104,15 @@ def get_commit_detail(commit):
detail += "- " + title
if not title.endswith("."):
detail += "."
detail += " ([commit](https://github.com/grpc/grpc/commit/{}))".format(
commit
)
matches = re.search("PiperOrigin-RevId: ([0-9]+)$", output)
# backport commits might not have PiperOrigin-RevId
if matches is not None:
cl_num = matches.group(1)
detail += (
" ([commit](https://github.com/grpc/grpc/commit/"
+ commit
+ ")) ([CL](https://critique.corp.google.com/cl/"
+ cl_num
+ "))"
detail += " ([CL](https://critique.corp.google.com/cl/{}))".format(
cl_num
)
return detail

Loading…
Cancel
Save