From 409bce69945c4d0a8fc07752012eb9713532cc58 Mon Sep 17 00:00:00 2001 From: Pieter Edelman Date: Thu, 10 Oct 2024 16:15:32 +0200 Subject: [PATCH] Add optional issue keys for general remark --- util/qa/ReleaseNotes.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/util/qa/ReleaseNotes.py b/util/qa/ReleaseNotes.py index b0810ea5..01895dbc 100644 --- a/util/qa/ReleaseNotes.py +++ b/util/qa/ReleaseNotes.py @@ -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: @@ -97,9 +102,15 @@ def asHTML(self): str += "" + "
".join([f"{path}" for path in change.paths]) + "" str += "" + change.category + "" str += "" + re.sub("`(.*?)`", "\\1", change.description) + "" + elif isinstance(change, Profile.Remark): + if len(change.issues) == 0: + cols = 3 + else: + cols = 4 + str += f"{change.description}" + + if len(change.issues): str += "" + ", ".join([f"{issue}" for issue in change.issues]) + "" - elif type(change) == str: - str += f"{change}" str += "\n" str += "\n" @@ -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 _: