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

Commit 8158f06

Browse files
Test commit
1 parent fa372bf commit 8158f06

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

graphql_api/types/owner/owner.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,12 @@ def resolve_ai_features_enabled(owner: Owner, info: GraphQLResolveInfo) -> bool:
363363
@sync_to_async
364364
@require_part_of_org
365365
def resolve_ai_enabled_repos(
366-
owner: Owner, info: GraphQLResolveInfo
367-
) -> List[str] | None:
366+
owner: Owner,
367+
info: GraphQLResolveInfo,
368+
ordering: Optional[RepositoryOrdering] = RepositoryOrdering.ID,
369+
ordering_direction: Optional[OrderingDirection] = OrderingDirection.ASC,
370+
**kwargs: Any,
371+
) -> Coroutine[Any, Any, Connection]:
368372
ai_features_app_install = GithubAppInstallation.objects.filter(
369373
app_id=AI_FEATURES_GH_APP_ID, owner=owner
370374
).first()
@@ -375,12 +379,17 @@ def resolve_ai_enabled_repos(
375379
current_owner = info.context["request"].current_owner
376380
queryset = Repository.objects.filter(author=owner).viewable_repos(current_owner)
377381

378-
if ai_features_app_install.repository_service_ids:
379-
queryset = queryset.filter(
380-
service_id__in=ai_features_app_install.repository_service_ids
381-
)
382+
# if ai_features_app_install.repository_service_ids:
383+
# queryset = queryset.filter(
384+
# service_id__in=ai_features_app_install.repository_service_ids
385+
# )
382386

383-
return list(queryset.values_list("name", flat=True))
387+
return queryset_to_connection(
388+
queryset,
389+
ordering=(ordering, RepositoryOrdering.ID),
390+
ordering_direction=ordering_direction,
391+
**kwargs,
392+
)
384393

385394

386395
@owner_bindable.field("uploadTokenRequired")

utils/test_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ def app(self) -> str:
4545
migrate_to = None
4646

4747
def setUp(self) -> None:
48-
assert self.migrate_from and self.migrate_to, (
49-
"TestCase '{}' must define migrate_from and migrate_to properties".format(
50-
type(self).__name__
51-
)
48+
assert (
49+
self.migrate_from and self.migrate_to
50+
), "TestCase '{}' must define migrate_from and migrate_to properties".format(
51+
type(self).__name__
5252
)
5353
self.migrate_from = [(self.app, self.migrate_from)]
5454
self.migrate_to = [(self.app, self.migrate_to)]

0 commit comments

Comments
 (0)