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

Adds possibility to limit notification rules to tags #3506

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sebD
Copy link
Contributor

@sebD sebD commented Feb 28, 2024

Description

Adds tags to limitations of notification rules (alerts)

  • adds tags to the NotificationRule db schema
  • adds rest api resources to manage them
  • adds management of tags when filtering notifications

Addressed Issue

Fixes #2975

Additional Details

I wanted to use qm.getProjects(tag, false, true, true) but during tests, it failed to retrieved the proper data. This part may need to be redone. (see org.dependencytrack.notification.NotificationRouter#restrictNotificationToRuleProjects fixme comment)
Manual tests performed:

  • When an alert on 'bom consumed' limited to a tag is configured, if I upload a bom on the tagged project, then notification is triggered
  • When an alert on 'bom consumed' limited to a project is configured, if I upload a bom on the project, then notification is triggered
  • When an alert on 'bom consumed' limited to a project with children included is configured, if I upload a bom on a child project, then notification is triggered

No upgrade logic added for additional column.

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 added this to the 4.12 milestone Mar 10, 2024
@sebD sebD force-pushed the 2975-limits-to-tags-for-alerts branch 2 times, most recently from 0ed4f65 to eb89070 Compare April 7, 2024 10:02
Copy link

codacy-production bot commented Apr 7, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.02% (target: -1.00%) 83.33% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (3e8f93f) 21657 16127 74.47%
Head commit (22ae441) 21703 (+46) 16165 (+38) 74.48% (+0.02%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3506) 102 85 83.33%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

You may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation

…rojects.

Fixes: DependencyTrack#2975

Signed-off-by: Sebastien Delcoigne <sebastien.delcoigne@gmail.com>
Signed-off-by: Sebastien Delcoigne <sebastien.delcoigne@gmail.com>
@sebD sebD force-pushed the 2975-limits-to-tags-for-alerts branch from eb89070 to 22ae441 Compare April 12, 2024 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "Limits to Tags" for Alerts
2 participants