Skip to content

Bump API schema to {"messag#17758

Merged
sentry-api-schema-updater[bot] merged 1 commit into
masterfrom
bot/bump-api-schema-to-{"messag
May 13, 2026

Hidden character warning

The head ref may contain hidden characters: "bot/bump-api-schema-to-{"messag"
Merged

Bump API schema to {"messag#17758
sentry-api-schema-updater[bot] merged 1 commit into
masterfrom
bot/bump-api-schema-to-{"messag

Conversation

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

No description provided.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

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

Project Deployment Actions Updated (UTC)
develop-docs Error Error May 13, 2026 8:17pm
sentry-docs Error Error May 13, 2026 8:17pm

Request Review

@sentry-api-schema-updater sentry-api-schema-updater Bot merged commit ace8409 into master May 13, 2026
2 of 4 checks passed
@sentry-api-schema-updater sentry-api-schema-updater Bot deleted the bot/bump-api-schema-to-{"messag branch May 13, 2026 20:17
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

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 8ad285c. Configure here.

// 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 = '4d727be1ea79676354f4242387b3645ac0e0dcf9';
const SENTRY_API_SCHEMA_SHA = '{"message":"API rate limit exceeded for 40.76.191.138. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}';
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.

GitHub API error message committed as schema SHA

High Severity

SENTRY_API_SCHEMA_SHA was overwritten with a GitHub API rate limit error JSON string instead of a valid git commit SHA. This value is interpolated into a raw.githubusercontent.com URL on line 27 to fetch the OpenAPI schema, which will now fail for all non-local-development builds, completely breaking API documentation generation.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8ad285c. Configure here.

Comment on lines +9 to 12
const SENTRY_API_SCHEMA_SHA = '{"message":"API rate limit exceeded for 40.76.191.138. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}';

const activeEnv = process.env.GATSBY_ENV || process.env.NODE_ENV || 'development';

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.

Bug: If SENTRY_API_SCHEMA_SHA contains an invalid value, the fetch call will throw an unhandled TypeError due to a malformed URL, crashing the build process.
Severity: HIGH

Suggested Fix

Wrap the fetch call in resolveOpenAPI within a try/catch block to handle potential TypeError exceptions from malformed URLs. Additionally, add a check for response.ok to handle non-2xx HTTP responses and prevent build failures.

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-L12

Potential issue: The `SENTRY_API_SCHEMA_SHA` environment variable, when it contains a
non-SHA value like a GitHub API rate-limit error, is interpolated directly into the URL
for a `fetch` call. This creates a malformed URL, causing `fetch` to throw a
`TypeError`. Because this call is not wrapped in a `try/catch` block and lacks a
`response.ok` check, the resulting unhandled promise rejection propagates up the call
stack from `resolveOpenAPI()` and crashes the entire documentation site's build process.

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