⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@getsantry
Copy link
Contributor

@getsantry getsantry bot commented Jan 16, 2026

No description provided.

@getsantry getsantry bot enabled auto-merge (squash) January 16, 2026 19:41
@vercel
Copy link

vercel bot commented Jan 16, 2026

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

Project Deployment Review Updated (UTC)
develop-docs Ready Ready Preview, Comment Jan 16, 2026 7:53pm
sentry-docs Ready Ready Preview, Comment Jan 16, 2026 7:53pm

Request Review

Comment on lines 9 to +11
// 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 = '0026719ede0a1ced5b9fc0b40a76b117becbc11b';
const SENTRY_API_SCHEMA_SHA = 'c6c48ebf9137b06dee034d4b6d43809809d6a196';
Copy link

Choose a reason for hiding this comment

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

Bug: The resolveOpenAPI function lacks error handling for its fetch call and does not check if the response is successful before attempting to parse it as JSON.
Severity: HIGH

Suggested Fix

Before calling await response.json(), add a check to ensure the fetch request was successful. Use if (!response.ok) to verify the HTTP status and throw a descriptive error if the request failed. This prevents the build from crashing on non-JSON responses from failed network requests.

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

Potential issue: The `resolveOpenAPI` function fetches a JSON schema from a GitHub raw
URL but does not handle potential HTTP errors. If the `fetch` call fails (e.g., due to a
404 Not Found or 500 Internal Server Error), the code proceeds to call
`response.json()`. This will attempt to parse a non-JSON response body, such as an HTML
error page, causing a `SyntaxError` that will crash the build process. While the SHA
used in the URL is validated by an automated workflow, other issues like network
failures or a temporary GitHub outage could trigger this bug.

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.

1 participant