Skip to content

ref(api): resolve UNKNOWN publish_status for release and deprecated endpoints#116650

Open
gricha wants to merge 5 commits into
masterfrom
gricha/ref/publish-status-unknowns
Open

ref(api): resolve UNKNOWN publish_status for release and deprecated endpoints#116650
gricha wants to merge 5 commits into
masterfrom
gricha/ref/publish-status-unknowns

Conversation

@gricha
Copy link
Copy Markdown
Member

@gricha gricha commented Jun 1, 2026

Resolves the ApiPublishStatus.UNKNOWN placeholder on 10 endpoints and removes their entries from the publish-status allowlist. First batch of an effort to drain api_publish_status_allowlist_dont_modify.py and eventually delete the UNKNOWN status. publish_status is docs-only, so there is no runtime, routing, or auth change here.

All touched endpoints → PRIVATE

For now these are marked PRIVATE (not published as public API), clearing them out of UNKNOWN: the release CRUD endpoints (OrganizationReleases, OrganizationReleasesStats, OrganizationReleaseCommits, ProjectReleases POST, ProjectReleaseDetails, ProjectReleaseCommits), the @deprecated group stats/tags/integration-details endpoints, and the project releases deploy-token endpoint.

ProjectReleases GET stays PUBLIC — it was already public before this branch; only the POST we touched flips.

OpenAPI documentation is kept (intentionally)

Even though these are PRIVATE, they keep full @extend_schema documentation (params, responses, descriptions, examples). We want this documentation in place and intend to start requiring it on private endpoints, since internal changes will be driven off the generated schema/types. The docs are dormant in the public schema today but ready.

Shared schema/type fixes

  • Annotated UserField with @extend_schema_field(OpenApiTypes.STR) (matches api/fields/actor.py / sentry_slug.py).
  • Added help_text to ReleaseSerializer's status/version/owner fields.
  • Added COMMIT and release-timeseries example fixtures to release_examples.py.

Design note

Reviewed against the API design guidelines. One pre-existing deviation documented inline on ReleaseSerializerResponse.id: the release id is an integer rather than a string. Long-standing, codebase-wide; not introduced here.

Verified: make build-api-docs (--validate --fail-on-warn) clean, and mypy clean on all touched files.

gricha added 2 commits June 1, 2026 15:51
These endpoints were ApiPublishStatus.UNKNOWN. They are not public API surface,
so mark them PRIVATE to record intent (docs-only change, no runtime effect):

- group stats/tags/integration-details: already @deprecated (cell-silo retirement)
- project releases token: provisions/rotates a deploy-token credential
Promote release CRUD endpoints from ApiPublishStatus.UNKNOWN to PUBLIC with full
OpenAPI documentation (extend_schema params/responses/descriptions), and remove
their entries from the publish-status allowlist:

- OrganizationReleases (GET+POST), OrganizationReleasesStats (GET),
  OrganizationReleaseCommits (GET)
- ProjectReleases (POST), ProjectReleaseDetails (GET/PUT/DELETE),
  ProjectReleaseCommits (GET)

Supporting schema fixes:
- annotate UserField with extend_schema_field(STR) so serializers using it
  resolve cleanly (matches actor.py / sentry_slug.py)
- add help_text to ReleaseSerializer status/version/owner fields
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 1, 2026
@gricha gricha marked this pull request as ready for review June 1, 2026 22:52
@gricha gricha requested review from a team as code owners June 1, 2026 22:52
Copy link
Copy Markdown
Contributor

@cvxluo cvxluo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, though i'm not familiar enough with the releases API to feel confident approving. one thing that might be helpful is to add api doc examples. i've also generally found that there's a decent bit of type drift between the actual response schemas for endpoints vs their serializers, so it may be worth verifying that the schemas line up (e.g. i spot checked ProjectReleaseDetailsEndpoint and it seems like the HealthData schema returns floats instead of ints)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi i'm looking to publish this one

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup sg as well!

class GroupStatsEndpoint(GroupEndpoint, StatsMixin):
publish_status = {
"GET": ApiPublishStatus.UNKNOWN,
"GET": ApiPublishStatus.PRIVATE,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it's fine to mark these are private, but for i believe these are getting deprecated as part of the cell project, so it shouldn't matter in the long run

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, they can remove them then, im fine with that, i just want to kill the unknown allowlist

@gricha
Copy link
Copy Markdown
Member Author

gricha commented Jun 2, 2026

yeah @azulus is helping with making sure drift isn't present via linters, i'll check the Health ones you mention!

@gricha gricha requested a review from azulus June 2, 2026 00:58
gricha added 2 commits June 1, 2026 18:04
Match the established public-endpoint style (examples= alongside responses=, as
the sibling ProjectReleases GET already does). Reuse the existing RELEASE fixture
for release-shaped responses and add COMMIT + release-timeseries example fixtures.
Comment thread src/sentry/api/endpoints/organization_releases.py
publish_status = {
"GET": ApiPublishStatus.UNKNOWN,
"POST": ApiPublishStatus.UNKNOWN,
"GET": ApiPublishStatus.PUBLIC,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should these be public now?

owner = ApiOwner.TELEMETRY_EXPERIENCE
publish_status = {
"GET": ApiPublishStatus.UNKNOWN,
"GET": ApiPublishStatus.PUBLIC,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we consider going unknown -> private instead of straight to public? what are the implications here?

owner = ApiOwner.TELEMETRY_EXPERIENCE
publish_status = {
"GET": ApiPublishStatus.UNKNOWN,
"GET": ApiPublishStatus.PUBLIC,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar question about unknown -> public. Remember that anything going to public likely needs to be supported forever. I don't think we want this?


@extend_schema(
operation_id="List an Organization Release's Commits",
parameters=[CursorQueryParam],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar question about schema shape changes

owner = ApiOwner.TELEMETRY_EXPERIENCE
publish_status = {
"GET": ApiPublishStatus.UNKNOWN,
"GET": ApiPublishStatus.PUBLIC,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also unknown -> public


@extend_schema(
operation_id="List a Project Release's Commits",
parameters=[CursorQueryParam],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another shape change. fine?

"DELETE": ApiPublishStatus.UNKNOWN,
"GET": ApiPublishStatus.UNKNOWN,
"PUT": ApiPublishStatus.UNKNOWN,
"DELETE": ApiPublishStatus.PUBLIC,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also unknown -> public

)
)

@extend_schema(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing default w/ no visibility is public? should probably be private annotated?

),
)

@extend_schema(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment re: visibility

Keep the @extend_schema documentation (params/responses/examples) but set
publish_status to PRIVATE rather than PUBLIC. We want this documentation present
-- and intend to start requiring it on private endpoints to drive internal
changes off the schema -- without yet committing these as public API.

project_releases GET stays PUBLIC (pre-existing); only the POST we touched flips.
@gricha gricha changed the title ref(api): resolve UNKNOWN publish_status for releases and deprecated endpoints ref(api): resolve UNKNOWN publish_status for release and deprecated endpoints Jun 2, 2026
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.

3 participants