Skip to content

Commit

Permalink
Add optional issue keys for general remark
Browse files Browse the repository at this point in the history
  • Loading branch information
pieter-edelman-nictiz committed Oct 10, 2024
1 parent 9e7455f commit 409bce6
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions util/qa/ReleaseNotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,19 @@ def setCategory(self, category):
if category not in ["mapping", "textual", "terminology", "cardinality", "extension", "type", "reference", "slicing", "constraint"]:
raise ParserException(f"Invalid category '{category}'")
self.category = category


class Remark:
def __init__(self, description, issues):
self.description = description
self.issues = issues

def __init__(self, name):
self.name = name
self.changes = []
self.open_change = None

def addRemark(self, remark):
self.changes.append(remark)
def addRemark(self, description, *issues):
self.changes.append(Profile.Remark(description, issues))

def addPartialChange(self, path):
if self.open_change:
Expand Down Expand Up @@ -97,9 +102,15 @@ def asHTML(self):
str += "<td>" + "<br />".join([f"<code>{path}</code>" for path in change.paths]) + "</td>"
str += "<td>" + change.category + "</td>"
str += "<td>" + re.sub("`(.*?)`", "<code>\\1</code>", change.description) + "</td>"
elif isinstance(change, Profile.Remark):
if len(change.issues) == 0:
cols = 3
else:
cols = 4
str += f"<tr><td colspan='{cols}'>{change.description}</td></tr>"

if len(change.issues):
str += "<td>" + ", ".join([f"<a href='https://bits.nictiz.nl/issues/{issue}'>{issue}</a>" for issue in change.issues]) + "</td>"
elif type(change) == str:
str += f"<tr><td colspan='4'>{change}</td></tr>"
str += "</tr>\n"

str += "</table>\n"
Expand Down Expand Up @@ -150,7 +161,8 @@ def _analyze(self, line):
self._error("no JIRA issue keys are provided")
self._getCurrProfile().addChange(path, category, description, issues)
case ["*", *general_remark]:
self._getCurrProfile().addRemark(" ".join(general_remark))
description, issues = self._splitTextAndIssues(general_remark)
self._getCurrProfile().addRemark(description, *issues)
case []:
pass
case _:
Expand Down

0 comments on commit 409bce6

Please sign in to comment.