Skip to content

Seer pydantic models separation#108546

Draft
armenzg wants to merge 2 commits intomasterfrom
cursor/CW-838-seer-pydantic-models-separation-7113
Draft

Seer pydantic models separation#108546
armenzg wants to merge 2 commits intomasterfrom
cursor/CW-838-seer-pydantic-models-separation-7113

Conversation

@armenzg
Copy link
Member

@armenzg armenzg commented Feb 19, 2026

Separates Pydantic models for the overwatch-request endpoint to distinguish between PR code review requests and PR closed cases.

This change addresses CW-838 by:

  • Removing shared models (SeerCodeReviewBaseRequest, SeerCodeReviewRequest, SeerCodeReviewTaskRequest).
  • Utilizing specific models (SeerCodeReviewRequestForPrReview, SeerCodeReviewRequestForPrClosed, SeerCodeReviewTaskRequestForPrReview, SeerCodeReviewTaskRequestForPrClosed).

This ensures correct field validation, such as enforcing organization_id and integration_id as required for PR closed requests while keeping them optional for PR review requests, aligning with business logic for metrics and dashboarding.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.


Linear Issue: CW-838

Open in Cursor Open in Web

The overwatch-request endpoint handles both PR code review requests and PR closed cases.
This commit removes the old shared pydantic models (SeerCodeReviewBaseRequest,
SeerCodeReviewRequest, and SeerCodeReviewTaskRequest) in favor of specific models
for each use case:

- SeerCodeReviewRequestForPrReview / SeerCodeReviewTaskRequestForPrReview
- SeerCodeReviewRequestForPrClosed / SeerCodeReviewTaskRequestForPrClosed

This separation ensures proper validation of required fields (e.g., organization_id
and integration_id are required for PR closed but optional for PR review).

Also updated docstrings to reflect the current model names and remove references
to old shared models.

Fixes CW-838

Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com>
@cursor
Copy link
Contributor

cursor bot commented Feb 19, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@linear
Copy link

linear bot commented Feb 19, 2026

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 19, 2026
Copy link
Contributor

@cursor cursor bot left a comment

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.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

# =============================================================================


class SeerCodeReviewBaseRequest(BaseModel):
Copy link
Contributor

Choose a reason for hiding this comment

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

Unused import after removing its only consumer

Low Severity

The SeerRepoDefinition import from sentry.seer.models is now unused. It was previously consumed by the removed SeerCodeReviewBaseRequest class (which used it as the type for repo and more_readable_repos). After this PR removes that class, the only remaining reference is inside a comment string on line 79. This is dead code left behind by the model cleanup.

Fix in Cursor Fix in Web

- Remove unused SeerRepoDefinition import (identified by Bugbot)
- Fix whitespace in docstring (ruff W293)

Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com>
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

Comments