Repository navigation
Conversation
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9e112ec. Configure here.
| # consumer of its response type, so the failure shows on the change that | ||
| # caused it and the contracts are never committed broken. | ||
| - name: Typecheck API contracts and consumers | ||
| run: pnpm run typecheck |
There was a problem hiding this comment.
Typecheck missing Node heap limit
Medium Severity
The new required job runs pnpm run typecheck without the NODE_OPTIONS heap limit that frontend.yml and type-coverage-diff.yml set for the same command. Combined with backend-ci services on ubuntu-26.04-arm, tsc can exhaust the Node heap and fail the Backend check on backend-only PRs.
Reviewed by Cursor Bugbot for commit 9e112ec. Configure here.
9e112ec to
f835977
Compare
17d1fc8 to
b5413db
Compare
39c7466 to
f86e91d
Compare
b5413db to
36eef60
Compare
Sentry Snapshot Testing
|
Add an api-contracts-typescript backend job that runs `make build-api-contracts`, typechecks and lints the result, and commits the regenerated apiContracts.generated.ts back to the PR, like api-url-typescript does for knownSentryApiUrls.generated.ts. It runs on every API docs change because response types come from serializers anywhere in the backend, and it's part of the required Backend check. The app token is minted only after the PR's own code has run, and fork PRs, which get no secrets, skip the commit instead of failing. The file is exempt from the frontend/backend scope warning and has no CODEOWNERS owner, like the API URL file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f86e91d to
ff8b731
Compare
scttcper
left a comment
There was a problem hiding this comment.
feels like we might combine these jobs that all run when an api changes, like the knownApi thing
The contracts generator keys its response types on knownSentryApiUrls.generated.ts, so running the URL and contracts jobs side by side built the contracts against the old URLs and dropped any new route. Each job also committed back to the PR, and each bot commit cancelled and restarted the whole backend run. One job now syncs the URLs, then the contracts against them, and commits both at once. build-api-contracts depends on a new build-api-urls make target, so the local build can't use stale URLs either. The job is left out of backend-required-check while the contracts are new. If the contracts fail to build, typecheck, or lint, the job drops them and still commits the URLs, so the existing URL sync keeps working. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tsc and eslint run in this job without the --max-old-space-size that frontend.yml and type-coverage-diff.yml set for the same commands, and next to backend-ci's services they can run out of heap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>


Why?
apiContracts.generated.tsis built from backend serializers and response annotations, so it goes stale whenever a backend response changes. Right now it's only regenerated when someone runsmake build-api-contractsby hand.How?
One backend job,
api typescript generation, replaces the API URL job. On every backend change it regeneratesknownSentryApiUrls.generated.ts, then the contracts from those URLs, and commits both back to the PR in one commit. Before committing, it typechecks the frontend against the new contracts, so a backend change that breaks a frontend consumer fails the job instead of being committed.build-api-contractsnow depends on a newbuild-api-urlsmake target, so the contracts are never built against stale URLs, in CI or locally.Decisions
urls.py, since response types can come from anywhere in the backend. The URL sync only takes seconds once the job has set up.ubuntu-26.04-arm, like the other backend jobs.🤖 Generated with Claude Code