Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 77982e9

Browse files
authored
Move trace annotation to correct fn (#1265)
1 parent defc6a5 commit 77982e9

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

graphql_api/actions/repository.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import logging
22
from typing import Any
33

4-
import sentry_sdk
54
from django.db.models import QuerySet
65
from shared.django_apps.codecov_auth.models import GithubAppInstallation, Owner
76
from shared.django_apps.core.models import Repository
@@ -54,7 +53,6 @@ def filter_queryset_by_ai_enabled_repos(queryset: QuerySet, owner: Owner) -> Que
5453
return queryset
5554

5655

57-
@sentry_sdk.trace
5856
def list_repository_for_owner(
5957
current_owner: Owner,
6058
owner: Owner,
@@ -72,16 +70,13 @@ def list_repository_for_owner(
7270
if exclude_okta_enforced_repos:
7371
queryset = queryset.exclude_accounts_enforced_okta(okta_account_auths)
7472

75-
if not ai_enabled_filter:
76-
queryset = (
77-
queryset.with_recent_coverage().with_latest_commit_at().filter(author=owner)
78-
)
79-
73+
queryset = (
74+
queryset.with_recent_coverage().with_latest_commit_at().filter(author=owner)
75+
)
8076
queryset = apply_filters_to_queryset(queryset, filters, owner)
8177
return queryset
8278

8379

84-
@sentry_sdk.trace
8580
def search_repos(
8681
current_owner: Owner,
8782
filters: dict[str, Any] | None,

graphql_api/types/me/me.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from typing import Optional
22

3+
import sentry_sdk
34
from ariadne import ObjectType
45
from asgiref.sync import sync_to_async
56
from graphql import GraphQLResolveInfo
@@ -41,6 +42,7 @@ def resolve_owner(user, _):
4142

4243

4344
@me_bindable.field("viewableRepositories")
45+
@sentry_sdk.trace
4446
def resolve_viewable_repositories(
4547
current_user,
4648
info: GraphQLResolveInfo,

graphql_api/types/owner/owner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656

5757
@owner_bindable.field("repositories")
5858
@sync_to_async
59+
@sentry_sdk.trace
5960
def resolve_repositories(
6061
owner: Owner,
6162
info: GraphQLResolveInfo,

0 commit comments

Comments
 (0)