Add more logs to Cache Processor Plugin
@@ -215,6 +215,10 @@ public class VulnerabilityCacheProcessorPlugin extends Plugin {
public void consume(String record) {
this.pluginError = null;
+ if (dbContext == null) {
+ logger.debug("DB Context is missing from Cache Processor Plugin.");
+ }
+
// Parse JSON object from kafka topic of GraphDBExtension.
// Although it doesn't have output payload, the plugin serializes the graph for its input.
// And we can use the input copy from this topic and the serialized graph to process our caching.
@@ -236,6 +240,7 @@ public class VulnerabilityCacheProcessorPlugin extends Plugin {
var version = revisionObj.getString("version");
var timestamp = revisionObj.optLong("createdAt", -1);
var revision = new Revision(id, groupId, artifactId, version, new Timestamp(timestamp));
+ logger.debug("Cache Processing: " + revision.product().toString());
var depSet = graphResolver.resolveDependencies(revision, dbContext, true);
var depIds = depSet.stream().map(r -> r.id).collect(Collectors.toSet());
@@ -293,10 +298,10 @@ public class VulnerabilityCacheProcessorPlugin extends Plugin {
output.put(entry.getKey(), pathsJson);
}
- if(output.length() == 0) {
- logger.info("Revision doesn't have vulnerable deps: " + revision.toString());
- return;
- }
+// if(output.length() == 0) {
+// logger.info("Revision doesn't have vulnerable deps: " + revision.toString());
+// return;
+// }
// Write the output into the file
try {
