Skip to content

Commit 1eebd64

Browse files
committed
kcidb: hotfixes, kselftest.capabilities. wont pass kcidb checks (trailing dot), and kbuild -kselftest trying to look up in jobs for ID, need to be fixed properly later
Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
1 parent c69f4a0 commit 1eebd64

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

src/send_kcidb.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,18 @@ def _parse_node_path(self, path, is_checkout_child):
365365
if len(parsed_path) >= 2:
366366
if parsed_path[0] == parsed_path[1]:
367367
parsed_path = parsed_path[1:]
368+
# Filter out empty strings to prevent trailing/leading dots
369+
parsed_path = [p for p in parsed_path if p]
368370
new_path = []
369371
for sub_path in parsed_path:
370372
if sub_path in self._jobs:
371-
suite_name = self._jobs[sub_path].kcidb_test_suite
373+
job = self._jobs[sub_path]
374+
if job.kind == "kbuild":
375+
# TODO: Make kselftest kbuild jobs properly
376+
# appear in dashboard/KCIDB instead of
377+
# silently skipping them
378+
continue
379+
suite_name = job.kcidb_test_suite
372380
if suite_name:
373381
new_path.append(suite_name)
374382
else:
@@ -379,16 +387,23 @@ def _parse_node_path(self, path, is_checkout_child):
379387
return None
380388
else:
381389
new_path.append(sub_path)
390+
# Filter empty components again after mapping
391+
new_path = [p for p in new_path if p]
382392
# Handle path where the first two components are identical after
383393
# mapping, e.g. ['job-name', 'suite', 'test'] -> ['suite', 'suite', 'test']
384394
if len(new_path) >= 2:
385395
if new_path[0] == new_path[1]:
386396
new_path = new_path[1:]
387397
path_str = ".".join(new_path)
388-
# Allowed pattern for test path is ^[.a-zA-Z0-9_-]*$'
398+
# KCIDB pattern: ^([a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)*)?$
399+
# Dots are only valid as separators between segments
389400
formatted_path_str = self._replace_restricted_chars(
390401
path_str, r"^[.a-zA-Z0-9_-]*$"
391402
)
403+
# Strip leading/trailing dots and collapse consecutive dots
404+
# to ensure conformance with KCIDB schema
405+
formatted_path_str = re.sub(r"\.{2,}", ".", formatted_path_str)
406+
formatted_path_str = formatted_path_str.strip(".")
392407
return formatted_path_str if formatted_path_str else None
393408
return None
394409

0 commit comments

Comments
 (0)