Skip to content

Commit

Permalink
Revert "Add the project name and project URL to bom processing notifi…
Browse files Browse the repository at this point in the history
…cations"

This reverts commit 063c2b3.

Signed-off-by: Ross Murphy <[email protected]>
  • Loading branch information
2000rosser authored and rkg-mm committed May 5, 2024
1 parent 1cb2f06 commit 5a70191
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
package org.dependencytrack.tasks;

import alpine.common.logging.Logger;
import alpine.common.util.UrlUtil;
import alpine.event.framework.Event;
import alpine.event.framework.Subscriber;
import alpine.model.ConfigProperty;
import alpine.notification.Notification;
import alpine.notification.NotificationLevel;
import org.cyclonedx.BomParserFactory;
Expand Down Expand Up @@ -222,7 +220,7 @@ public void inform(final Event e) {
Notification.dispatch(new Notification()
.scope(NotificationScope.PORTFOLIO)
.group(NotificationGroup.BOM_PROCESSED)
.title(NotificationConstants.Title.BOM_PROCESSED + " on Project: [" + event.getProject().getName() + "]")
.title(NotificationConstants.Title.BOM_PROCESSED)
.level(NotificationLevel.INFORMATIONAL)
.content("A " + bomFormat.getFormatShortName() + " BOM was processed")
.subject(new BomConsumedOrProcessed(detachedProject, Base64.getEncoder().encodeToString(bomBytes), bomFormat, bomSpecVersion)));
Expand All @@ -231,16 +229,12 @@ public void inform(final Event e) {
if (bomProcessingFailedProject != null) {
bomProcessingFailedProject = qm.detach(Project.class, bomProcessingFailedProject.getId());
}
final ConfigProperty baseUrlProperty = qm.getConfigProperty(
ConfigPropertyConstants.GENERAL_BASE_URL.getGroupName(),
ConfigPropertyConstants.GENERAL_BASE_URL.getPropertyName()
);
Notification.dispatch(new Notification()
.scope(NotificationScope.PORTFOLIO)
.group(NotificationGroup.BOM_PROCESSING_FAILED)
.title(NotificationConstants.Title.BOM_PROCESSING_FAILED + " on Project: [" + event.getProject().getName() + "]")
.title(NotificationConstants.Title.BOM_PROCESSING_FAILED)
.level(NotificationLevel.ERROR)
.content("An error occurred while processing a BOM: " + UrlUtil.normalize(baseUrlProperty.getPropertyValue()) + "/projects/" + event.getProject().getUuid())
.content("An error occurred while processing a BOM")
.subject(new BomProcessingFailed(bomProcessingFailedProject, Base64.getEncoder().encodeToString(bomBytes), ex.getMessage(), bomProcessingFailedBomFormat, bomProcessingFailedBomVersion)));
} finally {
qm.commitSearchIndex(true, Component.class);
Expand Down

0 comments on commit 5a70191

Please sign in to comment.