Skip to content

Allow notifications to be filtered using CEL expressions#1924

Draft
nscuro wants to merge 1 commit intomainfrom
notification-filter
Draft

Allow notifications to be filtered using CEL expressions#1924
nscuro wants to merge 1 commit intomainfrom
notification-filter

Conversation

@nscuro
Copy link
Copy Markdown
Member

@nscuro nscuro commented Mar 24, 2026

Description

Enables users to filter notifications before they're dispatched. A common use case being to filter NEW_VULNERABILITY notifications for vulnerabilities whose severity are below a given threshold (e.g. CRITICAL).

Implementing this using CEL expressions keeps the solution both simple to support, and easy to extend: Users can access all fields in the notification, and we don't need to make any changes when we add new notification fields.

CEL evaluation is fast and safe, so this is a perfect match.

Addressed Issue

N/A

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 updated the migration changelog accordingly
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

Enables users to filter notifications before they're dispatched. A common use case being to filter `NEW_VULNERABILITY` notifications for vulnerabilities whose severity are below a given threshold (e.g. `CRITICAL`).

Implementing this using CEL expressions keeps the solution both simple to support, and easy to extend: Users can access all fields in the notification, and we don't need to make any changes when we add new notification fields.

CEL evaluation is fast and safe, so this is a perfect match.

Signed-off-by: nscuro <[email protected]>
@codacy-production
Copy link
Copy Markdown

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.13% (target: -1.00%) 84.30% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (8ea911b) 25125 21522 85.66%
Head commit (c8bce6d) 26717 (+1592) 22850 (+1328) 85.53% (-0.13%)

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 (#1924) 121 102 84.30%

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant