MCPcopy Create free account
hub / github.com/bazelbuild/bazel / get_relnotes_between

Function get_relnotes_between

scripts/release/relnotes.py:71–94  ·  view source on GitHub ↗

Gets all relnotes for commits between `base` and `head`.

(base, head, is_patch_release)

Source from the content-addressed store, hash-verified

69
70
71def 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
97def get_label(issue_id):

Callers 1

get_filtered_notesFunction · 0.85

Calls 5

gitFunction · 0.85
extract_titleFunction · 0.85
extract_relnotesFunction · 0.85
addMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…