@@ -190,13 +190,13 @@ def _parse_checkout_node(self, origin, checkout_node):
190190 }
191191 }]
192192
193- def _get_input_files (self , artifacts : dict , exclude_properties = None ):
193+ def _filter_artifacts (self , artifacts : dict , exclude_properties = None ,
194+ include_properties = None ):
194195 input_files = []
195196 for name , url in artifacts .items ():
196- if exclude_properties and name in exclude_properties :
197+ if exclude_properties and any ( prop in name for prop in exclude_properties ) :
197198 continue
198- if not name .startswith ('input_' ):
199- # Skip output files
199+ if include_properties and not any (prop in name for prop in include_properties ):
200200 continue
201201 # Replace "/" with "_" to match with the allowed pattern
202202 # for "name" property of "input_files" i.e. '^[^/]+$'
@@ -209,25 +209,6 @@ def _get_input_files(self, artifacts: dict, exclude_properties=None):
209209 )
210210 return input_files
211211
212- def _get_output_files (self , artifacts : dict , exclude_properties = None ):
213- output_files = []
214- for name , url in artifacts .items ():
215- if exclude_properties and name in exclude_properties :
216- continue
217- if name .startswith ('input_' ):
218- # Skip input files
219- continue
220- # Replace "/" with "_" to match with the allowed pattern
221- # for "name" property of "output_files" i.e. '^[^/]+$'
222- name = name .replace ("/" , "_" )
223- output_files .append (
224- {
225- 'name' : name ,
226- 'url' : url
227- }
228- )
229- return output_files
230-
231212 def _get_log_excerpt (self , log_url ):
232213 """Parse compressed(gzip) or text log file and return last 16*1024 characters as it's
233214 the maximum allowed length for KCIDB `log_excerpt` field"""
@@ -558,13 +539,13 @@ def _parse_test_node(self, origin, test_node):
558539
559540 artifacts = self ._get_artifacts (test_node )
560541 if artifacts :
561- parsed_test_node ['input_files' ] = self ._get_input_files (
542+ parsed_test_node ['input_files' ] = self ._filter_artifacts (
562543 artifacts = artifacts ,
563- exclude_properties = None
544+ include_properties = ( 'input_' )
564545 )
565- parsed_test_node ['output_files' ] = self ._get_output_files (
546+ parsed_test_node ['output_files' ] = self ._filter_artifacts (
566547 artifacts = artifacts ,
567- exclude_properties = ('lava_log' , 'test_log' )
548+ exclude_properties = ('lava_log' , 'test_log' , 'input_' )
568549 )
569550 if artifacts .get ('lava_log' ):
570551 parsed_test_node ['log_url' ] = artifacts .get ('lava_log' )
0 commit comments