diff --git a/auto_merger/email.py b/auto_merger/email.py
index c0f9ea2..343afe1 100644
--- a/auto_merger/email.py
+++ b/auto_merger/email.py
@@ -39,7 +39,9 @@ def send_email(self, subject_msg, body: List[str]):
send_from = "phracek@redhat.com"
send_to = self.recipient_email
print(body)
- msg = "
".join(body)
+ whole_body = "".join(body)
+ msg = ("
"
+ f"{whole_body}")
print(msg)
self.mime_msg["From"] = send_from
self.mime_msg["To"] = ", ".join(send_to)
diff --git a/auto_merger/merger.py b/auto_merger/merger.py
index 7b26a29..cc6b3fb 100644
--- a/auto_merger/merger.py
+++ b/auto_merger/merger.py
@@ -240,19 +240,22 @@ def print_blocked_pull_request(self):
# Do not print anything in case we do not have PR.
if not [x for x in self.blocked_pr if self.blocked_pr[x]]:
return 0
- self.blocked_body.append(f"Pull requests that are blocked by labels [{', '.join(self.blocking_labels)}]")
+ self.blocked_body.append(
+ f"Pull requests that are blocked by labels [{', '.join(self.blocking_labels)}]
"
+ )
+
for container, pull_requests in self.blocked_pr.items():
if not pull_requests:
continue
- self.blocked_body.append(f"{container}:")
+ self.blocked_body.append(f"{container}:")
+ self.blocked_body.append("Pull request URL | Title | Missing labels |
")
for pr in pull_requests:
blocked_labels = self.get_blocked_labels(pr["pr_dict"])
self.blocked_body.append(
- f"https://github.com/sclorg/{container}/pull/{pr['number']} - "
- f"[{pr['pr_dict']['title']}] -> {' '.join(blocked_labels)}"
+ f"https://github.com/sclorg/{container}/pull/{pr['number']} | "
+ f"{pr['pr_dict']['title']} | {' '.join(blocked_labels)} |
"
)
- self.blocked_body.extend([""])
- self.blocked_body.extend(["", ""])
+ self.blocked_body.append("
")
print('\n'.join(self.blocked_body))
def print_approval_pull_request(self):
@@ -260,18 +263,19 @@ def print_approval_pull_request(self):
if not [x for x in self.pr_to_merge if self.pr_to_merge[x]]:
return 0
self.approval_body.append(f"Pull requests that can be merged or missing {self.approvals} approvals")
+ self.approval_body.append("Pull request URL | Title | Approval status |
")
for container, pr in self.pr_to_merge.items():
if not pr:
continue
if int(pr["approvals"]) >= self.approvals:
- result_pr = f" -> CAN BE MERGED"
+ result_pr = f"CAN BE MERGED"
else:
- result_pr = f" -> Missing {self.approvals-int(pr['approvals'])} APPROVAL"
+ result_pr = f"Missing {self.approvals-int(pr['approvals'])} APPROVAL"
self.approval_body.append(
- f"https://github.com/sclorg/{container}/pull/{pr['number']} - "
- f"[{pr['pr_dict']['title']}]{result_pr}"
+ f"https://github.com/sclorg/{container}/pull/{pr['number']} | "
+ f"{pr['pr_dict']['title']} | {result_pr} |
"
)
- self.approval_body.extend(["", ""])
+ self.approval_body.append("
")
print('\n'.join(self.approval_body))
def send_results(self, recipients):