Skip to content

feat(api): Badge experimental endpoints on API reference pages - #19320

Merged
DominikB2014 merged 2 commits into
masterfrom
dominikbuszowiecki/feat/api-experimental-badge
Sep 11, 2026
Merged

feat(api): Badge experimental endpoints on API reference pages#19320
DominikB2014 merged 2 commits into
masterfrom
dominikbuszowiecki/feat/api-experimental-badge

Conversation

@DominikB2014

@DominikB2014 DominikB2014 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor
image

Adds a experimental section if an endpoint is marked as public_experimental.
One thing to note, we have a regex that automatically strips the existing experimental message from the api description, this is intentional. We want that description in the openapi json so external tools (like postman, swagger ui, etc) understand it's experimental, but we want the docs to render a experimental badge so we have to strip out the existing description.

Sentry marks endpoints published under the PUBLIC_EXPERIMENTAL status with
x-sentry-experimental on the operation, but nothing read it, so those endpoints
rendered as though they were stable.

Model the extension, carry it onto the API type next to the existing deprecated
flag, and render a badge above the request block.
@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
develop-docs Ready Ready Preview Sep 10, 2026 6:03pm UTC
sentry-docs Ready Ready Preview Sep 10, 2026 6:03pm UTC

Request Review

Sentry prepends a text notice to every experimental operation's description so
consumers without a badge still warn the reader. Rendering both said the same
sentence twice on the page. Strip the notice when we render the badge, which
also makes the two changes safe to merge in either order.
@github-actions

Copy link
Copy Markdown
Contributor

Please update the IS YOUR CHANGE URGENT? section of the PR description:

  • Select exactly one option.
  • If you selected an urgent or other deadline, provide the date as YYYY-MM-DD.

This information helps the Docs team prioritize your review.

Comment thread src/build/resolveOpenAPI.ts
@linear-code

linear-code Bot commented Sep 11, 2026

Copy link
Copy Markdown

ENG-8594

@skaasten

Copy link
Copy Markdown
Contributor

For ones that are already marked experimental, like this one? - should we switch it over to this new format?

@DominikB2014

Copy link
Copy Markdown
Contributor Author

For ones that are already marked experimental, like this one? - should we switch it over to this new format?

@skaasten yup! these will be switched over, that's a good call out. It will be a follow up pr on the sentry repo

@DominikB2014
DominikB2014 merged commit 345a23f into master Sep 11, 2026
33 checks passed
@DominikB2014
DominikB2014 deleted the dominikbuszowiecki/feat/api-experimental-badge branch September 11, 2026 16:24
DominikB2014 added a commit to getsentry/sentry that referenced this pull request Sep 11, 2026
This Pr makes two changes:

1. Adds `PUBLIC_EXPERIMENTAL` to `ApiPublishStatus`, filling the gap
between an endpoint being invisible and being frozen under a permanent
stability commitment — it is published, but free to change incompatibly.
Plan is to make most of our private apis have this status, so code mode
and external agents immediately benefit
2. Set the /trace-items/metrics endpoint to public experiemental (the
first example)

There is a complementary docs pr here
getsentry/sentry-docs#19320, with a screenshot
from me testing this all locally

Publication is now expressed once as `ApiPublishStatus.is_published`,
and every gate that keyed on `PUBLIC` reads it (the OpenAPI filter, the
S022 response-shape lint, and the Seer public-API matrix), so the new
status clears the exact same documentation bar as `PUBLIC` rather than
offering a shortcut past it. Because nothing downstream renders the
`x-sentry-experimental` marker these operations now carry, the build
also prepends a short notice to the rendered description — four
endpoints were already hand-writing that warning into their docstrings
in four different wordings, one of them buried at the end, and this
standardizes on the most common of them. The `trace-items/metrics`
endpoint adopts the status as the first user: publishing it pulls it
into the Seer matrix, which needs its feature flag registered there, and
it gains a response example, with its response TypedDicts moving to a
`*_types.py` so the examples module can import them without a circular
import. Follow-ups: a sentry-docs badge reading `x-sentry-experimental`
to replace the text notice, the Sentaur bot tolerating the new
`public_experimental` key in the ownership stats JSON, and migrating
those four hand-rolled endpoints onto the status.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Needs Triage The PR description is missing valid priority information

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants