Skip to content

feat(apidocs): Describe organization member response fields - #129998

Merged
BYK merged 2 commits into
masterfrom
feat/apidocs-describe-member-fields
Nov 5, 2026
Merged

BYK merged 2 commits into
masterfrom
feat/apidocs-describe-member-fields

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Next gap-fill after #129991 and #129993: add ApiDescription annotations 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.py and core/endpoints/organization_member_team_details.py: the user override in these responses needs its own description, because the ratchet keys it under OrganizationMemberResponse.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:invalid and member-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

  • I ran make build-api-docs and then python -m sentry.apidocs.response_coverage --prune: 43 entries fixed, 0 new.
  • tests/apidocs/test_response_coverage.py and tests/sentry/apidocs pass (127 tests).
  • mypy (pre-push) and ruff pass on the changed files.
  • In the spec diff against prod, the only changes besides descriptions are ones already on master.

The optional prod-vs-dev schema diff check is expected to fail, because descriptions change.

via @BYK.

--

View Session in Sentry

sentry-junior Bot and others added 2 commits November 4, 2026 23:25
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.
@sentry-junior
sentry-junior Bot requested review from a team as code owners November 4, 2026 23:33
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 4, 2026
@BYK
BYK merged commit 2000866 into master Nov 5, 2026
76 of 77 checks passed
@BYK
BYK deleted the feat/apidocs-describe-member-fields branch November 5, 2026 11:10
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]>
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.

1 participant