Skip to content

Commit 56be708

Browse files
committed
chore(integrations): Fix repo sync to pass installation id consistently
Required to get #112519 working for all scms. integration_id and installation are the same, but different scms use them. I don't want to refactor how the scms work, so just providing both.
1 parent 95097c5 commit 56be708

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/sentry/integrations/github/tasks/link_all_repos.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def get_repo_config(repo: Mapping[str, Any], integration_id: int) -> RepositoryI
2828
return {
2929
"external_id": str(repo["id"]),
3030
"integration_id": integration_id,
31+
"installation": integration_id,
3132
"identifier": repo["full_name"],
3233
}
3334

src/sentry/integrations/source_code_management/sync_repos.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ def sync_repos_for_org(organization_integration_id: int) -> None:
207207
{
208208
"external_id": repo["external_id"],
209209
"integration_id": integration.id,
210+
"installation": integration.id,
210211
"identifier": str(repo["identifier"]),
211212
}
212213
for repo in provider_repos

src/sentry/plugins/providers/integration_repository.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import logging
44
from collections.abc import Mapping
55
from datetime import timezone
6-
from typing import Any, ClassVar, Generic, NotRequired, TypedDict, TypeVar, cast
6+
from typing import Any, ClassVar, Generic, TypedDict, TypeVar, cast
77

88
from dateutil.parser import parse as parse_date
99
from rest_framework import status
@@ -37,7 +37,7 @@ class RepositoryInputConfig(TypedDict):
3737
external_id: str
3838
integration_id: int
3939
identifier: str
40-
installation: NotRequired[str]
40+
installation: int
4141

4242

4343
class RepositoryConfig(TypedDict):

0 commit comments

Comments
 (0)