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 types for sentry.api.permissions #86228

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

asottile-sentry
Copy link
Member

No description provided.

@asottile-sentry asottile-sentry requested review from a team March 3, 2025 20:27
@asottile-sentry asottile-sentry requested review from a team as code owners March 3, 2025 20:27
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 3, 2025
@@ -276,6 +227,56 @@ def determine_access(
raise MemberDisabledOverLimit(organization)


class StaffPermissionMixin(SentryPermission):
Copy link
Member Author

Choose a reason for hiding this comment

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

the class was moved down so I could change this line to inherit from SentryPermission -- the mixin is still somewhat unsound but at least it can enforce signatures correctly (and validate super()) after this

Copy link

codecov bot commented Mar 3, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
23790 1 23789 290
View the top 1 failed test(s) by shortest run time
tests.sentry.api.test_permissions.DemoSafePermissionsTest::test_determine_access
Stack Traces | 2.16s run time
#x1B[1m#x1B[.../sentry/api/test_permissions.py#x1B[0m:166: in test_determine_access
    assert readonly_rpc_context.member.scopes == READONLY_SCOPES
#x1B[1m#x1B[31mE   AssertionError: assert ['alerts:read...eleases', ...] == frozenset({'a...leases', ...})#x1B[0m
#x1B[1m#x1B[31mE     #x1B[0m
#x1B[1m#x1B[31mE     Full diff:#x1B[0m
#x1B[1m#x1B[31mE     - frozenset({#x1B[0m
#x1B[1m#x1B[31mE     + [#x1B[0m
#x1B[1m#x1B[31mE           'alerts:read',#x1B[0m
#x1B[1m#x1B[31mE           'event:read',#x1B[0m
#x1B[1m#x1B[31mE           'member:read',#x1B[0m
#x1B[1m#x1B[31mE           'org:read',#x1B[0m
#x1B[1m#x1B[31mE           'project:read',#x1B[0m
#x1B[1m#x1B[31mE           'project:releases',#x1B[0m
#x1B[1m#x1B[31mE           'team:read',#x1B[0m
#x1B[1m#x1B[31mE     - })#x1B[0m
#x1B[1m#x1B[31mE     + ]#x1B[0m

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@asottile-sentry asottile-sentry force-pushed the asottile-sentry-api-permissions branch from 2c06cfa to 785a120 Compare March 3, 2025 22:35
@asottile-sentry asottile-sentry merged commit df38cdd into master Mar 4, 2025
48 checks passed
@asottile-sentry asottile-sentry deleted the asottile-sentry-api-permissions branch March 4, 2025 13:49
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