-
-
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
♻️ ref(slos): change missing access errors to halts for discord #83896
Conversation
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #83896 +/- ##
==========================================
- Coverage 87.63% 87.63% -0.01%
==========================================
Files 9522 9523 +1
Lines 542196 542237 +41
Branches 21228 21228
==========================================
+ Hits 475177 475200 +23
- Misses 66653 66671 +18
Partials 366 366 |
if isinstance(error, ApiRateLimitedError): | ||
# TODO(ecosystem): We should batch this on a per-organization basis | ||
lifecycle.record_halt(error) | ||
elif error.code in DISCORD_HALT_ERROR_CODES: |
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.
Discord returns codes that aren't HTTP status codes?!
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.
😄
lifecycle.record_halt(e) | ||
except ApiError as error: | ||
# Errors that we recieve from the Discord API | ||
record_lifecycle_termination_level(lifecycle, error) |
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.
do we need to do this in more places? like anywhere we send a Discord message?
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.
yep everywhere we send a message, including src/sentry/integrations/discord/actions/metric_alert.py
we should mark missing access errors from Discord (which means our bot's access was revoked) as halts instead of failures.
this is inline with what we do with slack here:
sentry/src/sentry/integrations/slack/utils/errors.py
Lines 26 to 27 in 323c6fb