Gets all relnotes for commits between `base` and `head`.
(base, head, is_patch_release)
| 69 | |
| 70 | |
| 71 | def get_relnotes_between(base, head, is_patch_release): |
| 72 | """Gets all relnotes for commits between `base` and `head`.""" |
| 73 | commits = git("rev-list", f"{base}..{head}") |
| 74 | if commits == [""]: |
| 75 | return [] |
| 76 | relnotes = [] |
| 77 | rolled_back_commits = set() |
| 78 | # We go in reverse-chronological order, so that we can identify rollback |
| 79 | # commits and ignore the rolled-back commits. |
| 80 | for commit in commits: |
| 81 | if commit in rolled_back_commits: |
| 82 | continue |
| 83 | lines = git("show", "-s", commit, "--pretty=format:%B") |
| 84 | m = re.match(r"^Automated rollback of commit ([\dA-Fa-f]+)", lines[0]) |
| 85 | if m is not None: |
| 86 | rolled_back_commits.add(m[1]) |
| 87 | # The rollback commit itself is also skipped. |
| 88 | continue |
| 89 | relnote = ( |
| 90 | extract_title(lines) if is_patch_release else extract_relnotes(lines) |
| 91 | ) |
| 92 | if relnote is not None: |
| 93 | relnotes.append(relnote) |
| 94 | return relnotes |
| 95 | |
| 96 | |
| 97 | def get_label(issue_id): |
no test coverage detected
searching dependent graphs…