@@ -170,22 +170,28 @@ def trim_version_report(version_report, reduced_path_set):
170
170
171
171
'''
172
172
def 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' ]
174
174
175
175
def get_csv_data (version_report ):
176
176
csv_data = list ()
177
+ components = list ()
177
178
for bom_view_entry in version_report ['aggregateBomViewEntries' ]:
178
- entry = dict ()
179
+ entry = dict ()
179
180
entry ['component name' ] = bom_view_entry ['producerProject' ]['name' ]
180
181
entry ['version name' ] = bom_view_entry ['producerReleases' ][0 ]['version' ]
181
182
entry ['license' ] = bom_view_entry ['licenses' ][0 ]['licenseDisplay' ].replace (' AND ' ,';' ).replace ('(' ,'' ).replace (')' ,'' )
182
183
pid = bom_view_entry ['producerProject' ]['id' ]
183
184
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)
186
187
entry ['match type' ] = ';' .join (bom_view_entry ['matchTypes' ])
187
188
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 )
189
195
return csv_data
190
196
191
197
def write_output_file (version_report , output_file ):
0 commit comments