@@ -318,7 +318,7 @@ def download_dca_databases(
318
318
Returns:
319
319
List of (project_name, database_dir) pairs, where database_dir is None if the download failed.
320
320
"""
321
- database_results = []
321
+ database_results = {}
322
322
print ("\n === Finding projects ===" )
323
323
response = get_json_from_github (
324
324
f"https://raw.githubusercontent.com/github/codeql-dca-main/data/{ experiment_name } /reports/downloads.json" ,
@@ -365,28 +365,13 @@ def download_dca_databases(
365
365
with tarfile .open (artifact_tar_location , "r:gz" ) as tar_ref :
366
366
# And we just untar it to the same directory as the zip file
367
367
tar_ref .extractall (artifact_unzipped_location )
368
- database_results .append (
369
- (
370
- project_map [pretty_name ],
371
- os .path .join (
372
- artifact_unzipped_location , remove_extension (entry )
373
- ),
374
- )
368
+ database_results [pretty_name ] = os .path .join (
369
+ artifact_unzipped_location , remove_extension (entry )
375
370
)
376
371
377
372
print (f"\n === Extracted { len (database_results )} databases ===" )
378
373
379
- def compare (a , b ):
380
- a_index = next (
381
- i for i , project in enumerate (projects ) if project ["name" ] == a [0 ]["name" ]
382
- )
383
- b_index = next (
384
- i for i , project in enumerate (projects ) if project ["name" ] == b [0 ]["name" ]
385
- )
386
- return a_index - b_index
387
-
388
- # Sort the database results based on the order in the projects file
389
- return sorted (database_results , key = cmp_to_key (compare ))
374
+ return [(project , database_results [project ["name" ]]) for project in projects ]
390
375
391
376
392
377
def get_mad_destination_for_project (config , name : str ) -> str :
0 commit comments