diff mbox series

[yocto-autobuilder2,3/4] services: Update email notification config

Message ID 20230928094737.2373931-3-richard.purdie@linuxfoundation.org
State New
Headers show
Series [yocto-autobuilder2,1/4] config.py: Update perf workers to match autobuilder | expand

Commit Message

Richard Purdie Sept. 28, 2023, 9:47 a.m. UTC
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 services.py | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/services.py b/services.py
index cc891434..bdfdbc1d 100644
--- a/services.py
+++ b/services.py
@@ -3,20 +3,27 @@ 
 #
 
 from buildbot.plugins import reporters
-
 from yoctoabb import config
-
+import os
 
 services = []
 
-# TODO: we'll replace this with functionality in yocto-autobuilder-helpers
-# to mail the error reports to the list
-# services.append(
-#     reporters.MailNotifier(fromaddr="yocto-builds@yoctoproject.org",
-#                            sendToInterestedUsers=False,
-#                            extraRecipients=["yocto-builds@yoctoproject.org"],
-#                            mode=('failing',))
-# )
+with open(os.path.join(os.path.dirname(__file__), "default_mail.txt"), "r") as f:
+    emailtext = "\n".join(f.readlines())
+
+formatter = reporters.MessageFormatter(template=emailtext)
+
+generator = reporters.BuildStatusGenerator(
+    mode=('failing', 'warnings', 'exception', 'cancelled'),
+    message_formatter=formatter,
+    builders=['a-full', 'a-quick', 'buildperf-alma8', 'buildperf-debian11', 'docs'])
+
+#services.append(
+#     reporters.MailNotifier(fromaddr="controller@yoctoproject.org",
+#                            extraRecipients=["yocto-builds@lists.yoctoproject.org"],
+#                            generators=[generator])
+#)
+
 
 # services.append(
 #     reporters.IRC(host="irc.freenode.net",
@@ -39,4 +46,4 @@  services = []
 # from yoctoabb.reporters import swatbot
 # services.append(
 #     swatbot.SwatBot("http://localhost:8000/", "buildbot-notifier", "password")
-# )
\ No newline at end of file
+# )