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

feat(discover): Prevent calling Snuba with an empty list of projects #69577

Merged
merged 2 commits into from Apr 25, 2024

Conversation

armenzg
Copy link
Member

@armenzg armenzg commented Apr 24, 2024

Do not include a where condition if project_ids is an empty list since it will return no data.
This will cause Snuba to respond that project_ids is missing rather than pretend that everything is fine.

In #69575 I attempt to save the call to Snuba but it requires a lot of test changes.

@armenzg armenzg self-assigned this Apr 24, 2024
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 24, 2024
@armenzg armenzg marked this pull request as ready for review April 24, 2024 15:36
@armenzg armenzg requested review from a team as code owners April 24, 2024 15:36
@armenzg
Copy link
Member Author

armenzg commented Apr 24, 2024

I messed up #69499 so I had to open this one.

Copy link
Member

@wmak wmak left a comment

Choose a reason for hiding this comment

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

🙏 thanks for tackling this

Copy link

codecov bot commented Apr 24, 2024

Codecov Report

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

Project coverage is 79.67%. Comparing base (34d9222) to head (c03b6e6).
Report is 53 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #69577      +/-   ##
==========================================
- Coverage   79.68%   79.67%   -0.01%     
==========================================
  Files        6483     6483              
  Lines      287949   287909      -40     
  Branches    49642    49619      -23     
==========================================
- Hits       229438   229385      -53     
- Misses      58140    58153      +13     
  Partials      371      371              
Files Coverage Δ
src/sentry/utils/snuba.py 93.62% <100.00%> (-0.13%) ⬇️
src/sentry/search/events/builder/discover.py 96.21% <80.00%> (-0.10%) ⬇️

... and 21 files with indirect coverage changes

@armenzg armenzg merged commit f8d3a1e into master Apr 25, 2024
48 of 49 checks passed
@armenzg armenzg deleted the feat/discover/complain_empty_projects/armenzg branch April 25, 2024 11:58
Copy link

sentry-io bot commented Apr 25, 2024

Suspect Issues

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

  • ‼️ UnqualifiedQueryError: validation failed for entity discover_events: Entity discover_events: Query column 'measurements'... /api/0/organizations/{organization_slug}/issues/ View Issue
  • ‼️ UnqualifiedQueryError: validation failed for entity events: missing required conditions for project_id /api/0/organizations/{organization_slug}/issues... View Issue
  • ‼️ UnqualifiedQueryError: You need to specify at least one project. /api/0/organizations/{organization_slug}/replay... View Issue
  • ‼️ UnqualifiedQueryError: Not a valid UUID string /api/0/organizations/{organization_slug}/replay... View Issue
  • ‼️ UnqualifiedQueryError: Not a valid UUID string /api/0/organizations/{organization_slug}/replay... View Issue

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

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.

None yet

2 participants