fix(slack): correct suspect commit
The suspect commit is stored via the GroupOwner model. We have been fetching the suspect commit using the old logic (the commit responsible for the first line in the stacktrace) but this is incorrect.
NOTE: This probably won't be the final state, as we are not guaranteed the suspect commit will exist at the time the Slack message is sent because suspect commits processing is async from the alert rule firing.
🔍 Existing Issues For Review
Your pull request is modifying functions with the following pre-existing issues:
📄 File: src/sentry/integrations/slack/message_builder/issues.py
| Function | Unhandled Issue |
|---|---|
build |
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' sentry.tasks.dige... Event Count: 24 |
build |
TypeError: 'NoneType' object cannot be interpreted as an integer sentry.tasks.activity.send_activi... Event Count: 9 |
build |
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' sentry.tasks.activity.send_acti... Event Count: 2 |
build |
User.DoesNotExist sentry.tasks.digests.deliver_di... Event Count: 1 |
📄 File: src/sentry/integrations/slack/message_builder/notifications/issues.py (Click to Expand)
| Function | Unhandled Issue |
|---|---|
build |
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' sentry.tasks.dige... Event Count: 24 |
build |
TypeError: 'NoneType' object cannot be interpreted as an integer sentry.tasks.activity.send_activi... Event Count: 9 |
build |
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' sentry.tasks.activity.send_acti... Event Count: 2 |
build |
User.DoesNotExist sentry.tasks.digests.deliver_di... Event Count: 1 |
Did you find this useful? React with a 👍 or 👎
Codecov Report
Attention: Patch coverage is 97.61905% with 1 lines in your changes are missing coverage. Please review.
Project coverage is 80.04%. Comparing base (
07ac900) to head (4070e81).
Additional details and impacted files
@@ Coverage Diff @@
## master #70634 +/- ##
==========================================
+ Coverage 79.06% 80.04% +0.97%
==========================================
Files 6502 6502
Lines 290526 290545 +19
Branches 50067 50067
==========================================
+ Hits 229699 232559 +2860
+ Misses 60388 57548 -2840
+ Partials 439 438 -1
| Files | Coverage Δ | |
|---|---|---|
| src/sentry/api/serializers/models/pullrequest.py | 100.00% <100.00%> (ø) |
|
| ...entry/integrations/slack/message_builder/issues.py | 90.14% <100.00%> (-0.09%) |
:arrow_down: |
| ...ions/slack/message_builder/notifications/issues.py | 100.00% <ø> (ø) |
|
| src/sentry/models/pullrequest.py | 100.00% <100.00%> (ø) |
|
| src/sentry/notifications/notifications/rules.py | 98.49% <ø> (ø) |
|
| src/sentry/models/group.py | 96.68% <91.66%> (+0.09%) |
:arrow_up: |
@isabellaenriquez suggested assignees will not be guaranteed to have suspect committers because of the same issue affecting the suspect commit (it's an async task, notifications are sent synchronously so it likely won't exist when the notification is firing). so right now it's probably not sending any suggested assignees including suspect committers
Suspect Issues
This pull request was deployed and Sentry observed the following issues:
- ‼️ AttributeError: 'NoneType' object has no attribute 'get'
sentry.tasks.activity.send_activity_notificationsView Issue
Did you find this useful? React with a 👍 or 👎