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(tags): Allow filtering by both IPv4 and IPv6 tags on EventUsers #71474

Merged
merged 4 commits into from
May 24, 2024

Conversation

leeandher
Copy link
Member

Resolves #71461

Prior, when filtering by IP, regardless of which type the address was, we'd apply an IPv4 and IPv6 filter (toIPv4 and toIPv6). For v4s this works fine since the toIPv4 resolves and toIPv6 allows for passing v4s. When passing in v6s though, toIPv4 fails loudly and returns a 500 from the API.

Now, we'll just create two conditions (v4 and v6) and add in all the valid IPs for each form of address after validating them as one or the other. The code was also a bit confusing so it got a heavy refactor, and a few test changes.

@leeandher leeandher requested a review from a team May 23, 2024 21:26
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label May 23, 2024
@JoshFerge
Copy link
Member

this has annoyed me in the past :D great stuff

Copy link

codecov bot commented May 23, 2024

Codecov Report

Attention: Patch coverage is 79.31034% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 77.93%. Comparing base (47296e1) to head (a23b8a7).
Report is 39 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #71474       +/-   ##
===========================================
+ Coverage   56.81%   77.93%   +21.11%     
===========================================
  Files        6525     6546       +21     
  Lines      290627   291202      +575     
  Branches    50287    50373       +86     
===========================================
+ Hits       165133   226949    +61816     
+ Misses     120765    58004    -62761     
- Partials     4729     6249     +1520     
Files Coverage Δ
src/sentry/utils/eventuser.py 94.23% <79.31%> (+17.02%) ⬆️

... and 1976 files with indirect coverage changes

@leeandher leeandher merged commit d3a44e0 into master May 24, 2024
48 of 49 checks passed
@leeandher leeandher deleted the leander/tags-error-hg-71461 branch May 24, 2024 17:46
volokluev pushed a commit that referenced this pull request May 28, 2024
…71474)

Resolves #71461

Prior, when filtering by IP, regardless of which type the address was,
we'd apply an IPv4 and IPv6 filter (`toIPv4` and `toIPv6`). For v4s this
works fine since the `toIPv4` resolves and `toIPv6` allows for passing
v4s. When passing in v6s though, `toIPv4` fails loudly and returns a 500
from the API.

Now, we'll just create two conditions (v4 and v6) and add in all the
valid IPs for each form of address after validating them as one or the
other. The code was also a bit confusing so it got a heavy refactor, and
a few test changes.
@github-actions github-actions bot locked and limited conversation to collaborators Jun 9, 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.

Unable to load Tag Details for some Issues
3 participants