Skip to content

chore(lint): Move mechanical Bugbot rules to lint and the test runner - #26854

Merged
mydea merged 6 commits into
developfrom
feat/bugbot-rules-to-lint
Nov 25, 2026
Merged

mydea merged 6 commits into
developfrom
feat/bugbot-rules-to-lint

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Oxlint rejects imports of Node built-ins (node:*, fs, path, ...) in src of core, browser, browser-utils and the other browser- or edge-only packages (angular, ember, feedback, gatsby, integration-shims, react, replay-*, solid, svelte, vercel-edge, vue, wasm).
  • no-eval, no-new-func and a new sdk/no-unsafe-html-writes rule are errors in every package's src. The new rule flags assigning innerHTML/outerHTML, insertAdjacentHTML() and document.write()/writeln().
  • The node-integration-tests runner fails when a docker-compose.yml service has no healthcheck, or has it turned off (disable: true or test: ['NONE']).
  • Node-integration suite tests can't read process.version(s) or call ctx.skip/context.skip. They gate with supports() instead.
  • .cursor/BUGBOT.md drops the rules these now enforce (eval/Function()/innerHTML, Compose healthchecks), plus the stale generateInstrumentationOnce and getFirstEnvelope* rules.

Why

These checks are mechanical, so lint and the runner enforce them reliably and Bugbot doesn't spend review time on them. Current code already follows them.

  • The built-in ban is a regex over builtinModules, because a gitignore-style group also matches relative imports like ./constants. Type imports are banned too: a Node type in a shipped .d.ts breaks consumers without @types/node. Meta-frameworks and effect mix client and server code in src, so they aren't covered.
  • innerHTML needs a custom rule because no-restricted-properties also flags reads, such as in contextlines.ts.
  • no-implied-eval is not added: the type-aware typescript/no-implied-eval already runs.
  • Oxlint has no no-restricted-syntax, so the suite rule uses no-restricted-properties. It can't see process.env.RUNTIME, a destructured skip, or skipIf/runIf conditions, so that Bugbot rule stays. The Node-imports Bugbot rule stays too, because it also covers cloudflare, deno, bun and require().

Left for follow-ups:

  • typescript/no-non-null-assertion in src. There are many more existing assertions than expected, mostly indexed access under noUncheckedIndexedAccess, so it needs its own cleanup PR.
  • The issue's other new sdk/* rules, the test harness checks and the CI scripts.

Part of #26852

via @mydea.

--

View Session [Sentry]

Ban Node built-in imports in core, browser and browser-utils, and ban eval
and new Function in src. Drop two stale Bugbot rules.

Refs #26852

Co-Authored-By: Francesco Gringl-Novy <2411343+mydea@users.noreply.github.com>
Flag innerHTML/outerHTML assignment, insertAdjacentHTML() and
document.write()/writeln() in src, and drop the Bugbot rule it replaces.

Refs #26852

Co-Authored-By: Francesco Gringl-Novy <2411343+mydea@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: fdc01a9 (PR test merge using develop at 06fdfe2)

Against: 06fdfe2 (develop) · base run #67906

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 30.54 kB - -
@sentry/browser - with treeshaking flags 28.73 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.6 kB - -
@sentry/browser (incl. Tracing) 53.67 kB - -
@sentry/browser (incl. Tracing Core) 40.58 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 53.67 kB - -
@sentry/browser (incl. Tracing, Profiling) 56.56 kB - -
@sentry/browser (incl. Tracing, Replay) 93.59 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 82.45 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 98.42 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 111.4 kB - -
@sentry/browser (incl. Feedback) 48.4 kB - -
@sentry/browser (incl. sendFeedback) 31.11 kB - -
@sentry/browser (incl. FeedbackAsync) 36.16 kB - -
@sentry/browser (incl. Metrics) 31.86 kB - -
@sentry/browser (incl. Logs) 32.13 kB - -
@sentry/browser (incl. Metrics & Logs) 32.8 kB - -
@sentry/react 32.56 kB - -
@sentry/react (incl. Tracing) 56.37 kB - -
@sentry/vue 38.74 kB - -
@sentry/vue (incl. Tracing) 56.68 kB - -
@sentry/svelte 30.57 kB - -
@sentry/effect (client) 42.21 kB - -
@sentry/effect (client, incl. Tracing) 54.96 kB - -
@sentry/effect (client, incl. Tracing, Logs, Metrics) 66.31 kB - -
@sentry/remix (Remix 3 client bundle) 59.39 kB - -
CDN Bundle 32.53 kB - -
CDN Bundle (incl. Tracing) 54.15 kB - -
CDN Bundle (incl. Logs, Metrics) 35.27 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 56.63 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 76.22 kB - -
CDN Bundle (incl. Tracing, Replay) 91.93 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 94.47 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 97.39 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.86 kB - -
CDN Bundle - uncompressed 94.92 kB - -
CDN Bundle (incl. Tracing) - uncompressed 160.26 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 103.26 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 167.88 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 233.62 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 280.65 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 288.28 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 292.59 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 300.2 kB - -
@sentry/nextjs (client) 60.08 kB - -
@sentry/sveltekit (client) 55.02 kB - -
@sentry/core/server 45.83 kB - -
@sentry/core/browser 14.46 kB - -
@sentry/node 156.93 kB -0.01% -2 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.45 kB - -
@sentry/node - without tracing 89.78 kB -0.01% -3 B 🔽
@sentry/node - without channel injection 145.88 kB +0.01% +1 B 🔺
@sentry/aws-serverless 100.42 kB -0.01% -4 B 🔽
@sentry/cloudflare (withSentry) - minified 211.9 kB - -
@sentry/cloudflare (withSentry) 491.64 kB - -
@sentry/cloudflare (withSentry, instrumented CommonJS package) - minified 214.85 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 237.14 kB - -

View base workflow run

…no healthcheck

up --wait returns as soon as such a service starts, so the test would race
its startup. Drop the Bugbot rule the runner now enforces.

Refs #26852

Co-Authored-By: Francesco Gringl-Novy <2411343+mydea@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 2 not successful, 81 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Failing after 1m Details
❌ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Failing after 1m Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E nuxt-5 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E astro-7 (static trace lifecycle) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-4-sourcemaps (Vite server) Test (optional) Successful in 41s Details
✅ CI: Optional E2E Tests / E2E express-5 (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (bun) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 36s Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Successful in 51s Details
✅ CI: Optional E2E Tests / E2E deno (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions (latest) Test (optional) Successful in 28s Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (kv-cache) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E fastify-5 (bun) Test (optional) Successful in 36s Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (latest) Test (optional) Successful in 46s Details
✅ CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E express-5 (bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think Test (optional) Successful in 54s Details
✅ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-without-tracing-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (no upload) Test (optional) Successful in 29s Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps enabled by Sentry) Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 36s Details
✅ CI: Optional E2E Tests / E2E node-eve (content off) Test (optional) Successful in 59s Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (cloudflare) Test (optional) Successful in 38s Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (bun) Test (optional) Successful in 49s Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) Successful in 45s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 (MCP SDK OpenTelemetry) Test (optional) Successful in 27s Details
✅ CI: Optional E2E Tests / E2E nextjs-14-supabase Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E hono-5 (cloudflare) Test (optional) Successful in 48s Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (deno) Test (optional) Successful in 53s Details
✅ CI: Optional E2E Tests / E2E hono-5 Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E fastify-5 (deno) Test (optional) Successful in 46s Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 28s Details
✅ CI: Optional E2E Tests / E2E node-eve Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 34s Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 36s Details
✅ CI: Optional E2E Tests / E2E node-eve (0.x) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions Test (optional) Successful in 34s Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry (static trace lifecycle) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E hono-5 (bun) Test (optional) Successful in 45s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (development) Test (optional) Successful in 56s Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E hono-5 (deno) Test (optional) Successful in 51s Details
✅ CI: Optional E2E Tests / E2E express-5 (deno) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 32s Details
✅ CI: Optional E2E Tests / E2E solidstart-2-tunnel Test (optional) Successful in 53s Details
✅ CI: Optional E2E Tests / E2E vinext-cf-workers (workers cache) Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps (manual upload) Test (optional) Successful in 29s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 (delete all) Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E solidstart-2 (no upload) Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) Successful in 49s Details
✅ CI: Optional E2E Tests / E2E solid-2-ssr (cloudflare) Test (optional) Successful in 30s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps (no upload) Test (optional) Successful in 29s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps (delete all) Test (optional) Successful in 31s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel (cloudflare) Test (optional) Successful in 32s Details
✅ CI: Optional E2E Tests / E2E solidstart-2 (manual upload) Test (optional) Successful in 45s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react (latest) Test (optional) Successful in 1m Details

Ban process.version(s) and ctx/context.skip in suite tests, so they use
supports() from utils instead.

Refs #26852

Co-Authored-By: Francesco Gringl-Novy <2411343+mydea@users.noreply.github.com>
@sentry-junior sentry-junior Bot changed the title chore(lint): Enforce zero-baseline Bugbot rules with Oxlint chore(lint): Move mechanical Bugbot rules to lint and the test runner Nov 25, 2026
const upOutcome = (result: ReturnType<typeof spawnSync>): string =>
timedOut(result) ? `timed out after ${UP_TIMEOUT_MS}ms` : `exit ${result.status}`;

assertServicesHaveHealthchecks(cwd, composeArgs('config', '--format', 'json'));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this slow? can we make it faster?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not really. docker compose config only resolves the compose file and doesn't talk to the daemon. It took 200–310 ms per suite locally (about 250 ms median, 5.3 s across all 21). It runs once per describeWithDockerCompose group in beforeAll, not once per test, and the existing down + pull + up --wait in that same hook takes seconds to minutes.

The only faster in-process option is parsing the YAML ourselves, and this package has no YAML parser, so that means adding a dependency. Another option is a one-off CI script that checks every compose file up front instead of the runner, but then a local run of a new suite wouldn't catch a missing healthcheck. I'd keep it as is, unless you'd rather go the CI script route.

@mydea
mydea requested a review from s1gr1d November 25, 2026 10:54
@mydea
mydea marked this pull request as ready for review November 25, 2026 10:54
Comment thread packages/browser-utils/.oxlintrc.json Resolved
@mydea
mydea merged commit 3069940 into develop Nov 25, 2026
500 of 502 checks passed
@mydea
mydea deleted the feat/bugbot-rules-to-lint branch November 25, 2026 12:24
mydea added a commit that referenced this pull request Nov 25, 2026
## What

The check from #26854, that every
docker-compose service has a healthcheck, now runs as one static test
(`suites/docker-compose.test.ts`). The test parses the compose files
with `yaml` instead of running `docker compose config` before every
Docker suite. `yaml` is a new devDependency of node-integration-tests.
It was already in the lockfile as a transitive dependency.

## Why

The per-suite `docker compose config` spawn could hit its 10s timeout on
a slow runner. When it did, it failed the suite with an empty error
([job](https://github.com/getsentry/sentry-javascript/actions/runs/45631694816/job/139267746094)).
Linting a YAML file doesn't need Docker. A static test also runs once
instead of once per suite, and it names the file that's wrong.

Part of #26852

<!-- junior-request-attribution:start -->
via @mydea.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Ad72f31cba93f4e84e882d2b860cda943 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Ad72f31cba93f4e84e882d2b860cda943)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Ad72f31cba93f4e84e882d2b860cda943/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Francesco Gringl-Novy <2411343+mydea@users.noreply.github.com>
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.

2 participants