Improved logging of vulnerability processing.
@@ -167,7 +167,7 @@ public class VulnerabilityStatementsProcessor extends Plugin {
logger.info("Read vulnerability statement " + v.getId() + " from " + consumeTopics.toString());
contexts.keySet().forEach(ecosystem -> getDbContext(ecosystem).
transaction(configuration -> {
- logger.info(v.getId() + ": Inserting vulnerability into the database for ecosystem: " + "\"" + ecosystem + "\".");
+ logger.info(v.getId() + ": Updating vulnerability in the database for ecosystem: " + "\"" + ecosystem + "\".");
var vulnerabilityForEcosystem = gson.fromJson(record, Vulnerability.class);
restrictByEcosystem(vulnerabilityForEcosystem, ecosystem);
updateVulnerability(vulnerabilityForEcosystem, DSL.using(configuration));
@@ -189,10 +189,14 @@ public class VulnerabilityStatementsProcessor extends Plugin {
metadataUtility.deleteVulnerabilityData(vulnerability.getId(), vulnerabilityId, dbContext);
}
if(!vulnerability.getValidatedPurls().isEmpty()) {
+ logger.info(vulnerability.getId() + ": Inserting vulnerability and purls.");
vulnerabilityId = metadataUtility.insertVulnerability(vulnerability, dbContext);
metadataUtility.insertPurls(vulnerabilityId, vulnerability.getValidatedPurls(), dbContext);
updatePackageVersions(null, dbContext);
}
+ else {
+ logger.info(vulnerability.getId() + ": No relevant purls for ecosystem, skipping insertion.");
+ }
}
private void updateVulnerabilityPatchData() {
