diff mbox series

[yocto-autobuilder2,3/3] observer: Fix builder name detection

Message ID 20251222-mathieu-fix-ptest-urls-v1-3-4153fdb174a8@bootlin.com
State New
Headers show
Series observer: Fix ptest link generation, again... | expand

Commit Message

Mathieu Dubois-Briand Dec. 22, 2025, 4:28 p.m. UTC
Builder name is needed in order to generate correct ptest result links.
Previous code tries to extract it from the first log lines, but these
lines do not go through the log observer: match somewhere else in the
log instead.

Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
---
 steps/observer.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/steps/observer.py b/steps/observer.py
index 7231d29c33ea..7187d1ad5108 100644
--- a/steps/observer.py
+++ b/steps/observer.py
@@ -42,6 +42,7 @@  class SimpleLogObserver(ShellCommand):
         self.addLogObserver('stdio', logobserver.LineConsumerLogObserver(partial(self.logConsumer, 'stdio')))
         self.yocto_io_re = re.compile(".*/([^/]*yocto.io/pub/(non-release|repro-fail[^/]*/)([^ ']|$)+).*")
         self.ptest_fails_re = re.compile(r"WARNING: (\S*)-[0-9.]*-r[0-9]* do_testimage:")
+        self.builder_re = re.compile(r"Target task (\S*) has \S* steps")
 
     def describe(self, done=False):
         return self.description
@@ -58,8 +59,10 @@  class SimpleLogObserver(ShellCommand):
             if line.startswith("ERROR:"):
                 self.errorCount += 1
                 self.errorLines.append(logname + ": " + line)
-            if line.startswith("Builder:"):
-                self.builder = line.split(':')[1].strip()
+            if not self.builder:
+                match = self.builder_re.match(line)
+                if match:
+                    self.builder = match.group(1)
             url, matched = self.yocto_io_re.subn('https://\\1', line.strip())
             if matched:
                 self.links.append(url)