Skip to content

Bump API schema to f7ea21af#17310

Merged
sentry-api-schema-updater[bot] merged 1 commit intomasterfrom
bot/bump-api-schema-to-f7ea21af
Apr 10, 2026
Merged

Bump API schema to f7ea21af#17310
sentry-api-schema-updater[bot] merged 1 commit intomasterfrom
bot/bump-api-schema-to-f7ea21af

Conversation

@sentry-api-schema-updater
Copy link
Copy Markdown
Contributor

No description provided.

@sentry-api-schema-updater sentry-api-schema-updater bot merged commit 6b631e0 into master Apr 10, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

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

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Apr 10, 2026 7:29pm
sentry-docs Ready Ready Preview, Comment Apr 10, 2026 7:29pm

Request Review

@sentry-api-schema-updater sentry-api-schema-updater bot deleted the bot/bump-api-schema-to-f7ea21af branch April 10, 2026 19:18
// SENTRY_API_SCHEMA_SHA is used in the sentry-docs GHA workflow in getsentry/sentry-api-schema.
// DO NOT change variable name unless you change it in the sentry-docs GHA workflow in getsentry/sentry-api-schema.
const SENTRY_API_SCHEMA_SHA = '805e71363fab2517dcbd96eed74cd956f6527ee0';
const SENTRY_API_SCHEMA_SHA = 'f7ea21af981d786ce0059eea4e6a0d839ab6a4ab';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The build process does not validate the fetched API schema. A malformed schema from the new SHA could cause a build failure due to unsafe property access in apiCategoriesUncached.
Severity: HIGH

Suggested Fix

Add validation and error handling within resolveOpenAPI() to check for HTTP errors and invalid JSON. In apiCategoriesUncached(), add defensive checks to ensure data.tags and data.paths exist before iteration. Crucially, verify that a tag exists in categoryMap before attempting to access its properties. Additionally, add the pnpm build command to the CI workflow (test.yml) to catch such build failures before merging.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/build/resolveOpenAPI.ts#L9

Potential issue: The build process, specifically the `apiCategoriesUncached` function,
processes an OpenAPI schema fetched using the `SENTRY_API_SCHEMA_SHA`. This function
does not validate the structure of the fetched schema. It assumes properties like
`data.tags` and `data.paths` exist and are well-formed. A critical issue exists where
the code iterates through an endpoint's tags and directly accesses `categoryMap[tag]`
without checking if the tag was defined. If the new schema contains an API endpoint with
a tag not declared in the top-level `data.tags` array, the build will crash with a
`TypeError`. This issue is not caught by CI, as the build step is not part of the test
workflow, posing a risk of deployment failure.

Did we get this right? 👍 / 👎 to inform future reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants