Release note tools: Only check for issue numbers if they contain a space before them

In the bug fixes per release tool, we got a list of bug reports that
were fixed by a commit using a regular expression that pulled the
number from `#NUMBER`.

However in specific situations, this resulted in the retrieval of the
wrong issue numbers, and ultimately a mis-classification of a
fix commit.

For example 778b1efd84 contains `Fixes blender/blender-manual#NUMBER`

We were extracting the NUMBER from this and treating it as if it was
a bug report for the `blender/blender` repository, which means it
points to the wrong bug report.

This commit fixes this issue by taking a simple approach of only
checking for report numbers that match the format:
`SPACE#NUMBER`, which will eliminate cases like
`blender/blender-manual#NUMBER`.

Pull Request: https://projects.blender.org/blender/blender/pulls/136744
This commit is contained in:
Alaska
2025-04-11 10:58:24 +02:00
committed by Alaska
parent 5aea7b4591
commit 44eb32f68d

View File

@@ -312,8 +312,10 @@ class CommitInfo:
command = ['git', 'show', '-s', '--format=%B', self.hash]
command_output = subprocess.run(command, capture_output=True).stdout.decode('utf-8')
# Find every instance of #NUMBER. These are the report that the commit claims to fix.
match = re.findall(r'#(\d+)', command_output)
# Find every instance of SPACE#NUMBER. These are the report that the commit claims to fix.
# We are looking for the SPACE part because otherwise commits that fix issues in other repos,
# E.g. Fix blender/blender-maunal#NUMBER, will be picked out for processing.
match = re.findall(r'\s#+(\d+)', command_output)
if match:
self.fixed_reports = match