Skip to content

Commit fa748ef

Browse files
authored
feat(integrations): create redis keys using integration_id (#54655)
Adding integration id's to integration clients to be used to create redis keys for the `IntegrationRequestBuffer` used to detect and disable integrations for the [Notify on Disabled Integration project](https://www.notion.so/sentry/Tech-Spec-Notify-on-Disabled-Integration-Spec-e7ea0f86ccd6419cb3e564067cf4a2ef?pvs=4)
1 parent 9557731 commit fa748ef

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

src/sentry/integrations/bitbucket/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ def __init__(self, integration: RpcIntegration, org_integration_id: int | None =
6363
integration_id=integration.id, ctx_logger=logger
6464
)
6565
super().__init__(
66-
org_integration_id=org_integration_id, verify_ssl=True, logging_context=None
66+
integration_id=integration.id,
67+
org_integration_id=org_integration_id,
68+
verify_ssl=True,
69+
logging_context=None,
6770
)
6871

6972
@control_silo_function

src/sentry/integrations/bitbucket_server/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ class BitbucketServerSetupClient(ApiClient):
4040
authorize_url = "{}/plugins/servlet/oauth/authorize?oauth_token={}"
4141
integration_name = "bitbucket_server_setup"
4242

43-
def __init__(self, base_url, consumer_key, private_key, verify_ssl=True):
43+
def __init__(self, base_url, consumer_key, private_key, verify_ssl=True, *args, **kwargs):
44+
super().__init__(*args, **kwargs)
4445
self.base_url = base_url
4546
self.consumer_key = consumer_key
4647
self.private_key = private_key
@@ -118,6 +119,7 @@ def __init__(
118119
super().__init__(
119120
org_integration_id=org_integration_id,
120121
verify_ssl=integration.metadata["verify_ssl"],
122+
integration_id=integration.id,
121123
logging_context=None,
122124
)
123125

src/sentry/integrations/gitlab/client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ def __init__(self, installation: GitlabIntegration):
9292
self.refreshed_identity: RpcIdentity | None = None
9393
self.base_url = self.metadata["base_url"]
9494
org_integration_id = installation.org_integration.id
95-
super().__init__(org_integration_id=org_integration_id, verify_ssl=verify_ssl)
95+
super().__init__(
96+
integration_id=installation.model.id,
97+
org_integration_id=org_integration_id,
98+
verify_ssl=verify_ssl,
99+
)
96100

97101
@property
98102
def identity(self) -> RpcIdentity:

src/sentry/shared_integrations/client/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def record_response(self, response: Response):
383383
) = integration_service.get_organization_contexts(
384384
integration_id=self.integration_id
385385
)
386-
if rpc_integration.provider in ("github", "gitlab"):
386+
if rpc_integration.provider in ("github", "gitlab", "slack"):
387387
extra = {
388388
"integration_id": self.integration_id,
389389
"buffer_record": buffer._get_all_from_buffer(),

0 commit comments

Comments
 (0)