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

chore(sentryapps): better logging and errors for select requester #79377

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Christinarlong
Copy link
Contributor

@Christinarlong Christinarlong commented Oct 18, 2024

Ok more like let's differentiate between when we fail due to external requests failing or due to validation errors

@Christinarlong Christinarlong marked this pull request as ready for review October 18, 2024 19:57
@Christinarlong Christinarlong requested a review from a team October 18, 2024 19:57
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 18, 2024
@Christinarlong Christinarlong enabled auto-merge (squash) October 18, 2024 19:57
},
)
raise
Copy link
Member

Choose a reason for hiding this comment

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

now that we aren't swallowing this exception, do we gracefully handle it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good pt, I just added a distinction to check now, if we get ApiError -> we return a message about validation failure and if the request to the webhook goes wrong we return a somewhat generic message and log the error.

https://github.com/getsentry/sentry/pull/79377/files#diff-7e1a5ec942c78dda796710a42c8a675441de74e2bdfa4653344b6fd711e73dcfR40-R51

Copy link

codecov bot commented Oct 19, 2024

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
22013 2 22011 218
View the top 2 failed tests by shortest run time
tests.sentry.api.endpoints.test_project_rule_details.ProjectRuleDetailsTest test_with_unresponsive_sentryapp
Stack Traces | 8.6s run time
#x1B[1m#x1B[.../api/endpoints/test_project_rule_details.py#x1B[0m:374: in test_with_unresponsive_sentryapp
    response = self.get_success_response(
#x1B[1m#x1B[.../sentry/testutils/cases.py#x1B[0m:759: in get_success_response
    assert_status_code(response, status_code)
#x1B[1m#x1B[.../sentry/testutils/asserts.py#x1B[0m:39: in assert_status_code
    assert minimum <= response.status_code < maximum, (
#x1B[1m#x1B[31mE   AssertionError: (500, b'{"detail":"Internal Error","errorId":null}')#x1B[0m
#x1B[1m#x1B[31mE   assert 500 < 201#x1B[0m
#x1B[1m#x1B[31mE    +  where 500 = <Response status_code=500, "application/json">.status_code#x1B[0m
tests.sentry.incidents.endpoints.test_organization_alert_rule_details.AlertRuleDetailsGetEndpointTest test_with_unresponsive_sentryapp
Stack Traces | 8.61s run time
#x1B[1m#x1B[.../incidents/endpoints/test_organization_alert_rule_details.py#x1B[0m:575: in test_with_unresponsive_sentryapp
    assert resp.status_code == 200
#x1B[1m#x1B[31mE   assert 500 == 200#x1B[0m
#x1B[1m#x1B[31mE    +  where 500 = <Response status_code=500, "application/json">.status_code#x1B[0m

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

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.

2 participants