@@ -347,10 +347,13 @@ def merge_vulnerability(vuln) -> None:
347347 logger .info (
348348 f"Querying npm advisories for { len (packages_for_global_advisories )} installed packages from { package_dir } "
349349 )
350- for traced in packages_for_global_advisories :
351- if traced ["name" ] in TRACE_PACKAGES :
350+ for package in packages_for_global_advisories :
351+ logger .info (
352+ f"NPM package advisory query target: { package ['name' ]} @{ package ['version' ]} path={ package .get ('path' , '<unknown>' )} "
353+ )
354+ if package ["name" ] in TRACE_PACKAGES :
352355 logger .info (
353- f"Trace package entering advisory queries: { traced ['name' ]} @{ traced ['version' ]} path={ traced .get ('path' , '<unknown>' )} "
356+ f"Trace package entering advisory queries: { package ['name' ]} @{ package ['version' ]} path={ package .get ('path' , '<unknown>' )} "
354357 )
355358 if self .gh_token is not None :
356359 transport = AIOHTTPTransport (
@@ -365,6 +368,9 @@ def merge_vulnerability(vuln) -> None:
365368 )
366369
367370 for package in packages :
371+ logger .info (
372+ f"GHAD package query: { package ['name' ]} @{ package ['version' ]} "
373+ )
368374 try :
369375 result = client .execute (
370376 github_vulnerabilities_query ,
@@ -375,6 +381,9 @@ def merge_vulnerability(vuln) -> None:
375381 f"Skipping GitHub advisory query for { package ['name' ]} @{ package ['version' ]} : { exc } "
376382 )
377383 continue
384+ logger .info (
385+ f"GHAD package query result count for { package ['name' ]} @{ package ['version' ]} : { len (result ['securityVulnerabilities' ]['nodes' ])} "
386+ )
378387 if package ["name" ] in TRACE_PACKAGES :
379388 logger .info (
380389 f"Trace package GHAD results for { package ['name' ]} @{ package ['version' ]} : { len (result ['securityVulnerabilities' ]['nodes' ])} candidates"
@@ -428,6 +437,9 @@ def merge_vulnerability(vuln) -> None:
428437
429438 for package in packages_for_global_advisories :
430439 matched_global = self .match_global_advisories (package , global_advisories )
440+ logger .info (
441+ f"Global advisory filtered match count for { package ['name' ]} @{ package ['version' ]} : { len (matched_global )} "
442+ )
431443 if package ["name" ] in TRACE_PACKAGES :
432444 logger .info (
433445 f"Trace package global advisory matches for { package ['name' ]} @{ package ['version' ]} : { len (matched_global )} "
@@ -559,6 +571,9 @@ def fetch_global_advisories(self, packages: List[Dict[str, str]]) -> List[Dict]:
559571 logger .info (
560572 f"Fetching global advisories batch { index // batch_size + 1 } of { ((len (requested ) - 1 ) // batch_size ) + 1 } with { len (batch )} packages"
561573 )
574+ logger .info (
575+ "Global advisory batch package list: " + ", " .join (batch )
576+ )
562577 traced_batch = [item for item in batch if item .split ('@' , 1 )[0 ] in TRACE_PACKAGES ]
563578 if traced_batch :
564579 logger .info (f"Trace package present in global advisory batch: { traced_batch } " )
0 commit comments