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

♻️ ref(slos): change missing access errors to halts for discord #83896

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

iamrajjoshi
Copy link
Member

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:

SLACK_SDK_HALT_ERROR_CATEGORIES = (
ACCOUNT_INACTIVE,

@iamrajjoshi iamrajjoshi self-assigned this Jan 23, 2025
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 23, 2025
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 91.83673% with 4 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ts/sentry/integrations/discord/test_issue_alert.py 63.63% 4 Missing ⚠️
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              

@iamrajjoshi iamrajjoshi marked this pull request as ready for review January 23, 2025 16:21
@iamrajjoshi iamrajjoshi requested review from a team as code owners January 23, 2025 16:21
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:
Copy link
Member

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?!

Copy link
Member Author

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)
Copy link
Member

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?

Copy link
Member Author

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

@iamrajjoshi iamrajjoshi requested a review from a team January 23, 2025 17:32
@iamrajjoshi iamrajjoshi merged commit b1d93ec into master Jan 23, 2025
49 checks passed
@iamrajjoshi iamrajjoshi deleted the raj/discord-slo-missing-access branch January 23, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants