Skip to content

Commit b7f10d4

Browse files
JPeer264claude
andauthored
chore(bugbot): Flag new Cloudflare tests that wrap the worker by hand (#25619)
This adds a Bugbot rule that flags new Cloudflare tests that wrap the worker by hand with `withSentry`, `instrumentDurableObjectWithSentry`, `instrumentAgentWithSentry` or `instrumentWorkflowWithSentry`. It covers new integration test suites, new E2E apps and new Cloudflare variants of existing E2E apps, and recommends the Sentry Cloudflare Vite plugin with an `instrument.server.ts` instead. ## Why The Vite plugin is the recommended Cloudflare setup, so new tests should use it. ## Rule decisions Bugbot does not flag tests of the manual wrappers, apps that do not build with Vite (for example Next.js on OpenNext), or existing apps that wrap by hand. It flags only new tests. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 81b5056 commit b7f10d4

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎.cursor/BUGBOT.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ Keep reviews high-signal. Prefer actionable, high-confidence findings over specu
101101
- Timeouts or sleeps in tests. Instead suggest concrete events or other signals to wait on.
102102
- Flag usage of `getFirstEnvelope*`, `getMultipleEnvelope*` or related test helpers in E2E tests. These are NOT reliable anymore. Instead suggest helpers like `waitForTransaction`, `waitForError`, `waitForSpans`, etc.
103103
- Flag any new or modified `docker-compose.yml` under `dev-packages/node-integration-tests/suites/` where a service does not define a `healthcheck:`. The runner uses `docker compose up --wait` and relies on healthchecks to know when services are actually ready; without one the test will race the service's startup.
104+
- Flag new Cloudflare tests that wrap the worker by hand with `withSentry`, `instrumentDurableObjectWithSentry`, `instrumentAgentWithSentry` or `instrumentWorkflowWithSentry`. This covers new suites under `dev-packages/cloudflare-integration-tests/suites/`, new E2E apps under `dev-packages/e2e-tests/test-applications/` that run on Cloudflare, and new Cloudflare variants of existing E2E apps (an entry in `sentryTest.variants` of the app's `package.json`, for example `hono-4 (cloudflare)`). App names do not always start with `cloudflare-`. Recommend the Sentry Cloudflare Vite plugin instead: `plugins: [cloudflare(), sentryCloudflareVitePlugin()]` in `vite.config.*` (`sentryCloudflareVitePlugin` from `@sentry/cloudflare/vite`), and the SDK options in an `instrument.server.ts` next to the worker entry that default-exports `defineCloudflareOptions(...)`. Do not flag tests whose purpose is to test one of these wrappers, or apps that do not build with Vite (for example Next.js on OpenNext).
104105

105106
## Platform-safe code
106107

0 commit comments

Comments
 (0)