Skip to content

Commit

Permalink
Merge pull request #2436 from Siemens-Healthineers/fix/pkgUpdationCau…
Browse files Browse the repository at this point in the history
…singInconsistency-2428

fix(importCDX) : Fix package's linked release updation when an SBOM is imported

Reviewed by: [email protected]
Tested by: [email protected]
  • Loading branch information
ag4ums authored May 17, 2024
2 parents 883571a + dfabecd commit c0150b3
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -647,10 +647,12 @@ private Map<String, String> importAllComponentsAsPackages(Map<String, List<org.c
pkg.setId(pkgAddSummary.getId());
if (AddDocumentRequestStatus.DUPLICATE.equals(pkgAddSummary.getRequestStatus())) {
Package dupPkg = packageDatabaseHandler.getPackageById(pkg.getId());
if (!release.getId().equals(dupPkg.getReleaseId())) {
log.error("Release Id of Package from BOM: '%s' and Database: '%s' is not equal!", release.getId(), dupPkg.getReleaseId());
dupPkg.setReleaseId(release.getId());
String dupPkgReleaseId = dupPkg.getReleaseId();
String releaseId = release.getId();
if (!releaseId.equals(dupPkgReleaseId) && CommonUtils.isNullEmptyOrWhitespace(dupPkgReleaseId)) {
dupPkg.setReleaseId(releaseId);
packageDatabaseHandler.updatePackage(dupPkg, user);
log.error("Release Id of Package from BOM: '%s' and Database: '%s' is not equal!", releaseId, dupPkgReleaseId);
}
if(!CommonUtils.nullToEmptySet(project.getPackageIds()).contains(pkg.getId())){
pkgReuseCount++;
Expand Down

0 comments on commit c0150b3

Please sign in to comment.