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): Sentry-16D3 - Issue accessing the project on a query subscription #70835

Merged
merged 1 commit into from
May 14, 2024

Conversation

saponifi3d
Copy link
Contributor

@saponifi3d saponifi3d commented May 14, 2024

Description

Error report: https://sentry.sentry.io/issues/4527458007/?project=1

Looks like this was missed after we migrated from projects being stored on the alert_rule. This can now be removed because all projects should exist at the alert_rule level.

@saponifi3d saponifi3d requested a review from a team as a code owner May 14, 2024 01:33
@saponifi3d saponifi3d requested a review from nhsiehgit May 14, 2024 01:33
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label May 14, 2024
Copy link

codecov bot commented May 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.00%. Comparing base (6ba3e18) to head (a89f1b9).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #70835      +/-   ##
==========================================
+ Coverage   79.02%   80.00%   +0.98%     
==========================================
  Files        6507     6507              
  Lines      290838   290838              
  Branches    50126    50125       -1     
==========================================
+ Hits       229844   232695    +2851     
+ Misses      60558    57707    -2851     
  Partials      436      436              
Files Coverage Δ
...dents/endpoints/organization_alert_rule_details.py 97.08% <ø> (+0.67%) ⬆️

... and 235 files with indirect coverage changes

@ceorourke
Copy link
Member

What does it mean if there is no project? The sentry issue existed because that happened, is it ok to just pass when it's not found?

@saponifi3d
Copy link
Contributor Author

saponifi3d commented May 14, 2024

What does it mean if there is no project? The sentry issue existed because that happened, is it ok to just pass when it's not found?

If there's not a project associated with an alert, then the check for if the user has access to None project which will fail, and the user will be shown an error message related to that.

Previously, the failure was happening because the alert rule's snuba query was trying to access a subscription that didn't exist on an activated alert. This happens with activated alerts because they delay creating a snuba subscription until the activation event occurs. By removing the change to lookup the project id from the subscription and directly looking at the alert, we can avoid looking at subscriptions that may not exist yet.

@saponifi3d saponifi3d merged commit cebe865 into master May 14, 2024
51 checks passed
@saponifi3d saponifi3d deleted the jcallender/fix-sentry-16D3 branch May 14, 2024 20:37
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

4 participants