Skip to content

ref(seer): Type 10 issue/event/agent/PR seer RPC responses#117876

Merged
azulus merged 2 commits into
masterfrom
jeremy/seer-rpc-type-issue-event-details
Jun 17, 2026
Merged

ref(seer): Type 10 issue/event/agent/PR seer RPC responses#117876
azulus merged 2 commits into
masterfrom
jeremy/seer-rpc-type-issue-event-details

Conversation

@azulus

@azulus azulus commented Jun 16, 2026

Copy link
Copy Markdown
Member

Replaces the dict[str, Any] return annotations on the following seer RPC methods with explicit Pydantic models so the seer-side SDK consumer sees declared field shapes:

  • get_issue_detailsIssueDetailsResponse | None
  • get_event_detailsEventDetailsResponse | None
  • get_issue_and_event_details_v2IssueAndEventDetailsResponse | None — single model whose issue-side fields use exclude_unset so they're absent from the wire when include_issue=False or the group lookup failed (matches the pre-typed conditional spread)
  • get_transactions_for_projectTransactionsForProjectResponse
  • get_trace_for_transactionTraceData | EmptyResponse
  • get_profiles_for_traceTraceProfiles | EmptyResponse
  • get_issues_for_transactionTransactionIssues | EmptyResponse — the four project-scoped RPC wrappers above already built the response by calling .dict() on existing Pydantic models, so they just return the model directly now and use EmptyResponse for the {} not-found case
  • bulk_get_project_preferencesBulkProjectPreferencesResponse — bare {project_id_str: pref_dict} map via __root__ passthrough
  • record_pr_attributionPrAttributionResponse
  • update_pr_metricsUpdatePrMetricsSuccessResponse | UpdatePrMetricsErrorResponse discriminated by success: Literal[True|False]

Wire-identical across all paths. The response models that need to be read like dicts by seer or existing test sites carry a small _DictProxyMixin (__getitem__/__contains__/.get) so the typed return doesn't force a rewrite of every consumer in the same change.

Replaces the `dict[str, Any]` return annotations on the following seer RPC
methods with explicit Pydantic models so the seer-side SDK consumer sees
declared field shapes:

- `get_issue_details` → `IssueDetailsResponse | None`
- `get_event_details` → `EventDetailsResponse | None`
- `get_issue_and_event_details_v2` → `IssueAndEventDetailsResponse | None`
  (single model whose issue-side fields use `exclude_unset` so they're
  absent from the wire when `include_issue=False` or the group lookup
  failed — matches the pre-typed conditional spread)
- `get_transactions_for_project` → `TransactionsForProjectResponse`
- `get_trace_for_transaction` → `TraceData | EmptyResponse`
- `get_profiles_for_trace` → `TraceProfiles | EmptyResponse`
- `get_issues_for_transaction` → `TransactionIssues | EmptyResponse`
  (the four project-scoped RPC wrappers above already built the response
  by calling `.dict()` on existing Pydantic models — just return them
  directly and use `EmptyResponse` for the `{}` not-found case)
- `bulk_get_project_preferences` → `BulkProjectPreferencesResponse`
  (bare `{project_id_str: pref_dict}` map via `__root__` passthrough)
- `record_pr_attribution` → `PrAttributionResponse`
- `update_pr_metrics` → `UpdatePrMetricsSuccessResponse | UpdatePrMetricsErrorResponse`
  (discriminated by `success: Literal[True|False]`)

Wire-identical across all paths. The response models that need to be
read like dicts by seer or existing test sites carry a small `_DictProxyMixin`
(`__getitem__`/`__contains__`/`.get`) so the typed return doesn't force
a rewrite of every consumer in the same change.
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 16, 2026
@azulus azulus marked this pull request as ready for review June 16, 2026 23:57
@azulus azulus requested a review from a team as a code owner June 16, 2026 23:57
Comment thread src/sentry/seer/sentry_data_models.py Outdated
The `dict()` override discarded its `**kwargs`, so options like
`exclude_unset` from any future caller (or framework upgrade) would
silently do nothing. Route through `super().dict(**kwargs)` and unwrap
the `__root__` envelope so the bare-map wire shape stays the same.
@azulus azulus merged commit 2263cdf into master Jun 17, 2026
65 checks passed
@azulus azulus deleted the jeremy/seer-rpc-type-issue-event-details branch June 17, 2026 16:17
billyvg pushed a commit that referenced this pull request Jun 17, 2026
Replaces the `dict[str, Any]` return annotations on the following seer
RPC methods with explicit Pydantic models so the seer-side SDK consumer
sees declared field shapes:

- `get_issue_details` → `IssueDetailsResponse | None`
- `get_event_details` → `EventDetailsResponse | None`
- `get_issue_and_event_details_v2` → `IssueAndEventDetailsResponse |
None` — single model whose issue-side fields use `exclude_unset` so
they're absent from the wire when `include_issue=False` or the group
lookup failed (matches the pre-typed conditional spread)
- `get_transactions_for_project` → `TransactionsForProjectResponse`
- `get_trace_for_transaction` → `TraceData | EmptyResponse`
- `get_profiles_for_trace` → `TraceProfiles | EmptyResponse`
- `get_issues_for_transaction` → `TransactionIssues | EmptyResponse` —
the four project-scoped RPC wrappers above already built the response by
calling `.dict()` on existing Pydantic models, so they just return the
model directly now and use `EmptyResponse` for the `{}` not-found case
- `bulk_get_project_preferences` → `BulkProjectPreferencesResponse` —
bare `{project_id_str: pref_dict}` map via `__root__` passthrough
- `record_pr_attribution` → `PrAttributionResponse`
- `update_pr_metrics` → `UpdatePrMetricsSuccessResponse |
UpdatePrMetricsErrorResponse` discriminated by `success:
Literal[True|False]`

Wire-identical across all paths. The response models that need to be
read like dicts by seer or existing test sites carry a small
`_DictProxyMixin` (`__getitem__`/`__contains__`/`.get`) so the typed
return doesn't force a rewrite of every consumer in the same change.
sehr-m pushed a commit that referenced this pull request Jun 23, 2026
Replaces the `dict[str, Any]` return annotations on the following seer
RPC methods with explicit Pydantic models so the seer-side SDK consumer
sees declared field shapes:

- `get_issue_details` → `IssueDetailsResponse | None`
- `get_event_details` → `EventDetailsResponse | None`
- `get_issue_and_event_details_v2` → `IssueAndEventDetailsResponse |
None` — single model whose issue-side fields use `exclude_unset` so
they're absent from the wire when `include_issue=False` or the group
lookup failed (matches the pre-typed conditional spread)
- `get_transactions_for_project` → `TransactionsForProjectResponse`
- `get_trace_for_transaction` → `TraceData | EmptyResponse`
- `get_profiles_for_trace` → `TraceProfiles | EmptyResponse`
- `get_issues_for_transaction` → `TransactionIssues | EmptyResponse` —
the four project-scoped RPC wrappers above already built the response by
calling `.dict()` on existing Pydantic models, so they just return the
model directly now and use `EmptyResponse` for the `{}` not-found case
- `bulk_get_project_preferences` → `BulkProjectPreferencesResponse` —
bare `{project_id_str: pref_dict}` map via `__root__` passthrough
- `record_pr_attribution` → `PrAttributionResponse`
- `update_pr_metrics` → `UpdatePrMetricsSuccessResponse |
UpdatePrMetricsErrorResponse` discriminated by `success:
Literal[True|False]`

Wire-identical across all paths. The response models that need to be
read like dicts by seer or existing test sites carry a small
`_DictProxyMixin` (`__getitem__`/`__contains__`/`.get`) so the typed
return doesn't force a rewrite of every consumer in the same change.
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