Skip to content

feat(repos): Activate repo webhook and syncing task for GHE#112247

Merged
wedamija merged 1 commit intomasterfrom
danf/ghe-repo-sync
Apr 7, 2026
Merged

feat(repos): Activate repo webhook and syncing task for GHE#112247
wedamija merged 1 commit intomasterfrom
danf/ghe-repo-sync

Conversation

@wedamija
Copy link
Copy Markdown
Member

@wedamija wedamija commented Apr 3, 2026

This enables the same github syncing for GHE

@wedamija wedamija requested review from a team as code owners April 3, 2026 23:38
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 3, 2026
Comment on lines 355 to 361
"push": GitHubEnterprisePushEventWebhook,
"pull_request": GitHubEnterprisePullRequestEventWebhook,
"installation": GitHubEnterpriseInstallationEventWebhook,
"installation_repositories": GitHubEnterpriseInstallationRepositoriesEventWebhook,
"issues": GitHubEnterpriseIssuesEventWebhook,
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The GitHubEnterpriseWebhookEndpoint uses @cell_silo_endpoint, but middleware routes installation_repositories events to the CONTROL silo, causing a routing conflict and request failure.
Severity: HIGH

Suggested Fix

Change the decorator on GitHubEnterpriseWebhookEndpoint from @cell_silo_endpoint to @all_silo_endpoint. This will allow the endpoint to execute in both CELL and CONTROL silos, resolving the conflict with the middleware's routing logic for control-only events.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/sentry/integrations/github_enterprise/webhook.py#L355-L361

Potential issue: There is a silo routing conflict for the GitHub Enterprise
`installation_repositories` webhook event. The middleware correctly identifies this
event as control-silo-only and routes the request to the CONTROL silo. However, the
`GitHubEnterpriseWebhookEndpoint` is decorated with `@cell_silo_endpoint`, which
enforces that it can only run in the CELL silo. When the request is dispatched in
CONTROL silo mode, the decorator will reject it, resulting in a 404 error or an
`AvailabilityError`. This will cause webhook deliveries for repository updates to fail,
preventing repository data from being synchronized.

Did we get this right? 👍 / 👎 to inform future reviews.

@wedamija wedamija requested review from a team as code owners April 6, 2026 17:55
Base automatically changed from danf/ghe-routing to master April 6, 2026 21:33
@wedamija wedamija changed the base branch from master to danf/repo-sync-audit-logs April 7, 2026 16:50
@wedamija wedamija force-pushed the danf/ghe-repo-sync branch from 4221d01 to cf95da8 Compare April 7, 2026 16:50
Base automatically changed from danf/repo-sync-audit-logs to master April 7, 2026 16:59
This enables the same github syncing for GHE
@wedamija wedamija merged commit 5357aef into master Apr 7, 2026
59 checks passed
@wedamija wedamija deleted the danf/ghe-repo-sync branch April 7, 2026 22:02
george-sentry pushed a commit that referenced this pull request Apr 9, 2026
This enables the same github syncing for GHE

<!-- Describe your PR here. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants