Skip to content

feat(apidocs): Describe project response fields - #130019

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

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

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

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.

via @BYK.

--

View Session in Sentry

Add ApiDescription annotations to the project response TypedDicts in
sentry.api.serializers.models.project (base, summary, with-team and
detailed responses) and prune the 86 baseline entries they fix.
Wording comes from the serializer code, the project flag comments and
the help text on the project details endpoint's update serializer.

Type highlightContext as dict[str, list[str]], the shape that
HighlightContextField validates and the highlight presets return.
Runtime behavior is unchanged.

Left in the baseline: isPublic (a legacy model flag the code doesn't
explain), seerNightshiftTweaks (untyped and undocumented), and the
untyped options maps.

Co-Authored-By: BYK <[email protected]>
@sentry-junior
sentry-junior Bot requested review from a team as code owners November 5, 2026 11:10
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 5, 2026
@BYK
BYK enabled auto-merge (squash) November 5, 2026 11:13
@BYK
BYK merged commit 1829625 into master Nov 5, 2026
97 of 106 checks passed
@BYK
BYK deleted the feat/apidocs-describe-project-fields branch November 5, 2026 15:13

This branch was successfully deployed

1 active deployment
Preview — 0e6abf6a Deployed Nov 5, 2026 by vercel[bot]
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