@@ -49,6 +49,24 @@ class SwatBotURI(object):
return self.client.get(query, timeout=self.TIMEOUT, headers=self.headers, allow_redirects=False)
return req
+ def get_build_branch(self, build):
+ """Extract branch name from build properties.
+
+ Args:
+ build: Build dictionary containing properties
+
+ Returns:
+ Branch name if found, None otherwise
+ """
+ repos = ['poky', 'oecore', 'yocto-docs']
+ for repo in repos:
+ branch = build['properties'].get(f'branch_{repo}')
+ if branch:
+ return branch[0]
+ branches = [p for p in build['properties'] if p.startswith('branch')]
+ log.err("Failed to get corresponding branch, possible values: %s", branches)
+ return None
+
def find_build_collection(self, build):
dbid = None
@@ -77,7 +95,7 @@ class SwatBotURI(object):
'attributes': {
"buildid": collection_build_id,
"targetname": build['builder']['name'],
- "branch": build['properties']['branch_poky'][0],
+ "branch": self.get_build_branch(build)
}
}
}
The swatbot reporter tries to get the name of the built branch, using the "branch_poky" property of the build. Some builders, such as "docs", do not use the poky git, so this property is missing. Currently, this result in a non-fatal error on the buildbot controller, but the build entry is not added to swatbot. Import code from swattool, falling back to oecore or yocto-docs branch name. Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> --- reporters/swatbot.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) --- base-commit: 247aaef0910826113ccfc892f42f9012a45034f7 change-id: 20250910-contrib-mathieu-swatbot_branches_fix-7fbe5402eed6 Best regards,