Skip to content

Commit c0987be

Browse files
committed
ref(github): Add CachedRepo TypedDict for cached repo shape
1 parent a594905 commit c0987be

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/sentry/integrations/github/client.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,10 +550,17 @@ def get_repos(self, page_number_limit: int | None = None) -> list[dict[str, Any]
550550
page_number_limit=page_number_limit,
551551
)
552552

553+
class CachedRepo(TypedDict):
554+
id: int
555+
name: str
556+
full_name: str
557+
default_branch: str | None
558+
archived: bool | None
559+
553560
# Fields from the GitHub API response needed by get_repositories().
554561
_CACHED_REPO_FIELDS = ("id", "name", "full_name", "default_branch", "archived")
555562

556-
def get_accessible_repos_cached(self, ttl: int = 300) -> list[dict[str, Any]]:
563+
def get_accessible_repos_cached(self, ttl: int = 300) -> list[CachedRepo]:
557564
"""
558565
Return all repos accessible to this installation.
559566
Cached in Django cache for ``ttl`` seconds so that debounced

0 commit comments

Comments
 (0)