bin/gen_release_notes.py: read Closes/Fixes tags case-insensitively
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\|Fixes\): \(https\|#\).*',
|
||||
'git', 'log', '--oneline', f'mesa-{version}..', '-i', '--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,7 +193,7 @@ async def parse_issues(commits: str) -> typing.List[str]:
|
||||
out = _out.decode().split('\n')
|
||||
|
||||
for line in reversed(out):
|
||||
if not line.startswith(('Closes:', 'Fixes:')):
|
||||
if not line.lower().startswith(('closes:', 'fixes:')):
|
||||
continue
|
||||
bug = line.split(':', 1)[1].strip()
|
||||
if (bug.startswith('https://gitlab.freedesktop.org/mesa/mesa')
|
||||
|
@@ -176,6 +176,17 @@ async def test_gather_commits():
|
||||
''',
|
||||
['36', '37'],
|
||||
),
|
||||
(
|
||||
'''\
|
||||
Parse Fixes/Closes in weird cases
|
||||
|
||||
fixes: https://gitlab.freedesktop.org/mesa/mesa/issues/36
|
||||
fiXES: https://gitlab.freedesktop.org/mesa/mesa/issues/37
|
||||
closes: https://gitlab.freedesktop.org/mesa/mesa/issues/38
|
||||
cloSES: https://gitlab.freedesktop.org/mesa/mesa/issues/39
|
||||
''',
|
||||
['36', '37', '38', '39'],
|
||||
),
|
||||
])
|
||||
async def test_parse_issues(content: str, bugs: typing.List[str]) -> None:
|
||||
mock_com = mock.AsyncMock(return_value=(textwrap.dedent(content).encode(), ''))
|
||||
|
Reference in New Issue
Block a user