-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
🔧 chore: refactor opsgenie client to decompose send notification #88588
Conversation
@@ -85,40 +85,32 @@ def _get_issue_alert_payload( | |||
} | |||
return payload | |||
|
|||
def send_notification( | |||
def send_notification(self, data): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a simple method which takes a payload and sends a notification
): | ||
headers = self._get_auth_headers() | ||
interaction_type = OnCallInteractionType.CREATE | ||
if isinstance(data, (Event, GroupEvent)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this if statement isn't needed anymore and the logic inside of it now lives in the callee, see notification.py
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #88588 +/- ##
===========================================
+ Coverage 45.52% 87.75% +42.23%
===========================================
Files 10005 10027 +22
Lines 566929 567907 +978
Branches 22296 22296
===========================================
+ Hits 258068 498354 +240286
+ Misses 308441 69133 -239308
Partials 420 420 |
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
the opsgenie client's
send_notification
was also building the payload, which makes things coupled and was making updating the link building logic a little bit more difficult, so i am breaking this logic down.