Skip to content

Commit 3bdbe66

Browse files
wedamijageorge-sentry
authored andcommitted
feat(github-enterprise): Route installation_repositories to control silo (#112245)
Remove the should_route_to_control_silo override in GithubEnterpriseRequestParser so it inherits the parent's routing, which sends installation_repositories events to control silo. We do this to make sure the webhooks for GHE will also route to the right place <!-- Describe your PR here. -->
1 parent dcc1449 commit 3bdbe66

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/sentry/middleware/integrations/parsers/github_enterprise.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44
from collections.abc import Mapping
55
from typing import Any
66

7-
from django.http import HttpRequest
8-
97
from sentry.hybridcloud.outbox.category import WebhookProviderIdentifier
108
from sentry.integrations.github.webhook import get_github_external_id
11-
from sentry.integrations.github.webhook_types import GITHUB_WEBHOOK_TYPE_HEADER, GithubWebhookType
129
from sentry.integrations.github_enterprise.webhook import GitHubEnterpriseWebhookEndpoint, get_host
1310
from sentry.integrations.types import IntegrationProviderSlug
1411
from sentry.middleware.integrations.parsers.github import GithubRequestParser
@@ -21,13 +18,6 @@ class GithubEnterpriseRequestParser(GithubRequestParser):
2118
webhook_identifier = WebhookProviderIdentifier.GITHUB_ENTERPRISE
2219
webhook_endpoint = GitHubEnterpriseWebhookEndpoint
2320

24-
def should_route_to_control_silo(
25-
self, parsed_event: Mapping[str, Any], request: HttpRequest
26-
) -> bool:
27-
# GHE only routes installation events to control silo.
28-
# installation_repositories is not yet supported for GHE.
29-
return request.META.get(GITHUB_WEBHOOK_TYPE_HEADER) == GithubWebhookType.INSTALLATION
30-
3121
def _get_external_id(self, event: Mapping[str, Any]) -> str | None:
3222
host = get_host(request=self.request)
3323
if not host:

0 commit comments

Comments
 (0)