Skip to content

Commit 5497db3

Browse files
committed
Feat: send input artifacts to KCIDB
Signed-off-by: Simone Tollardo <[email protected]>
1 parent 940cc4e commit 5497db3

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

src/send_kcidb.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,33 @@ def _parse_checkout_node(self, origin, checkout_node):
190190
}
191191
}]
192192

193+
def _get_input_files(self, artifacts: dict, exclude_properties=None):
194+
input_files = []
195+
for name, url in artifacts.items():
196+
if exclude_properties and name in exclude_properties:
197+
continue
198+
if "input_" not in name:
199+
# Skip output files
200+
continue
201+
# Replace "/" with "_" to match with the allowed pattern
202+
# for "name" property of "input_files" i.e. '^[^/]+$'
203+
name = name.replace("/", "_")
204+
input_files.append(
205+
{
206+
'name': name,
207+
'url': url
208+
}
209+
)
210+
return input_files
211+
193212
def _get_output_files(self, artifacts: dict, exclude_properties=None):
194213
output_files = []
195214
for name, url in artifacts.items():
196215
if exclude_properties and name in exclude_properties:
197216
continue
217+
if "input_" in name:
218+
# Skip input files
219+
continue
198220
# Replace "/" with "_" to match with the allowed pattern
199221
# for "name" property of "output_files" i.e. '^[^/]+$'
200222
name = name.replace("/", "_")
@@ -312,7 +334,6 @@ def _parse_build_node(self, origin, node):
312334
artifacts=artifacts,
313335
exclude_properties=('build_log', '_config')
314336
)
315-
parsed_build_node['input_files'] = None
316337
parsed_build_node['config_url'] = artifacts.get('_config')
317338
parsed_build_node['log_url'] = artifacts.get('build_log')
318339
log_url = parsed_build_node['log_url']
@@ -537,11 +558,14 @@ def _parse_test_node(self, origin, test_node):
537558

538559
artifacts = self._get_artifacts(test_node)
539560
if artifacts:
561+
parsed_test_node['input_files'] = self._get_input_files(
562+
artifacts=artifacts,
563+
exclude_properties=None
564+
)
540565
parsed_test_node['output_files'] = self._get_output_files(
541566
artifacts=artifacts,
542567
exclude_properties=('lava_log', 'test_log')
543568
)
544-
parsed_test_node['input_files'] = None
545569
if artifacts.get('lava_log'):
546570
parsed_test_node['log_url'] = artifacts.get('lava_log')
547571
else:

0 commit comments

Comments
 (0)