Skip to content

fix: honor action 'ignore' when generating notifications#83

Merged
lelia merged 1 commit into
mainfrom
fix/notifications-honor-ignore-action
Jun 26, 2026
Merged

fix: honor action 'ignore' when generating notifications#83
lelia merged 1 commit into
mainfrom
fix/notifications-honor-ignore-action

Conversation

@dc-larsen

@dc-larsen David Larsen (dc-larsen) commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Findings suppressed via a *_disabled_rules config (or otherwise resolved to action: ignore) are excluded from the dashboard and the uploaded facts, but they still appear in generated notifications: the GitHub PR comment, Slack, Jira, and the other notifiers.

OpenGrepScanner.generate_notifications() groups alerts for the notifiers and filters by severity only. A finding's severity is independent of its suppression, so a disabled critical/high rule (for example a SQL-injection rule a team has turned off) still posts to the PR comment even though the dashboard treats it as ignored.

Fix

Skip alerts whose action is ignore when building the notification groups. This gates every notifier consistently with how the dashboard handles suppressions. Suppressed alerts are still included in the uploaded facts, so the dashboard continues to show them as ignored; only notifications are affected.

Test

tests/test_notification_action_filter.py covers the OpenGrep PR-comment path:

  • an action: ignore critical finding is excluded while a non-ignored critical finding survives, and the summary counts reflect only the active finding
  • a component whose alerts are all suppressed produces no notifications

Full suite: 141 passed.

Follow-up

The same severity-only gate exists in the generate_notifications paths for the trufflehog, trivy, and socket_tier1 connectors. This PR scopes the change to the OpenGrep (SAST) path where it surfaced; extending the same action: ignore skip to those connectors is a sensible next step.

Fixes CE-285

@dc-larsen David Larsen (dc-larsen) requested a review from a team as a code owner June 24, 2026 01:16
@lelia lelia self-assigned this Jun 26, 2026
@lelia lelia force-pushed the fix/notifications-honor-ignore-action branch from aba2ba5 to 0358db9 Compare June 26, 2026 21:20
Findings suppressed via *_disabled_rules or a local SAST ignore override are
forced to action 'ignore' and tagged with an actionReason by the normalizer.
OpenGrepScanner.generate_notifications() filtered by severity only, so a
suppressed critical/high finding still posted to the PR comment, Slack, Jira,
and the other notifiers even though the dashboard treats it as ignored.

Skip alerts carrying an actionReason ('disabled_rule' or 'sast_ignore_override')
when building notification groups. Gate on the explicit reason rather than
action == 'ignore', because 'ignore' is also the default action the normalizer
derives for low-severity findings -- those must still notify when a user opts in
to low severities. Suppressed alerts still ship in the uploaded facts; only
notifications are gated.

Adds a regression test for the OpenGrep PR-comment path: a suppressed finding is
excluded while an active finding survives, a fully-suppressed component yields no
notifications, and an opted-in low-severity finding still notifies.

Fixes CE-285
@lelia lelia force-pushed the fix/notifications-honor-ignore-action branch from 1b75971 to 72a863e Compare June 26, 2026 21:30
@lelia lelia merged commit 28c0ad7 into main Jun 26, 2026
11 checks passed
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.

2 participants