Skip to content

Commit

Permalink
fix(SBOMER-290): duplicated comments after release manifest generation
Browse files Browse the repository at this point in the history
  • Loading branch information
vibe13 committed Dec 20, 2024
1 parent 4ea7cb4 commit 3865003
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,12 @@ protected void releaseManifestsForRPMBuilds(

@Transactional
protected void doUpdateGenerationsStatus(Collection<SbomGenerationRequest> releaseGenerations) {
for (SbomGenerationRequest releaseGeneration : releaseGenerations) {
releaseGeneration = generationRequestRepository.findById(releaseGeneration.getId());
SbomGenerationRequest.updateRequestEventStatus(releaseGeneration);
// Update only one SbomGenerationRequest, because the requestEvent associated is the same for all of them. This
// avoids duplicated comments in the advisory
if (releaseGenerations != null && !releaseGenerations.isEmpty()) {
SbomGenerationRequest generation = releaseGenerations.iterator().next();
generation = generationRequestRepository.findById(generation.getId());
SbomGenerationRequest.updateRequestEventStatus(generation);
}
}

Expand Down

0 comments on commit 3865003

Please sign in to comment.