@@ -170,22 +170,28 @@ def trim_version_report(version_report, reduced_path_set):
170170
171171'''
172172def get_csv_fieldnames ():
173- return ['component name' , 'version name' , 'license' , 'file path' , ' match type' , 'review status' ]
173+ return ['component name' , 'version name' , 'license' , 'match type' , 'review status' ]
174174
175175def get_csv_data (version_report ):
176176 csv_data = list ()
177+ components = list ()
177178 for bom_view_entry in version_report ['aggregateBomViewEntries' ]:
178- entry = dict ()
179+ entry = dict ()
179180 entry ['component name' ] = bom_view_entry ['producerProject' ]['name' ]
180181 entry ['version name' ] = bom_view_entry ['producerReleases' ][0 ]['version' ]
181182 entry ['license' ] = bom_view_entry ['licenses' ][0 ]['licenseDisplay' ].replace (' AND ' ,';' ).replace ('(' ,'' ).replace (')' ,'' )
182183 pid = bom_view_entry ['producerProject' ]['id' ]
183184 vid = bom_view_entry ['producerReleases' ][0 ]['id' ]
184- path_list = [p ['path' ] for p in version_report ['detailedFileBomViewEntries' ] if p ['projectId' ] == pid and p ['versionId' ] == vid ]
185- entry ['file path' ] = ';' .join (path_list )
185+ # path_list = [p['path'] for p in version_report['detailedFileBomViewEntries'] if p['projectId'] == pid and p['versionId'] == vid]
186+ # entry['file path'] = ';'.join(path_list)
186187 entry ['match type' ] = ';' .join (bom_view_entry ['matchTypes' ])
187188 entry ['review status' ] = bom_view_entry ['reviewSummary' ]['reviewStatus' ]
188- csv_data .append (entry )
189+
190+ # Only add if this component was not previously added.
191+ composite_key = pid + vid
192+ if composite_key not in components :
193+ csv_data .append (entry )
194+ components .append (composite_key )
189195 return csv_data
190196
191197def write_output_file (version_report , output_file ):
0 commit comments