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(alerts): avoid AttributeError in EventAttributeCondition #79799

Merged
merged 6 commits into from
Nov 4, 2024

Conversation

cathteng
Copy link
Member

Fixes SENTRY-3H0X

@cathteng cathteng requested a review from a team October 25, 2024 22:59
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 25, 2024
@cathteng cathteng enabled auto-merge (squash) October 25, 2024 23:00
Copy link

codecov bot commented Oct 25, 2024

Codecov Report

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

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/rules/conditions/event_attribute.py 63.63% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #79799      +/-   ##
==========================================
- Coverage   78.09%   78.09%   -0.01%     
==========================================
  Files        7178     7178              
  Lines      317128   317137       +9     
  Branches    43722    43726       +4     
==========================================
- Hits       247665   247662       -3     
- Misses      63118    63124       +6     
- Partials     6345     6351       +6     

@@ -256,7 +256,7 @@ def _handle(cls, path: list[str], event: GroupEvent) -> list[str]:
return []

return [
getattr(e, path[1])
str(getattr(e, path[1], None))
Copy link
Member

Choose a reason for hiding this comment

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

Why is this one stringified?

Copy link
Member Author

Choose a reason for hiding this comment

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

mypy gets angry

Copy link
Member

Choose a reason for hiding this comment

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

Weird, could we run into a problem later on with a string of 'None' though?

Copy link
Member Author

Choose a reason for hiding this comment

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

replaced with hasattr

@cathteng cathteng merged commit bac2eae into master Nov 4, 2024
49 of 50 checks passed
@cathteng cathteng deleted the cathy/alerts/avoid-attributeerror branch November 4, 2024 17:55
Copy link

sentry-io bot commented Nov 8, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ SnubaError: HTTPConnectionPool(host='127.0.0.1', port=1218): Max retries exceeded with url: /tests/events/eve... pytest.runtest.protocol tests/sentry/rules/cond... View Issue
  • ‼️ SnubaError: HTTPConnectionPool(host='127.0.0.1', port=1218): Max retries exceeded with url: /tests/events/eve... pytest.runtest.protocol tests/sentry/rules/cond... View Issue

Did you find this useful? React with a 👍 or 👎

@github-actions github-actions bot locked and limited conversation to collaborators Nov 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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