Skip to content

Conversation

@getsantry
Copy link
Contributor

@getsantry getsantry bot commented Jan 28, 2026

No description provided.

@vercel
Copy link

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

Request Review

@getsantry getsantry bot enabled auto-merge (squash) January 28, 2026 23:08
Comment on lines 8 to 14

// 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 = '66c1827096e4cd8f8b5074c316c67975015a84ba';
const SENTRY_API_SCHEMA_SHA = '31737632a66db91d48125b6f5c8a34ef9d2eb67f';

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

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 the fetch call. If the request fails, response.json() will throw an unhandled exception, crashing the build process.
Severity: CRITICAL

Suggested Fix

Add error handling to the fetch call in resolveOpenAPI. Check if response.ok is true before attempting to parse the JSON. If the response is not okay, throw a descriptive error or implement a fallback mechanism to prevent the unhandled promise rejection from crashing the build.

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#L8-L14

Potential issue: The `resolveOpenAPI` function fetches an OpenAPI schema from a GitHub
URL but lacks error handling for the `fetch` operation. If the request fails with an
HTTP error (e.g., a 404 if the commit SHA is invalid or the file is missing), the
subsequent call to `response.json()` will attempt to parse a non-JSON body (like an HTML
error page), throwing a `SyntaxError`. Because this exception is not caught, it results
in an unhandled promise rejection that will crash the entire build process, preventing
site deployments.

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