Fix notification rule test to work regardless of rule level - #6914
valentijnscholten wants to merge 1 commit into
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Look up test notifications by scope and group only, then apply the rule's configured level to the dummy notification so the Test button verifies publisher delivery for Error and Warning rules too. Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
484ea9f to
dc9eed9
Compare
I don't believe this is a good idea as it creates a false sense of assurance. The system would never emit such a notification beyond this test. So the manual test could "pass", but in production you'd never see a notification from the rule. Better approaches would be to:
|
|
It sounds a bit overly complex to me, but maybe there just needs to be a button on the SMTP config screen to send a test e-mail because that was my main goal that I wanted to make sure emails are/can be delivered. |
Today I lost a lot time debugging email alerts not working. The "Perform Test" button confirmed to me that a test email was submitted to the queue succesfully. But it didn't arrive. Turns out no e-mail was queued after all. The reason is that my alert has level "Error" and the test button only has an "Informational" template to use. So it didn't find a suitable template and didn't send a test e-mail. This PR simplifies the template/supplier matrix to always generate an event regardless of the chosen level.
Summary
NEW_VULNERABILITY.