[pull] master from getsentry:master#2009
Merged
Merged
Conversation
…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.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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 : )