Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid Mattermost notification template; Add more thorough publisher tests #3095

Merged
merged 3 commits into from
Oct 16, 2023

Conversation

nscuro
Copy link
Member

@nscuro nscuro commented Oct 13, 2023

Description

Fixes a defect in the Mattermost notification template that caused invalid JSON to be produced for PROJECT_AUDIT_CHANGE and NEW_VULNERABLE_DEPENDENCY notifications.

While working on this, I noticed that our test coverage for notification publishers is quite bad. We need a way to ensure that the JSON we send to external services is correct, and we also need a way to ensure that we do not introduce regressions when working on the code. Thus, this PR also includes extensive tests for all notification publishers.

Addressed Issue

Fixes #2838
Fixes #3093

Additional Details

N/A

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have added corresponding update logic
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

@nscuro nscuro marked this pull request as ready for review October 16, 2023 14:39
@nscuro nscuro merged commit 2d09a9f into DependencyTrack:master Oct 16, 2023
@nscuro nscuro deleted the issue-3093 branch October 16, 2023 14:54
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this pull request Oct 23, 2023
Ported from DependencyTrack/dependency-track#3095

Tests have not been ported, because the publishing of notifications now resides in the hyades notification-publisher, whereas the templates are still kept in the API server. It doesn't make sense to duplicate the template files to two repositories, risking that they become out-of-sync.

Signed-off-by: nscuro <[email protected]>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant