Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/build/resolveOpenAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// 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 = '{"message":"API rate limit exceeded for 172.182.213.147. (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"}';

Check failure on line 11 in src/build/resolveOpenAPI.ts

View workflow job for this annotation

GitHub Actions / Lint

',' expected.

Check failure on line 11 in src/build/resolveOpenAPI.ts

View workflow job for this annotation

GitHub Actions / Lint

',' expected.

Check failure on line 11 in src/build/resolveOpenAPI.ts

View workflow job for this annotation

GitHub Actions / Lint

',' expected.

Check failure on line 11 in src/build/resolveOpenAPI.ts

View workflow job for this annotation

GitHub Actions / Lint

',' expected.

Check failure on line 11 in src/build/resolveOpenAPI.ts

View workflow job for this annotation

GitHub Actions / Lint

',' expected.

Check failure on line 11 in src/build/resolveOpenAPI.ts

View workflow job for this annotation

GitHub Actions / Lint

',' expected.

Check failure on line 11 in src/build/resolveOpenAPI.ts

View workflow job for this annotation

GitHub Actions / Lint

',' expected.

Check failure on line 11 in src/build/resolveOpenAPI.ts

View workflow job for this annotation

GitHub Actions / Lint

',' expected.

Check failure on line 11 in src/build/resolveOpenAPI.ts

View workflow job for this annotation

GitHub Actions / Lint

',' expected.

Check failure on line 11 in src/build/resolveOpenAPI.ts

View workflow job for this annotation

GitHub Actions / Lint

',' expected.
Copy link

Choose a reason for hiding this comment

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

GitHub API error response accidentally committed as SHA

High Severity

The SENTRY_API_SCHEMA_SHA constant was replaced with a GitHub API rate limit error JSON response instead of a valid Git commit SHA. This value is used to construct a URL for fetching the OpenAPI schema from GitHub raw content. The resulting URL will be completely invalid, causing the resolveOpenAPI() function to fail when fetching the API schema, which will break the documentation build.

Fix in Cursor Fix in Web

Copy link

Choose a reason for hiding this comment

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

Bug: The SENTRY_API_SCHEMA_SHA constant is an invalid JSON string, not a Git SHA, which will break URL generation and cause build and runtime failures.
Severity: CRITICAL

Suggested Fix

Replace the invalid JSON string in the SENTRY_API_SCHEMA_SHA constant with the correct, valid Git SHA for the sentry-api-schema repository. The previous valid SHA was 66c1827096e4cd8f8b5074c316c67975015a84ba.

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 `SENTRY_API_SCHEMA_SHA` constant at
`src/build/resolveOpenAPI.ts:11` has been assigned an invalid value—a JSON string
representing a GitHub API error—instead of a valid Git SHA. This variable is used to
construct a URL to fetch the OpenAPI schema. The resulting malformed URL causes the
`fetch` call to throw an unhandled error. This error propagates, leading to build-time
failures when generating the documentation index and runtime crashes when serving API
documentation pages, making them inaccessible.

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


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

Expand Down
Loading