Repository navigation
feat(apidocs): Describe organization member response fields - #129998
Merged
Merged
Conversation
Add ApiDescription annotations to the organization member response TypedDicts, the member SCIM response, the team member responses and the member flags that the code explains. Prune the 43 baseline entries they fix. Types and runtime behavior are unchanged. Left in the baseline: the sso:invalid and member-limit:restricted flags, whose meaning the code doesn't show, and invite_link, which the serializer never sets.
Co-Authored-By: BYK <[email protected]>
BYK
approved these changes
Nov 5, 2026
BYK
added a commit
that referenced
this pull request
Nov 5, 2026
This is the next gap-fill after #129998. It adds `ApiDescription` annotations to the project response types in `sentry.api.serializers.models.project` and prunes the response-coverage baseline to match. The project module had the most baseline entries left: 91. **What changes** - Descriptions are added to the base, summary, with-team and detailed project responses, plus their nested team, latest release and crash-free stats dicts. - The wording comes from three places: - the serializer code, for example `processingIssues` is always `0`, and `hasLogs`/`hasTraceMetrics` are always true outside sentry.io - the `Project.flags` comments, for the `has*` fields - the help text on the update serializer in `ProjectDetailsEndpoint`, for the settings fields - 86 baseline entries are removed. Comments are unchanged, apart from two TODOs that moved above the fields they annotate. Runtime behavior is unchanged. **Type changes** - `DetailedProjectResponse.highlightContext`: `dict[str, object]` → `dict[str, list[str]]`. That's the shape `HighlightContextField` validates on write and `HighlightPreset.context` returns as the default. In the spec, `highlightContext.additionalProperties` becomes an array of strings on the project details GET and PUT 200 responses. **Left in the baseline** - `ProjectSerializerResponse.isPublic`: it echoes the legacy `Project.public` model flag, and nothing in the code explains what it means today. - `DetailedProjectResponse.seerNightshiftTweaks`: it's typed `Any` and has no help text or docs. - `DetailedProjectResponse.options` and `_OrganizationProjectOptionalResponse.options` (`untyped`): both are now described, but their values are mixed, so they stay `dict[str, object]`. **Verification** - I ran `make build-api-docs` and then `python -m sentry.apidocs.response_coverage --prune`: 86 entries fixed, 0 new. - `tests/apidocs/test_response_coverage.py` and `tests/sentry/apidocs` pass. - mypy (pre-push) and ruff pass on the changed file. - I compared the spec against prod with descriptions stripped. Besides the `highlightContext` items type, the only differences are ones already on master. The optional prod-vs-dev schema diff check is expected to fail, because descriptions change. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A98eff8ed01bc8064aba01279b3ac82c3 --> -- [View Session in Sentry](https://sentry.sentry.io/explore/conversations/agent%3A98eff8ed01bc8064aba01279b3ac82c3/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>
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.
Next gap-fill after #129991 and #129993: add
ApiDescriptionannotations to the organization member response types and prune the response-coverage baseline to match.What changes
organization_member/response.py: describes the fields of the member, member-with-teams, member-with-roles, SCIM member and member flags responses. The wording comes from the serializers and the existing docs.core/endpoints/team_members.pyandcore/endpoints/organization_member_team_details.py: theuseroverride in these responses needs its own description, because the ratchet keys it underOrganizationMemberResponse.user.tests/apidocs/response-coverage-baseline.txt: removes the 43 entries this fixes.Only descriptions change. Types and runtime behavior stay the same, and comments that duplicated a new description are gone.
Left in the baseline
sso:invalidandmember-limit:restricted(member flags): the code sets them but doesn't say what they mean to API consumers.invite_link: declared on the response type, but no serializer sets it.Verification
make build-api-docsand thenpython -m sentry.apidocs.response_coverage --prune: 43 entries fixed, 0 new.tests/apidocs/test_response_coverage.pyandtests/sentry/apidocspass (127 tests).The optional prod-vs-dev schema diff check is expected to fail, because descriptions change.
via @BYK.
--
View Session in Sentry