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(sentry_apps): Move over installation endpoints to sentry_apps #77869

Merged

Conversation

Christinarlong
Copy link
Contributor

migrate SentryAppInstallation related endpoints to sentry_apps!
[X] endpoints
[X] tests
[x] typing - 1 line
[] getsentry shim - N/A

issue ref(#73857)

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 20, 2024
Copy link

codecov bot commented Sep 20, 2024

❌ 8 Tests Failed:

Tests completed Failed Passed Skipped
21632 8 21624 205
View the top 3 failed tests by shortest run time
tests.sentry.sentry_apps.api.endpoints.test_organization_sentry_app_installations.PostSentryAppInstallationsTest test_install_published_app
Stack Traces | 11.4s run time
#x1B[1m#x1B[.../api/endpoints/test_organization_sentry_app_installations.py#x1B[0m:133: in test_install_published_app
    response = self.get_success_response(self.org.slug, slug=app.slug, status_code=200)
#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.sentry_apps.api.endpoints.test_organization_sentry_app_installations.PostSentryAppInstallationsTest test_install_superuser
Stack Traces | 11.5s run time
#x1B[1m#x1B[.../api/endpoints/test_organization_sentry_app_installations.py#x1B[0m:153: in test_install_superuser
    self.get_success_response(self.org.slug, slug=app.slug, status_code=200)
#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.sentry_apps.api.endpoints.test_organization_sentry_app_installations.PostSentryAppInstallationsTest test_install_twice
Stack Traces | 11.6s run time
#x1B[1m#x1B[.../api/endpoints/test_organization_sentry_app_installations.py#x1B[0m:194: in test_install_twice
    self.get_success_response(self.org.slug, slug=app.slug, status_code=200)
#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

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

Comment on lines 95 to 97
assert isinstance(request.user, User) or isinstance(
request.user, RpcUser
), "user must be authenticated to create a SentryAppInstallation"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

is this typing too narrow? -> are there other types of users (RpcUser, User, AnonymousUser)? Is it even true that being authenticated == being a User/RpcUser.

Copy link
Member

Choose a reason for hiding this comment

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

are there other types of users (RpcUser, User, AnonymousUser)?

No, those are all the type options for request.user

Is it even true that being authenticated == being a User/RpcUser.

Yes, if a request is not authenticated request.user will be AnonymousUser.

Comment on lines 95 to 97
assert isinstance(request.user, User) or isinstance(
request.user, RpcUser
), "user must be authenticated to create a SentryAppInstallation"
Copy link
Member

Choose a reason for hiding this comment

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

are there other types of users (RpcUser, User, AnonymousUser)?

No, those are all the type options for request.user

Is it even true that being authenticated == being a User/RpcUser.

Yes, if a request is not authenticated request.user will be AnonymousUser.

@Christinarlong Christinarlong marked this pull request as ready for review September 23, 2024 16:49
@Christinarlong Christinarlong requested review from a team as code owners September 23, 2024 16:49
@Christinarlong Christinarlong merged commit 9c780e5 into master Sep 23, 2024
49 checks passed
@Christinarlong Christinarlong deleted the christinarlong/move-sentryapps-endpoints-installation branch September 23, 2024 17:07
@github-actions github-actions bot locked and limited conversation to collaborators Oct 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.

2 participants