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: remove notification failure policy log record when prevent posting is set #5260

Merged
merged 5 commits into from
Nov 20, 2024

Conversation

mderynck
Copy link
Contributor

@mderynck mderynck commented Nov 15, 2024

What this PR does

Changes UserNotificationPolicyLogRecord to success when slack_prevent_posting is set as the user has already been notified in slack or another method in their personal notification preferences. These entries have also been filtered out of the alert group history timeline as they were causing confusion to users thinking notifications failed when in fact they had already been sent.

Which issue(s) this PR closes

https://github.com/grafana/support-escalations/issues/13236

Checklist

  • Unit, integration, and e2e (if applicable) tests updated
  • Documentation added (or pr:no public docs PR label added if not required)
  • Added the relevant release notes label (see labels prefixed w/ release:). These labels dictate how your PR will
    show up in the autogenerated release notes.

@mderynck mderynck added pr:no public docs Added to a PR that does not require public documentation updates release:patch PR will be added to "Other Changes" section of release notes labels Nov 15, 2024
@mderynck mderynck marked this pull request as ready for review November 18, 2024 17:21
@mderynck mderynck requested a review from a team as a code owner November 18, 2024 17:21
| Q(
Q(type=UserNotificationPolicyLogRecord.TYPE_PERSONAL_NOTIFICATION_SUCCESS)
& Q(
notification_error_code=UserNotificationPolicyLogRecord.ERROR_NOTIFICATION_POSTING_TO_SLACK_IS_DISABLED
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we need to check for both conditions or just checking for the "disabled" error code would be enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ferril mentioned another case when posting alert groups in slack is disable by route, for that case we still want it to show up I think.

@@ -528,7 +528,7 @@ def perform_notification(log_record_pk, use_default_notification_policy_fallback
)
UserNotificationPolicyLogRecord(
author=user,
type=UserNotificationPolicyLogRecord.TYPE_PERSONAL_NOTIFICATION_FAILED,
type=UserNotificationPolicyLogRecord.TYPE_PERSONAL_NOTIFICATION_SUCCESS,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, for the notification auditor SUCCESS or FAILED are equally good (just in case).

@mderynck mderynck force-pushed the mderynck/remove-prevent-from-posting-fail-log branch from 57045d8 to 3d8e130 Compare November 20, 2024 16:26
@mderynck mderynck added this pull request to the merge queue Nov 20, 2024
Merged via the queue into dev with commit 757f0d1 Nov 20, 2024
25 checks passed
@mderynck mderynck deleted the mderynck/remove-prevent-from-posting-fail-log branch November 20, 2024 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:no public docs Added to a PR that does not require public documentation updates release:patch PR will be added to "Other Changes" section of release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants