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: fix typing in frontend debug views #76294

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

asottile-sentry
Copy link
Member

No description provided.

@asottile-sentry asottile-sentry requested review from a team August 15, 2024 20:57
@asottile-sentry asottile-sentry requested a review from a team as a code owner August 15, 2024 20:57
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 15, 2024
@@ -14,7 +15,7 @@ class DebugCodeOwnersAutoSyncFailureView(View):
def get(self, request: HttpRequest) -> HttpResponse:
org = Organization(id=1, slug="petal", name="Petal")
project = Project(id=1, slug="nodejs", name="Node.js", organization=org)
user = User(name="Nisanthan")
user = Actor.from_orm_user(User(name="Nisanthan"))
Copy link
Member

Choose a reason for hiding this comment

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

Was this broken before? I'm confused about how we could start passing an actor and have this still work

Copy link
Member Author

Choose a reason for hiding this comment

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

I suspect the type annotation here is incorrect (the underlying function it calls accepts User | Team | Actor) and that it works fine with any of them. but when I went to fix that annotation it exposed a variance issue due to the way the parameters are passed (it ~essentially has def f[U: User | Team | Actor](..., user: U, by_user: dict[U, ...] | None = ...): which I couldn't find a succinct way to make it sound for the other callers. so yeah this was the "easiest" way to fix it. the view itself only really cares about .id so they end up being equivalent

@asottile-sentry asottile-sentry enabled auto-merge (squash) August 15, 2024 21:17
@getsantry
Copy link
Contributor

getsantry bot commented Sep 6, 2024

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label Sep 6, 2024
Copy link

codecov bot commented Sep 6, 2024

Codecov Report

Attention: Patch coverage is 43.75000% with 9 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...sentry/web/frontend/debug/debug_mfa_added_email.py 33.33% 1 Missing and 1 partial ⚠️
...ntry/web/frontend/debug/debug_mfa_removed_email.py 33.33% 1 Missing and 1 partial ⚠️
.../debug/debug_codeowners_auto_sync_failure_email.py 50.00% 1 Missing ⚠️
...eb/frontend/debug/debug_incident_activity_email.py 50.00% 1 Missing ⚠️
...nd/debug/debug_organization_integration_request.py 50.00% 1 Missing ⚠️
...rontend/debug/debug_organization_invite_request.py 50.00% 1 Missing ⚠️
.../frontend/debug/debug_organization_join_request.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #76294   +/-   ##
=======================================
  Coverage   78.15%   78.16%           
=======================================
  Files        6912     6912           
  Lines      307213   307224   +11     
  Branches    50338    50340    +2     
=======================================
+ Hits       240114   240130   +16     
+ Misses      60700    60693    -7     
- Partials     6399     6401    +2     

@getsantry getsantry bot removed the Stale label Sep 7, 2024
@getsantry
Copy link
Contributor

getsantry bot commented Sep 29, 2024

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label Sep 29, 2024
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 Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants