Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the regex to extract PR# from the PR title #208

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions zorg/buildbot/reporters/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down