Skip to content

[pull] master from getsentry:master#2009

Merged
pull[bot] merged 7 commits into
KingDEV95:masterfrom
getsentry:master
May 29, 2026
Merged

[pull] master from getsentry:master#2009
pull[bot] merged 7 commits into
KingDEV95:masterfrom
getsentry:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 29, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

kcons and others added 7 commits May 28, 2026 22:04
…116441)

This query was already a pure index scan, but Postgres doesn't utilize
the ordered index to avoid examining all entries for a detector, so it's
still very expensive for detectors with lots of Groups.

By switching to a correlated subquery (which we already do in the
primary query ordering) it reduces to one index probe per detector.
For a test query on 3 major detectors in Sentry, we see a 99.985%
reduction in pages touched.
…nsolidation` (#116438)

Removes the stale `organizations:seer-agent-pr-consolidation` feature
flag.


---
_Generated by [Claude
Code](https://claude.ai/code/session_01XcDoaRsnBiJaLHEPf8Mk3g)_
First wave of opting endpoints into `Response[T]` after the foundation
landed in #116335.

For every endpoint method whose `@extend_schema(responses={2xx:
inline_sentry_response_serializer("X", T)})` schema is now also
reflected in the return annotation `-> Response[T]`, mypy strictly
checks the body shape at every `Response(...)` construction site, and
the structural linter enforces decorator-T == annotation-T.

**How this set was chosen**

Automated try-and-revert: every endpoint method with an
`inline_sentry_response_serializer` schema and a bare `-> Response`
annotation (76 total) had its annotation rewritten to `-> Response[T]`.
Mypy was then re-run; files that errored were reverted. These 43 methods
are the survivors.

**Why the other 33 reverted**

Recognizable patterns that need follow-up work, not blockers for this
batch:

- Error early-returns with `{"detail": "..."}` bodies that don't match
the success TypedDict shape (e.g. `organization_eventid`, several
`preprod_*` snapshot endpoints). Either the error path should `raise
APIException` instead of returning a dict, or a discriminated-union
return type is needed.
- `T=list[X]` schemas where the actual body wraps the list in a dict
(`{"data": [...]}`) — schema/body shape mismatch that the new check now
surfaces. Latent issue, separate fix.
- `Response(self.paginate(...))` patterns where `paginate` returns
`Any`, triggering the new mypy plugin's body-Any hard-error. Closing
those needs typed pagination return values.

**No runtime behavior change**

Each method's only diff is the return annotation. Body construction is
unchanged, OpenAPI emission via `@extend_schema` is unchanged.

Co-authored-by: Claude <noreply@anthropic.com>
…tegration details POST endpoint (#116447)

The `OrganizationIntegrationDetailsEndpoint` POST handler was returning
error messages wrapped in an array (`{"detail": ["error message"]}`),
which is inconsistent with the standard convention of `{"detail": "error
message"}`, so it doesn't work with our standard frontend utils which
extract the message and show it to the user.

This removes the list wrapper so the endpoint returns a plain string,
consistent with how other endpoints in the codebase return errors.
@pull pull Bot locked and limited conversation to collaborators May 29, 2026
@pull pull Bot added the ⤵️ pull label May 29, 2026
@pull pull Bot merged commit 5118a2e into KingDEV95:master May 29, 2026
@github-actions github-actions Bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels May 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

⤵️ pull Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants