ref(seer-rpc): type seven RPC method returns with Pydantic#117712
Merged
Conversation
Phase 1.1 of `type-seer-rpc-coverage`. Seven Seer RPC methods get typed Pydantic response models in `sentry_data_models.py`: - `get_organization_slug` -> `OrganizationSlugResponse` - `get_organization_project_ids` -> `OrganizationProjectIdsResponse` - `get_organization_features` -> `OrganizationFeaturesResponse` - `get_organization_autofix_consent` -> `OrganizationAutofixConsentResponse` - `get_github_enterprise_integration_config` -> `GitHubEnterpriseConfigSuccessResponse | GitHubEnterpriseConfigErrorResponse` - `send_seer_webhook` -> `SendSeerWebhookSuccessResponse | SendSeerWebhookErrorResponse` - `check_repository_integrations_status` -> `RepositoryIntegrationsStatusResponse` Both dispatchers (internal HMAC `SeerRpcCallEndpoint._dispatch_to_local_method` and public bearer-token `OrganizationSeerRpcEndpoint._dispatch_to_local_method`) now convert `BaseModel` returns to dict via `.dict()` before DRF's JSONRenderer sees them. Wire-no-op: each model's `.dict()` produces byte-identical JSON to the prior bare-dict return. Audit goes 2 -> 9 / 58 typed.
Test was using `result["projects"]` / `"projects" in result` against the RPC method's return; with the typed Pydantic shape it accesses `result.projects` directly.
gricha
approved these changes
Jun 15, 2026
Contributor
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 7f6f700. Configure here.
Pydantic v1 BaseModel.__eq__ supports comparison with plain dicts; v2
returns NotImplemented and the assertion fails. The bare `result == {...}`
pattern works today but breaks loudly on any pydantic v2 upgrade. Pre-empt
the migration by calling `.dict()` explicitly — works in both versions
and preserves the wire-no-op byte-shape assertion that's the whole point
of these checks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Type seven Seer RPC method returns with Pydantic response models in
sentry_data_models.py. These methods previously returned baredict, leaving response shapes undocumented and unverified by mypy.Both dispatchers (
SeerRpcCallEndpoint._dispatch_to_local_methodandOrganizationSeerRpcEndpoint._dispatch_to_local_method) gain aBaseModel → .dict()adapter so registered functions can return Pydantic models directly. Wire-no-op: each model's.dict()produces byte-identical JSON to the prior bare-dict return.