Skip to content

test(node): Add Prisma 8 integration test suite - #24681

Open
chargome wants to merge 1 commit into
developfrom
feat/prisma-8-tests
Open

chargome wants to merge 1 commit into
developfrom
feat/prisma-8-tests

Conversation

@chargome

@chargome chargome commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Prisma 8 ("Prisma Next", rc.8) has no tracing surface, so prismaIntegration is inert there. This suite pins what we get today: only the pg query spans from postgresIntegration.

  • Generated contract.json/init.sql are committed: the Prisma 8 CLI needs Node ≥ 22.18 and breaks npm's peer resolution.
  • The runner's ESM-to-CJS converter now drops with { type: 'json' } import attributes.

Refs #24237

@chargome
chargome added this pull request to stack #24684 September 24, 2026 09:07
@chargome chargome self-assigned this Sep 24, 2026
@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 29.24 kB - -
@sentry/browser - with treeshaking flags 27.5 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.4 kB - -
@sentry/browser (incl. Tracing) 51.15 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.17 kB - -
@sentry/browser (incl. Tracing, Profiling) 54.18 kB - -
@sentry/browser (incl. Tracing, Replay) 90.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.86 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 95.46 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 108.41 kB - -
@sentry/browser (incl. Feedback) 46.76 kB - -
@sentry/browser (incl. sendFeedback) 34.3 kB - -
@sentry/browser (incl. FeedbackAsync) 39.41 kB - -
@sentry/browser (incl. Metrics) 30.25 kB - -
@sentry/browser (incl. Logs) 30.51 kB - -
@sentry/browser (incl. Metrics & Logs) 31.18 kB - -
@sentry/react 31 kB - -
@sentry/react (incl. Tracing) 53.45 kB - -
@sentry/vue 36.74 kB - -
@sentry/vue (incl. Tracing) 53.7 kB - -
@sentry/svelte 29.26 kB - -
CDN Bundle 30.93 kB - -
CDN Bundle (incl. Tracing) 51.69 kB - -
CDN Bundle (incl. Logs, Metrics) 33.2 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.66 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.92 kB - -
CDN Bundle (incl. Tracing, Replay) 89.28 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.25 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 95.45 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 97.42 kB - -
CDN Bundle - uncompressed 91.4 kB - -
CDN Bundle (incl. Tracing) - uncompressed 153.77 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.97 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 159.73 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.54 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 273.5 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 279.44 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.2 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 293.13 kB - -
@sentry/nextjs (client) 55.77 kB - -
@sentry/sveltekit (client) 51.59 kB - -
@sentry/core/server 39.95 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 134.08 kB +0.01% +11 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.43 kB - -
@sentry/node - without tracing 90.46 kB +0.02% +17 B 🔺
@sentry/node - without channel injection 112.59 kB +0.01% +11 B 🔺
@sentry/aws-serverless 98.72 kB +0.01% +4 B 🔺
@sentry/cloudflare (withSentry) - minified 206.49 kB - -
@sentry/cloudflare (withSentry) 513.73 kB - -

View base workflow run

@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@chargome
chargome marked this pull request as ready for review September 24, 2026 12:03
@chargome
chargome requested a review from a team as a code owner September 24, 2026 12:03
@chargome
chargome requested review from JPeer264, andreiborza and isaacs and removed request for a team September 24, 2026 12:03
const db = prismaPostgres.default({ contractJson, url });
// With `require(esm)` the module-injection notice arrives on a later tick, so a call in the same
// tick as the require would run before the SDK subscribes to the channels.
await new Promise(resolve => setImmediate(resolve));

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.

m/q: Isn't that an issue users would face too?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, in one narrow case. A CJS app on Node 22 to 24.12 loads this ESM-only package through require(esm), which Node routes through the async module hooks. The hook thread transforms the file and posts the "module injected" notice over a message port, so the main thread only processes it on a later tick. An ORM call made in the very same tick as the require therefore runs before the SDK subscribes to the channels and gets no operation span; anything after the first await is covered. Real apps make their first query after startup, so I left it as a documented edge (also in the PR body of #24682). It is inherent to the async-hook path for any ESM-only dependency required from CJS, not Prisma specific; from Node 24.13 / 25.1 the sync hooks make it disappear. Happy to look at subscribing eagerly for that path in a follow-up if we think it matters.

await db.orm.public.User.where(user => user.email.like('%sentry.io')).delete();

setTimeout(async () => {
span.end();

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.

l/q: Is this span.end() needed in this scenario? Since setTimeout is not blocking and would have ended the span by then already

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right, that end was a no-op. Removed the timer and the manual end; the span ends when the callback resolves, and db.close() now runs after it.

@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Prisma 8 ("Prisma Next") ships no tracing surface, so `prismaIntegration`
is inert there and only the `pg` query spans remain. Pin that behaviour
against 8.0.0-rc.8 so a Prisma release that adds a tracing surface, or
breaks the `pg` path, shows up.

The emitted `contract.json` and an `init.sql` dumped from `prisma-cli db
init` are committed: the Prisma 8 CLI needs Node 22.18+ and breaks npm's
peer-dependency resolution. The contract has no `DateTime` column, since
Prisma 8 decodes timestamps into `Temporal`, global only on Node 26.

The runner's ESM-to-CJS converter now drops `with { type: 'json' }`
import attributes so the scenario can import the contract.

Refs #24237
Co-Authored-By: Claude Fable 5.1 <[email protected]>
@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 5430d50. Configure here.

This branch has not been deployed

No deployments
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