Skip to content

fix(integration-tests): build the published @prisma/orm-* packages before typechecking the CLI journeys - #30418

Merged
wmadden merged 1 commit into
mainfrom
worktree/integration-tests-typecheck-flakes-5ed9ad
Sep 27, 2026
Merged

wmadden merged 1 commit into
mainfrom
worktree/integration-tests-typecheck-flakes-5ed9ad

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

At a glance

Turbo's task graph for the integration-tests typecheck, before and after, from pnpm turbo run typecheck --filter=integration-tests --dry=json:

before: integration-tests#typecheck depends on 59 builds, none of them @prisma/orm-*
after:  integration-tests#typecheck -> cli-journeys#build -> @prisma/orm-postgres#build
                                                          -> @prisma/orm-mongo#build
                                                          -> @prisma/orm-extension-pgvector#build
                                                          -> @prisma/orm-family-sql#build

A cold parallel pnpm typecheck:packages --force with the published packages' dist folders deleted failed before this PR with 18 errors like:

test/cli-journeys/data-type-defaults.e2e.test.ts(9,31): error TS2307: Cannot find module '@prisma/orm-postgres/contract/types' or its corresponding type declarations.

The same run passes twice in a row after this PR.

What this PR changes

  1. test/integration/package.json declares cli-journeys as a workspace devDependency.
  2. test/integration/test/cli-journeys/package.json declares @prisma/orm-family-sql, which the format journey already imported.

Why the typecheck raced the builds

test/integration is the integration-tests package. Its tsconfig.json includes test/**/*, so its typecheck task also typechecks test/cli-journeys/. Those journey files import the published packages a user's project installs: @prisma/orm-postgres, @prisma/orm-mongo and @prisma/orm-extension-pgvector.

Those packages are declared in a separate manifest, test/integration/test/cli-journeys/package.json (package name cli-journeys), not in test/integration/package.json. The split is deliberate: the journeys depend on the published packages, while the rest of test/integration depends on the internal workspace packages it tests directly.

Turbo derives task ordering from each package's own manifest. typecheck depends on ^build, the builds of the package's declared dependencies. Since integration-tests did not declare the published packages, Turbo never ordered their builds before integration-tests#typecheck. In a parallel run TypeScript could read @prisma/orm-postgres/dist while tsdown was rewriting it and report the declaration files as missing. Rerunning, running serially, or running the package alone all passed, which is why it looked like a flake.

The fix

integration-tests now declares cli-journeys as a workspace devDependency. cli-journeys has no build script, but Turbo still creates a cli-journeys#build node for it with no command, and that node depends on the builds of the packages cli-journeys declares. integration-tests#typecheck therefore waits for the published packages' builds through that node. The dependency is real: the typecheck of integration-tests really does need the journeys' dependencies, and this states it in the manifest instead of in a Turbo override. The cli-journeys manifest description records why the dependency exists.

The format journey also imported @prisma/orm-family-sql, which no manifest declared. It resolved only because pnpm hoists it as a transitive dependency of @prisma/orm-postgres. cli-journeys now declares it, so it gets the same build ordering.

Tests

No test files change. Verification was done by hand:

  • pnpm turbo run typecheck --filter=integration-tests --dry=json shows cli-journeys#build with the four @prisma/orm-* builds as its dependencies.
  • With the published packages' dist folders deleted, pnpm typecheck:packages --force failed on the base commit and passed twice after the change.
  • pnpm lint:deps passes.

Alternatives considered

  • Declare the published packages in test/integration/package.json. Undoes the manifest split described above.
  • A Turbo override naming the builds. Encodes a dependency the manifests do not state, so the next person to read the manifests would not see it.
  • Give cli-journeys its own tsconfig and typecheck script. The journeys import shared helpers from test/integration/test/utils/, which pull in a dozen @internal/* packages. cli-journeys would have to declare all of them, which contradicts the reason its manifest exists.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated integration test workspace dependencies and package descriptions to reflect the CLI journey tests and their workspace requirements. These changes affect test setup only; application functionality and user-facing behavior are unchanged.

…egration-tests typecheck

test/integration/tsconfig.json typechecks test/cli-journeys/**, but the
journeys import @prisma/orm-postgres, @prisma/orm-mongo and
@prisma/orm-extension-pgvector, which only the nested cli-journeys manifest
declares. Turbo builds task edges from each package's own manifest, so
integration-tests#typecheck never waited for those builds and a cold
parallel `pnpm typecheck:packages` could read a dist mid-rewrite and fail
with TS2307.

integration-tests now declares cli-journeys as a workspace devDependency.
Turbo creates a no-op cli-journeys#build node whose dependencies are the
published packages' builds, which orders them before the typecheck. The
two manifests keep their separate dependency shapes.

The format journey also imported @prisma/orm-family-sql, which no manifest
declared and which resolved only through hoisting. cli-journeys now
declares it.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden-electric
wmadden-electric requested a review from a team as a code owner September 25, 2026 10:13
@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: prisma/orm/.coderabbit.yml

Review profile: CHILL

Plan: Advanced

Run ID: c3d822a1-a82a-48d8-9846-3c2c7ba591a1

📥 Commits

Reviewing files that changed from the base of the PR and between 4f0a334 and 7133255.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • test/integration/package.json
  • test/integration/test/cli-journeys/package.json

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The integration workspace adds cli-journeys as a development dependency. Its package description explains that Turbo builds published packages before integration-tests#typecheck.

Changes

CLI journey typecheck setup

Layer / File(s) Summary
Declare the CLI journey typecheck dependency
test/integration/package.json, test/integration/test/cli-journeys/package.json
The integration workspace adds cli-journeys as a development dependency. The cli-journeys description explains its role in building published packages before typechecking.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: sevinf

Merge Risk: ⚪ Minimal · up to 71332

The dependency ordering covers the journey packages before integration typechecking; no actionable merge-blocking risk remains.

Architecture Summary

Architecture risk: 🔵 Low · up to 71332

The change affects 1 system.

Changed systems: test

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — test (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in test/integration/package.json: Reorders @repo/tsdown and @repo/tsconfig, and adds cli-journeys as a workspace dev dependency.
  • observed — Modified behavior in test/integration/test/cli-journeys/package.json: The description adds that integration-tests uses this package as a devDependency for journey typechecking, enabling Turbo to build the published packages before integration-tests#typecheck.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: ordering published @prisma/orm-* package builds before CLI journeys typechecking in integration-tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Sep 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@prisma/orm-extension-arktype-json

npm i https://pkg.pr.new/@prisma/orm-extension-arktype-json@30418

@prisma/orm-extension-middleware-cache

npm i https://pkg.pr.new/@prisma/orm-extension-middleware-cache@30418

@prisma/orm-extension-paradedb

npm i https://pkg.pr.new/@prisma/orm-extension-paradedb@30418

@prisma/orm-extension-pgvector

npm i https://pkg.pr.new/@prisma/orm-extension-pgvector@30418

@prisma/orm-extension-postgis

npm i https://pkg.pr.new/@prisma/orm-extension-postgis@30418

@prisma/orm-extension-supabase

npm i https://pkg.pr.new/@prisma/orm-extension-supabase@30418

@prisma/orm-family-mongo

npm i https://pkg.pr.new/@prisma/orm-family-mongo@30418

@prisma/orm-family-sql

npm i https://pkg.pr.new/@prisma/orm-family-sql@30418

@prisma/orm-framework

npm i https://pkg.pr.new/@prisma/orm-framework@30418

@prisma/orm-mongo

npm i https://pkg.pr.new/@prisma/orm-mongo@30418

@prisma/orm-postgres

npm i https://pkg.pr.new/@prisma/orm-postgres@30418

@prisma/orm-sqlite

npm i https://pkg.pr.new/@prisma/orm-sqlite@30418

@prisma/orm-target-mongo

npm i https://pkg.pr.new/@prisma/orm-target-mongo@30418

@prisma/orm-target-postgres

npm i https://pkg.pr.new/@prisma/orm-target-postgres@30418

@prisma/orm-target-sqlite

npm i https://pkg.pr.new/@prisma/orm-target-sqlite@30418

@prisma/orm-toolchain

npm i https://pkg.pr.new/@prisma/orm-toolchain@30418

commit: 7133255

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
postgres / no-emit 195.1 KB (0%)
postgres / emit 165.75 KB (0%)
mongo / no-emit 185.11 KB (0%)
mongo / emit 166.58 KB (0%)
cf-worker / no-emit 218.07 KB (0%)
cf-worker / emit 185.51 KB (0%)

@wmadden
wmadden added this pull request to the merge queue Sep 27, 2026
Merged via the queue into main with commit eaf9ab9 Sep 27, 2026
27 checks passed
@wmadden
wmadden deleted the worktree/integration-tests-typecheck-flakes-5ed9ad branch September 27, 2026 07:29
wmadden-electric added a commit that referenced this pull request Sep 27, 2026
Main's squash of #30405 duplicates the slice 5 head this branch already merged, so its conflicts resolve to this branch's side. The merge brings in only #30418 and #30435 (integration-test package scripts, journey teardown timeout, and their lockfile entries).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
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