DependencyTrack / DependencyTrack/dependency-track

No test mail sent if Notification Level not on Informational

Open
#6,519 3 comments 0 reactions 0 assignees View on GitHub
defect in triage
Dominant language
Java
Stars
4.2k
Forks
811
Avg merge
8h 39m
Merged PRs (30d)
237

Description

### Current Behavior

Since 5.0.0, clicking "Perform Test" on a notification rule does nothing if the rule's notification level is set to Warning or Error, no email arrives and no error is shown. Maybe due to notification levels being hardcoded in [TestNotificationFactory ](https://github.com/DependencyTrack/dependency-track/blob/1abb7f6cfeceefac1836161e7e5b8c46d0ab5a7c/notification/api/src/main/java/org/dependencytrack/notification/api/TestNotificationFactory.java#L128).

In 4.x this worked fine regardless of the configured level.

### Steps to Reproduce

1. Create a notification rule with scope Portfolio, group POLICY_VIOLATION, and notification level Warning.
2. Hit the "Perform test" button.
3. No email is sent.

### Expected Behavior

Test email is sent regardless of level and in case Test mail is not sent a small notification something went wrong.

### Dependency-Track Version

5.x

### Browser

Google Chrome

### Checklist

- [x] I have read and understand the [contributing guidelines](https://github.com/DependencyTrack/dependency-track/blob/main/CONTRIBUTING.md#filing-issues)
- [x] I have checked the [existing issues](https://github.com/DependencyTrack/dependency-track/issues) for whether this defect was already reported

Contributor guide

Open the contributing guide

Research direction

Start with notification/api/src/main/java/org/dependencytrack/notification/api/TestNotificationFactory.java at the linked line, then trace the Perform Test flow for rules using Warning or Error levels. Reproduce the issue with the stated Portfolio/POLICY_VIOLATION rule and verify that a test email is sent regardless of level, with an error notification when delivery fails.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.