fix(status-bot): update formatting to be consistent
Prints only the tf-a-daily subjobs and only failed subjobs in tftf main.
The emoji are printed consistently and the formatting is updated to be
understood by slack markup.
The openci_url was being redirected to the https variant which was
producing broken links.
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I70174b1d3e48c06afc5fa613512b11b97a0af2f2
diff --git a/script/ci_status_bot.py b/script/ci_status_bot.py
index 4d12771..e98507c 100644
--- a/script/ci_status_bot.py
+++ b/script/ci_status_bot.py
@@ -5,7 +5,7 @@
import requests
-openci_url = "http://ci.trustedfirmware.org/"
+openci_url = "https://ci.trustedfirmware.org/"
class Job:
@@ -35,7 +35,7 @@
self.jobs = []
def __str__(self) -> str:
- return f"{'✅' if self.passed else '❌'} *{self.name}*"
+ return f"{'✅' if self.passed else '❌'} *{self.name}* [#{self.number}]({self.url})"
def __iter__(self):
yield from self.jobs
@@ -53,10 +53,6 @@
class SubJob(Job):
-
- def __str__(self) -> str:
- return f"• *{self.name}* [#{self.number}]({self.url}) {'✅' if self.passed else '❌'}"
-
@classmethod
def get_jobs_from_console_log(cls, log):
sub_jobs = []
@@ -82,11 +78,14 @@
print("🟢" if all(j.passed for j in jobs) else "🔴", "Daily Status")
for j in jobs:
- print("\n", j, f"[#{j.number}]({j.url})", "\n")
- if j.name == "tf-a-daily" or not j.passed:
+ print("*", j)
+ if j.name == "tf-a-daily":
for subjob in j:
- print(subjob)
- subjob.print_failed_subjobs()
+ print(" *", subjob)
+ elif not j.passed:
+ for subjob in j:
+ if not subjob.passed:
+ print(" *", subjob)
if __name__ == "__main__":