diff mbox series

[yocto-autobuilder-helper] scripts/yocto-supported-distros: Better integrate for autobuilder use

Message ID 20250304151844.1930074-1-richard.purdie@linuxfoundation.org
State New
Headers show
Series [yocto-autobuilder-helper] scripts/yocto-supported-distros: Better integrate for autobuilder use | expand

Commit Message

Richard Purdie March 4, 2025, 3:18 p.m. UTC
For autobuilder use, it will be more helpful to print warnings for the issues found
which will show up in the autobuilder UI in this format. We can then save the error
exit code for actual script failures which should improve usability from the autobuilder
perspective.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 scripts/yocto-supported-distros | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/scripts/yocto-supported-distros b/scripts/yocto-supported-distros
index da5399d..e0550eb 100755
--- a/scripts/yocto-supported-distros
+++ b/scripts/yocto-supported-distros
@@ -107,6 +107,14 @@  def _print_worker_list(worker_list: List, indent=2):
         print(" " * indent + w)
 
 
+def _print_worker_list_warning(worker_list: List, warning):
+    """
+    Helper to print a set nicely.
+    """
+    for w in worker_list:
+        print("WARNING: " + warning + ": " + w)
+
+
 def _print_workers(possible_workers: Dict[str, List]):
     """
     Helper to print the workers nicely.
@@ -204,15 +212,13 @@  def _compare(ab_workers: set, poky_workers: set):
 
     poky_missing = ab_workers.difference(sorted(list(poky_workers)))
     if poky_missing:
-        print("Missing in poky.conf but configured on the autobuilder:")
-        _print_worker_list(poky_missing)
+        _print_worker_list_warning(poky_missing, "Missing in poky.conf but configured on the autobuilder")
         print()
         ok = False
 
     ab_missing = poky_workers.difference(sorted(list(ab_workers)))
     if ab_missing:
-        print("Missing on the autobuilder but listed in poky.conf:")
-        _print_worker_list(sorted(list(ab_missing)))
+        _print_worker_list_warning(sorted(list(ab_missing)), "Missing on the autobuilder but listed in poky.conf")
         print()
         ok = False
 
@@ -286,8 +292,7 @@  def main():
                 ab_workers.add(mangled_w)
 
         if not _compare(ab_workers, poky_workers):
-            print("Errors were found")
-            exit(1)
+            print("Mismatches were found")
         else:
             print("All good!")