tools: Add support for Jira RHEL-XXX issues

Related: RHEL-15122
This commit is contained in:
Brian C. Lane 2023-11-03 11:07:18 -07:00
parent 982d982516
commit 95d984f81d
1 changed files with 7 additions and 6 deletions

View File

@ -65,13 +65,14 @@ class ChangeLog:
# summary line format is ^.*#([0-9]+).*
# Make sure the bz# isn't likely to be a github issue
for line in msg:
m = re.match(r"^(Resolves|Related|Conflicts):\ +rhbz#(\d+)", line)
if m and m.group(1) and m.group(2):
bugs.append((m.group(1), m.group(2)))
m = re.match(r"^(Resolves|Related|Conflicts):\ +(rhbz#|RHEL-)(\d+)", line)
if m and m.group(1) and m.group(2) and m.group(3):
bugs.append((m.group(1), m.group(2), m.group(3)))
else:
# Assume summary line references are still rhbz# only
m = re.match(r"^.*#(\d+).*", line)
if m and m.group(1) and int(m.group(1)) > 100000:
bugs.append(("Resolves", m.group(1)))
bugs.append(("Resolves", "rhbz#", m.group(1)))
return bugs
@ -99,8 +100,8 @@ class ChangeLog:
author = self._getCommitDetail(commit, "%aE")
msg = ["%s (%s)" % (summary.strip(), author)]
for r, bz in self.getBugs(long):
msg.append("%s: rhbz#%s" % (r, bz))
for r, kind, bz in self.getBugs(long):
msg.append("%s: %s%s" % (r, kind, bz))
log.append(msg)
return log