From b97ad66e24e81fcdb9f8ae2488343195221052e5 Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Wed, 19 Jun 2024 11:25:13 +0400 Subject: [PATCH] Updated the regex to extract PR# from the PR title --- zorg/buildbot/reporters/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zorg/buildbot/reporters/utils.py b/zorg/buildbot/reporters/utils.py index acb7693e4..83212c7bd 100644 --- a/zorg/buildbot/reporters/utils.py +++ b/zorg/buildbot/reporters/utils.py @@ -253,10 +253,11 @@ def _extract_issue(self, props): # override log.msg(f"LLVMFailGitHubReporter._extract_issue: INFO: props={props}") title = props.getProperty("title") if title: - # Search for PR# in the first line of the commit description, which looks like 'Some text (#123)'. - m = re.search(r"^.* \(#(\d+)\)$", title) + # Search for PR# in the first line of the commit description, + # which looks like 'Some text (#123)' or 'Some text #123'. + m = re.search(r"^.* (\(#(\d+)\)|#(\d+))$", title) if m: - return m.group(1) + return m.group(2) or m.group(3) return None # This function is for logging purposes only.