bin/gen_release_notes.py: parse "Fixes" tags as well as "Closes"
Some commits refer to bugs being fixed with "Fixes" tag. Example of one: e13d53e1fdb 'Revert "glx/dri: Fix DRI drawable release at MakeCurrent time"' Parse this tag as well. Cc: mesa-stable Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru> Reviewed-by: Eric Engestrom <eric@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20241>
This commit is contained in:
@@ -175,7 +175,7 @@ inliner = Inliner();
|
||||
|
||||
async def gather_commits(version: str) -> str:
|
||||
p = await asyncio.create_subprocess_exec(
|
||||
'git', 'log', '--oneline', f'mesa-{version}..', '--grep', r'Closes: \(https\|#\).*',
|
||||
'git', 'log', '--oneline', f'mesa-{version}..', '--grep', r'\(Closes\|Fixes\): \(https\|#\).*',
|
||||
stdout=asyncio.subprocess.PIPE)
|
||||
out, _ = await p.communicate()
|
||||
assert p.returncode == 0, f"git log didn't work: {version}"
|
||||
@@ -193,19 +193,24 @@ async def parse_issues(commits: str) -> typing.List[str]:
|
||||
out = _out.decode().split('\n')
|
||||
|
||||
for line in reversed(out):
|
||||
if line.startswith('Closes:'):
|
||||
bug = line.lstrip('Closes:').strip()
|
||||
if (bug.startswith('https://gitlab.freedesktop.org/mesa/mesa')
|
||||
# Avoid parsing "merge_requests" URL. Note that a valid issue
|
||||
# URL may or may not contain the "/-/" text, so we check if
|
||||
# the word "issues" is contained in URL.
|
||||
and '/issues' in bug):
|
||||
# This means we have a bug in the form "Closes: https://..."
|
||||
issues.append(os.path.basename(urllib.parse.urlparse(bug).path))
|
||||
elif ',' in bug:
|
||||
issues.extend([b.strip().lstrip('#') for b in bug.split(',')])
|
||||
elif bug.startswith('#'):
|
||||
issues.append(bug.lstrip('#'))
|
||||
if not line.startswith(('Closes:', 'Fixes:')):
|
||||
continue
|
||||
bug = line.split(':', 1)[1].strip()
|
||||
if (bug.startswith('https://gitlab.freedesktop.org/mesa/mesa')
|
||||
# Avoid parsing "merge_requests" URL. Note that a valid issue
|
||||
# URL may or may not contain the "/-/" text, so we check if
|
||||
# the word "issues" is contained in URL.
|
||||
and '/issues' in bug):
|
||||
# This means we have a bug in the form "Closes: https://..."
|
||||
issues.append(os.path.basename(urllib.parse.urlparse(bug).path))
|
||||
elif ',' in bug:
|
||||
multiple_bugs = [b.strip().lstrip('#') for b in bug.split(',')]
|
||||
if not all(b.isdigit() for b in multiple_bugs):
|
||||
# this is likely a "Fixes" tag that refers to a commit name
|
||||
continue
|
||||
issues.extend(multiple_bugs)
|
||||
elif bug.startswith('#'):
|
||||
issues.append(bug.lstrip('#'))
|
||||
|
||||
return issues
|
||||
|
||||
|
Reference in New Issue
Block a user