Skip to content

feat(cursor-origin): Route webhooks via Origin's headers - #124993

Open
wedamija wants to merge 1 commit into
masterfrom
danf/origin-webhook-routing
Open

wedamija wants to merge 1 commit into
masterfrom
danf/origin-webhook-routing

Conversation

@wedamija

Copy link
Copy Markdown
Member

Route webhooks using Origin's webhook-event-type and webhook-installation-id
headers instead of reading the unverified body. Installation events and pings go to
control, while other events go to the cells.

Unknown events return 202 and are counted without being queued. Event metrics are
limited to Origin's documented event types so arbitrary headers cannot create metric
series. Invalid or stale deliveries are rejected before looking up the integration or
writing to the queue.

Cell routing uses the hashed repository ID from the payload as the mailbox key.

Route webhooks using Origin's `webhook-event-type` and `webhook-installation-id`
headers instead of reading the unverified body. Installation events and pings go to
control, while other events go to the cells.

Unknown events return 202 and are counted without being queued. Event metrics are
limited to Origin's documented event types so arbitrary headers cannot create metric
series. Invalid or stale deliveries are rejected before looking up the integration or
writing to the queue.

Cell routing uses the hashed repository ID from the payload as the mailbox key.
@wedamija
wedamija requested a review from a team as a code owner September 18, 2026 23:01
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 18, 2026

@cursor cursor Bot left a comment

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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c3b5a2e. Configure here.

if integration is None:
return self.get_default_missing_integration_response()

cells = self.get_cells_from_organizations()

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.

Uncached integration lookup on cell path

Low Severity

get_response calls get_integration_from_request directly, then get_cells_from_organizations resolves the same integration again through integration_for_request. That memoized helper exists so each parser does one query and one decrypt of encrypted integration metadata; other parsers call it instead of the uncached override.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c3b5a2e. Configure 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.

1 participant