Skip to content

feat(api-docs): Build the API reference from @sentry/api/docs - #20679

Open
sentry-junior[bot] wants to merge 3 commits into
masterfrom
feat/api-docs-from-sentry-api
Open

sentry-junior[bot] wants to merge 3 commits into
masterfrom
feat/api-docs-from-sentry-api

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

The API reference now comes from the @sentry/api version this repo pins. It no longer fetches openapi-derefed.json from a pinned getsentry/sentry-api-schema commit; @sentry/api now builds in getsentry/sentry (static/packages/api).

Important

Don't merge until an @sentry/api release with the ./docs export is on npm. That export comes from getsentry/sentry#130538. This PR pins 1.58.0, the latest version today, which doesn't have ./docs yet, so the build fails until the pin moves. The last step before merging is to run Bump @sentry/api (or pnpm add -E @sentry/api@<first version with ./docs>).

Changes

  • src/build/resolveOpenAPI.ts reads {tags, operations} from @sentry/api/docs and maps them to the same APICategory/API shapes the pages already use.
    • OPENAPI_LOCAL_PATH still works in development. It reads a local make build-api-docs spec and runs it through the package's extractDocs(), so previews take the same path as production.
    • src/build/open-api/types.ts is gone. The package types replace it.
  • Bump workflow: bump-api-schema-sha.yml is now Bump @sentry/api.
    • It runs hourly and on workflow_dispatch, with a concurrency group so the two can't push the same branch.
    • scripts/bump-sentry-api.sh reads the latest version with npm view, runs pnpm add --save-exact --lockfile-only, then opens and merges the PR with the same app token as before.
    • The file keeps its name so existing dispatches still reach it.
    • Dependabot here only does security updates, so it doesn't fit.
    • The script is POSIX sh, passes shellcheck --shell=sh --enable=check-extra-masked-returns, and has a pre-commit hook scoped to it.
  • develop-docs/backend/api/public.mdx: the build process section describes the new flow, and the openapi-diff text matches ci(openapi-diff): Compare API schemas with the PR's merge-base sentry#130541: a changelog that never fails, plus a separate RPC breaking-change job. Hold that part until that PR merges.

Verification

All of this ran with a locally packed @sentry/api tarball from that PR. Nothing was published.

  • Page data: I dumped apiCategories() from the old reader and the new adapter on the same spec. The output has 23 categories and 285 APIs, and is identical except that optional query parameters now have required: false where the key used to be missing (494 parameters). The pages check !!param.required, so they render the same. Production data and the OPENAPI_LOCAL_PATH path give byte-identical output.
  • HTML: the rendered <main> is byte-identical on /api/users/list-your-organizations/, /api/teams/create-a-new-team/, /api/projects/create-a-custom-inbound-filter/ (an experimental endpoint with a body), /api/teams/ and /api/events/retrieve-an-issue/.
  • pnpm lint:ts, vitest run src/build/resolveOpenAPI.spec.ts and eslint all pass.
  • The bump script ran under dash with stubbed npm, pnpm, git and gh. Same version: it skips. Newer: it runs the full flow. A non-version answer from npm or any failing command: it exits non-zero. pnpm add --lockfile-only ran for real against a copy of this repo's manifest and lockfile.

Screenshots

These are next dev screenshots at 1400px wide. Before is the current reader on the same spec through OPENAPI_LOCAL_PATH; after is this PR reading @sentry/api/docs. The images are pixel-identical except for the Next.js dev badge, so two pairs have the same URL.

Create a New Team

Before After
before after

Create a Custom Inbound Filter (experimental, with a body)

Before After
before after

List Your Organizations

Before After
before after

Merge order

  1. feat(api): Export API reference data as @sentry/api/docs sentry#130538 merges and an @sentry/api version with ./docs is released.
  2. Bump the pin in this PR to that version.
  3. Merge this PR.
  4. Afterwards, sentry-api-schema's "Cascade to sentry-docs" dispatch is no longer needed.

Co-Authored-By: BYK 126780+BYK@users.noreply.github.com

via @BYK.

--

View Session in Sentry

Read the API reference data from the pinned @sentry/api package instead
of fetching openapi-derefed.json from a pinned sentry-api-schema commit.
OPENAPI_LOCAL_PATH still previews a local spec, through the package's
extractDocs().

Replace the API Schema SHA bump with a @sentry/api version bump that runs
hourly and on dispatch.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
sentry-docs Error Error Nov 9, 2026 11:01pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
develop-docs Ignored Ignored Preview Nov 9, 2026 11:01pm UTC

Request Review

@github-actions github-actions Bot added the Priority: Needs Triage The PR description is missing valid priority information label Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

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.

@cursor

cursor Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Getting ready to monitor this change · Rollout details

Status Service Environment
⏳ Getting ready to monitor this change

@cursor cursor Bot left a comment

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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f8dbde4. Configure here.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
…sentry-api

# Conflicts:
#	src/build/resolveOpenAPI.ts

This branch had an error being deployed

2 failed (1 outdated) deployments
Preview – sentry-docs — 929ad288 Deployed Nov 9, 2026 by vercel[bot]
Preview – develop-docs — f2a7c9f2 Deployed Nov 9, 2026 by vercel[bot]
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.

1 participant