[Buildroot] [PATCH buildroot-test 05/10] utils/daily-mail: add runtime tests support in developers notifications

Victor Huesca victor.huesca at bootlin.com
Thu Aug 29 13:23:43 UTC 2019


This patch adds runtime-test job failures in the 'Notification'
structure.
This will allow to inform developers about failures related to the
runtime-tests they maintains.

This patch relys on the gitlab-ci infrasture introduced earlier on in
this series as well as the patch adding support for runtime-tests in the
getdeveloperlib already applied to master.

Signed-off-by: Victor Huesca <victor.huesca at bootlin.com>
---
 utils/daily-mail | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/utils/daily-mail b/utils/daily-mail
index 5a44fad..5e8799a 100755
--- a/utils/daily-mail
+++ b/utils/daily-mail
@@ -78,6 +78,7 @@ class Notification:
         self.arch_notifications = defaultdict(list)
         self.package_notifications = defaultdict(list)
         self.defconfig_notifications = defaultdict(list)
+        self.runtime_test_notifications = defaultdict(list)
         self.package_version_notification = []
 
 
@@ -184,6 +185,23 @@ def add_defconfig_notification(branch, notifications, job):
         notif.defconfig_notifications[branch].append(job)
 
 
+def add_runtime_test_notification(branch, notifications, job):
+    '''
+    Add to the notifications{} dict notifications that are related to
+    runtime-tests "maintainers".
+    '''
+    orphan = True
+    for dev in developers:
+        if job['full_name'] in dev.runtime_tests:
+            orphan = False
+            notif = notifications.setdefault(dev, Notification())
+            notif.runtime_test_notifications[branch].append(job)
+    if orphan:
+        job['orphan'] = True
+        notif = notifications.setdefault(get_orphan_developer(), Notification())
+        notif.runtime_test_notifications[branch].append(job)
+
+
 def add_outdated_pkg_notification(notifications, package):
     '''
     Add to the notifications{} dict notifications that are related to
@@ -672,6 +690,8 @@ def calculate_notifications(results, outdated_pkgs, gitlab_results):
             for job in pipeline['jobs']:
                 if job['kind'] == 'defconfig':
                     add_defconfig_notification(branch, notifications, job)
+                elif job['kind'] == 'runtime-test':
+                    add_runtime_test_notification(branch, notifications, job)
 
     return notifications
 
-- 
2.21.0




More information about the buildroot mailing list