1 from util
import Spinner
10 return re.match(
r"v(\d\.\d\d\.\d\d)", name).group(1)
15 "RELEASE_NOTES_LABEL_GROUPS",
"New Feature;Bug;Improvement;Infrastructure"
20 groups = {l: []
for l
in labels}
21 groups[
"Uncategorized"] = []
25 for label
in item.labels:
27 groups[label].append(item)
32 groups[
"Uncategorized"].append(item)
39 with
Spinner(text=f
"Loading merge requests associated with %{milestone.iid}", stream=sys.stderr):
40 for mr
in milestone.merge_requests():
41 if mr.state ==
"merged":
45 with
Spinner(text=f
"Collecting issues from {len(mrs)} merged MRs", stream=sys.stderr):
49 for issue
in mr.closes_issues():
50 if issue.id
not in issue_ids:
51 issue_ids.append(issue.id)
57 return mrs_grouped, issues_grouped
61 if links: link =
lambda title, url: f
"[{title}]({url})"
62 else: link =
lambda title, url: f
"{title}"
70 ms_badge =
"https://badgen.net/badge/milestone/%s/green" % urllib.parse.quote(
75 badge = f
"![](https://gitlab.cern.ch/acts/acts-core/badges/v{milestone.title}/coverage.svg)"
76 cov_url = f
"https://acts.web.cern.ch/ACTS/coverage/v{milestone.title}/"
79 md += f
"[![]({ms_badge})]({milestone.web_url})\n"
80 r = requests.get(cov_url)
81 if r.status_code == 200:
82 md += f
"[{badge}]({cov_url})\n\n"
84 md += f
"[{badge}](#)\n\n"
86 nmrs =
sum([len(v)
for v
in mrs_grouped.values()])
87 nissues =
sum([len(v)
for v
in issues_grouped.values()])
90 md += f
"### {nmrs} Merge Requests in this release:\n"
91 for g
in label_groups + [
"Uncategorized"]:
92 if len(mrs_grouped[g]) == 0:
95 for mr
in mrs_grouped[g]:
96 l = link(f
"!<span></span>{mr.iid} - {mr.title}", mr.web_url)
101 md += f
"### {nissues} issues addressed in this release:\n"
102 for g
in label_groups + [
"Uncategorized"]:
103 if len(issues_grouped[g]) == 0:
106 for issue
in issues_grouped[g]:
107 l = link(f
"#<span></span>{issue.iid} - {issue.title}", issue.web_url)