Skip to content

Conversation

@getsantry
Copy link
Contributor

@getsantry getsantry bot commented Jan 21, 2026

No description provided.

@vercel
Copy link

vercel bot commented Jan 21, 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 21, 2026 7:02pm
sentry-docs Ready Ready Preview, Comment Jan 21, 2026 7:02pm

Request Review

@getsantry getsantry bot enabled auto-merge (squash) January 21, 2026 18:51
// 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 = 'b7cec710553c59d251cc6e50172c26455b53a640';
const SENTRY_API_SCHEMA_SHA = '47231e6180b34f222ed462b1d0cb3cdb951cc4e7';
Copy link

Choose a reason for hiding this comment

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

Bug: The fetch request for the OpenAPI schema lacks a response.ok check. A failed request (e.g., 404) will cause a JSON parsing error, crashing the build.
Severity: HIGH

Suggested Fix

Before calling await response.json(), add a check to ensure the fetch was successful. For example: if (!response.ok) { throw new Error(Failed to fetch OpenAPI schema: ${response.statusText}); }. This will provide a clear error message if the request fails and prevent the build from crashing on a JSON parsing error.

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

Potential issue: The `fetch` call in `resolveOpenAPI.ts` to retrieve the OpenAPI schema
from a raw GitHub URL does not handle non-2xx HTTP responses. If the request fails due
to an invalid SHA, GitHub outage, or other issue resulting in a non-JSON response (like
a 404 HTML page), the subsequent call to `response.json()` will fail with a
`SyntaxError`. This will crash the build process with a cryptic error message instead of
a clear one about the failed HTTP request. This pattern deviates from other `fetch`
calls in the codebase which correctly check `response.ok` before parsing.

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