Skip to content

feat(cursor-origin): Track pull requests - #125143

Merged
wedamija merged 3 commits into
masterfrom
danf/origin-track-pull-requests
Sep 22, 2026
Merged

wedamija merged 3 commits into
masterfrom
danf/origin-track-pull-requests

Conversation

@wedamija

Copy link
Copy Markdown
Member

Handle Origin's pull request lifecycle events and upsert PullRequest through
update_pull_request_from_scm_snapshot, shared with GitHub and GitLab. Since each event
includes the full pull request, the same handler covers creation, reopening, closing,
merging, and metadata updates.

Origin's pull request IDs are prefixed strings, while PullRequest.external_id is an
integer, so the ID is not stored.

Move commit author creation into a shared helper so pushes and pull requests use the
same email limit.

@wedamija
wedamija requested a review from a team as a code owner September 21, 2026 22:38
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 21, 2026
Base automatically changed from danf/origin-repo-metadata to master September 21, 2026 22:59
Handle Origin's pull request lifecycle events and upsert `PullRequest` through
`update_pull_request_from_scm_snapshot`, shared with GitHub and GitLab. Since each event
includes the full pull request, the same handler covers creation, reopening, closing,
merging, and metadata updates.

Origin's pull request IDs are prefixed strings, while `PullRequest.external_id` is an
integer, so the ID is not stored.

Move commit author creation into a shared helper so pushes and pull requests use the
same email limit.
@wedamija
wedamija force-pushed the danf/origin-track-pull-requests branch from cd04418 to 2936391 Compare September 21, 2026 23:16
Comment thread src/sentry/integrations/cursor_origin/webhook_types.py
display_name: str = Field(default="", alias="displayName")


class PullRequestAuthor(OriginModel):

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.

Is there a way to detect if it's a user, app or service account? Like a "type" field or something?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There's no type field explicitly, but the response does have author.user, author.app, author.serviceAccount to differentiate.

Modifying this to include these options in the author too

@wedamija
wedamija requested a review from a team as a code owner September 22, 2026 17:52
Comment thread src/sentry/integrations/cursor_origin/webhook_types.py
@wedamija
wedamija merged commit 37cf5ca into master Sep 22, 2026
58 checks passed
@wedamija
wedamija deleted the danf/origin-track-pull-requests branch September 22, 2026 18:16
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