shoving words "From here on duzznt go in du MoU" repeatedly into the
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 25 Aug 2023 09:11:31 +0000 (10:11 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 25 Aug 2023 09:11:31 +0000 (10:11 +0100)
bugtracker is going to get very irritating very quickly
i said "just look for the standard markdown line-break which starts "--"

src/budget_sync/main.py

index 15405ca18b52b243f0c69a1262f93deddff566e1..a1e7c7275411d05db3f743644ffd67ec9cdd9e8a 100644 (file)
@@ -225,19 +225,13 @@ def json_milestones(budget_graph: BudgetGraph, add_comments: bool,
                 comments = bug_comments_map[str(child.bug.id)]['comments']
                 lines = comments[0]['text'].splitlines()
                 for i, line in enumerate(lines):
-                    # look for a line with only 4 or more `-` and blank lines
-                    # before and after, like so:
-                    # ```
-                    #
-                    # -----
-                    #
-                    # ```
-                    if len(line) >= 4 and line == "-" * len(line) \
-                        and i >= 1 and lines[i - 1] == "" and (
-                            i > len(lines) or lines[i + 1] == ""):
-                        lines[i:] = []
-                        break
-                    if line == "<From here down doesn't go in MOU>":
+                    # look for a line with only 2 or more `-` as the
+                    # standard way in markdown of having a "break" (<hl />)
+                    # this truncates the comment so that the RFP database
+                    # has only the "summary description" but the rest may
+                    # be used for "TODO" lists
+                    l = line.strip()
+                    if len(l) >= 2 and l == "-" * len(l) \
                         lines[i:] = []
                         break
                 comment += "\n".join(lines)