Add more logging to Vuln Cache Proc plugin
@@ -270,7 +270,12 @@ public class VulnerabilityCacheProcessorPlugin extends Plugin {
logger.info("Dep IDs: " + depIds.size());
var vulnerableDependencies = kbDao.findVulnerablePackageVersions(depIds);
+ if (vulnerableDependencies.size() == 0) {
+ logger.info("No Vulnerabilities Found. Skipping processing of revision.");
+ continue;
+ } else {
logger.info("Vulnerable IDs: " + vulnerableDependencies.size());
+ }
var databaseMerger = new CGMerger(depIds, dbContext, graphDao);
var graph = databaseMerger.mergeWithCHA(revision.toString());
@@ -293,6 +298,7 @@ public class VulnerabilityCacheProcessorPlugin extends Plugin {
vulnerablePaths.addAll(getPathsToVulnerableNode(graph, internal, vulnerable, new HashSet<>(), new ArrayList<>(), new ArrayList<>()));
}
}
+ logger.info("Vulnerable Paths: " + vulnerablePaths.toString());
// Group vulnerable path by the vulnerabilities
var vulnerabilitiesMap = new HashMap<String, List<List<Long>>>();
@@ -354,6 +360,7 @@ public class VulnerabilityCacheProcessorPlugin extends Plugin {
FileWriter writer = new FileWriter(outputFile);
writer.write(output.toString());
writer.close();
+ logger.info("Persisted cache file for revision: " + revision.toString());
} catch (IOException e) {
logger.error("Unable to persist the cache output in the file", e);
setPluginError(e);
