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(rpc): Fix more of the events tests #81934

Merged
merged 5 commits into from
Dec 19, 2024
Merged

fix(rpc): Fix more of the events tests #81934

merged 5 commits into from
Dec 19, 2024

Conversation

wmak
Copy link
Member

@wmak wmak commented Dec 10, 2024

  • This fixes a bug with searching on fields with contexts where we weren't passing context
    • eg. if you did project:some-slug, the context to transform wasn't being passed
  • This fixes a bug where we weren't searching sentry_tags correctly

- This fixes a bug with searching on fields with contexts where we
  weren't passing context
  - eg. if you did project:some-slug, the context to transform wasn't
    being passed
- This fixes a bug where we weren't searching sentry_tags correctly
@wmak wmak requested a review from a team as a code owner December 10, 2024 20:51
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Dec 10, 2024
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 87.80488% with 5 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/search/eap/spans.py 83.87% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #81934      +/-   ##
==========================================
+ Coverage   80.36%   80.42%   +0.05%     
==========================================
  Files        7277     7284       +7     
  Lines      321426   321308     -118     
  Branches    20973    20922      -51     
==========================================
+ Hits       258326   258421      +95     
+ Misses      62689    62484     -205     
+ Partials      411      403       -8     

@wmak wmak requested a review from a team as a code owner December 10, 2024 21:25
@wmak wmak changed the title ifix(rpc): Fix more of the events tests fix(rpc): Fix more of the events tests Dec 10, 2024
src/sentry/search/events/constants.py Outdated Show resolved Hide resolved
@@ -430,11 +435,21 @@ def device_class_context_constructor(params: SnubaParams) -> VirtualColumnContex
)


def module_context_constructor(params: SnubaParams) -> VirtualColumnContext:
value_map = {key: key for key in SPAN_MODULE_CATEGORY_VALUES}
Copy link
Member

Choose a reason for hiding this comment

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

What's the point of this map if it just maps to itself?

Copy link
Member Author

Choose a reason for hiding this comment

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

Need the transform to other for unknown values (need to update the proto to change the default value which is why there's xfailed tests)

Comment on lines 160 to 161
elif len(terms) == 0:
return None, []
Copy link
Member

Choose a reason for hiding this comment

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

nit: maybe move this condition to the beginning?

resolved_rhs = self._resolve_boolean_conditions(rhs) if rhs else None
resolved_lhs, contexts_lhs = self._resolve_boolean_conditions(lhs)
resolved_rhs, contexts_rhs = self._resolve_boolean_conditions(rhs)
contexts = contexts_lhs + contexts_rhs
Copy link
Member

Choose a reason for hiding this comment

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

Is there a need to dedupe contexts here?

Copy link
Member Author

Choose a reason for hiding this comment

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

My thought is that its on the caller to call the dedupe function once, instead of it potentially being automatically being called multiple times within the Resolver, open to dedupe here as well if you think its important

Comment on lines +451 to +452
if column.startswith("sentry_tags"):
field = f"sentry.{field}"
Copy link
Member

Choose a reason for hiding this comment

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

Is this for backwards compatibility? To support syntax like sentry_tags[foo]?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, i can xskip tests if we want to remove that though, i'm just trying to get CI passing so we have 1:1 functionality right now

@wmak wmak merged commit 1448a59 into master Dec 19, 2024
49 checks passed
@wmak wmak deleted the wmak/fix/fix-events-tests branch December 19, 2024 19:36
Copy link

sentry-io bot commented Dec 20, 2024

Suspect Issues

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

  • ‼️ NotImplementedError: Can't filter on aggregates yet /api/0/organizations/{organization_id_or_slug}/... View Issue

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

andrewshie-sentry pushed a commit that referenced this pull request Jan 2, 2025
- This fixes a bug with searching on fields with contexts where we
weren't passing context
- eg. if you did project:some-slug, the context to transform wasn't
being passed
- This fixes a bug where we weren't searching sentry_tags correctly
@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2025
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