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

ref(sentry_apps): Rename apps.py and shim for getsentry #77614

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

Christinarlong
Copy link
Contributor

We need to rename apps.py so django doesn't confuse it for an AppConfig file when we later add sentry_apps to INSTALLED APPS. However, apps.py is also used in getsentry so we'll need to create a shim so that refs don't break.

ref(#73857)

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

Choose a reason for hiding this comment

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

Shim

def run(
self,
*,
user: User,
Copy link
Contributor Author

@Christinarlong Christinarlong Sep 17, 2024

Choose a reason for hiding this comment

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

This was changed from User | RpcUser to just User. Though I wasn't 100% on this one. Like SentryApp creation and updating all happens in the CS so can we assume all 'users' won't be RpcUsers ?

Copy link
Member

Choose a reason for hiding this comment

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

Like SentryApp creation and updating all happens in the CS so can we assume all 'users' won't be RpcUsers ?

We can likely use the narrower type. The RpcUser could show up in a future refactoring, but we can deal with that then.

Copy link

codecov bot commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 98.83721% with 3 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/sentry_apps/logic.py 98.78% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #77614   +/-   ##
=======================================
  Coverage   78.11%   78.11%           
=======================================
  Files        6967     6967           
  Lines      309330   309330           
  Branches    50647    50647           
=======================================
+ Hits       241636   241640    +4     
- Misses      61292    61294    +2     
+ Partials     6402     6396    -6     

from sentry.shared_integrations.exceptions import ApiError, IntegrationError
from sentry.users.models.user import User
from sentry.utils.http import absolute_uri

from ...sentry_apps.apps import SentryAppCreator
Copy link
Member

Choose a reason for hiding this comment

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

🙇 Thanks for fixing this relative import.

def run(
self,
*,
user: User,
Copy link
Member

Choose a reason for hiding this comment

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

Like SentryApp creation and updating all happens in the CS so can we assume all 'users' won't be RpcUsers ?

We can likely use the narrower type. The RpcUser could show up in a future refactoring, but we can deal with that then.

@Christinarlong Christinarlong marked this pull request as ready for review September 17, 2024 17:00
@Christinarlong Christinarlong requested review from a team as code owners September 17, 2024 17:00
@Christinarlong Christinarlong merged commit 825d60c into master Sep 17, 2024
50 checks passed
@Christinarlong Christinarlong deleted the christinarlong/fix-apps-naming branch September 17, 2024 17:01
@github-actions github-actions bot locked and limited conversation to collaborators Oct 3, 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