Skip to content

Config evaluation works through pnpm symlink layouts; engine 0.2.1 - #222

Merged
wmadden-electric merged 2 commits into
mainfrom
claude/config-eval-pnpm-symlink-4fa2e0
Aug 24, 2026
Merged

Config evaluation works through pnpm symlink layouts; engine 0.2.1#222
wmadden-electric merged 2 commits into
mainfrom
claude/config-eval-pnpm-symlink-4fa2e0

Conversation

@wmadden-electric

Copy link
Copy Markdown
Contributor

What

Any project whose node_modules reaches @prisma/cli-engine through a pnpm symlink that is not realpath'd — this repo's own dev checkout, and any install with hoist=false in .npmrc — cannot evaluate any prisma.config.ts: every config-reading command fails with CLI.CONFIG_UNREADABLE / Cannot find package 'pathe' imported from .../cli-engine/node_modules/c12/dist/index.mjs. npm and default-pnpm installs are unaffected.

Why: the engine loads c12 lazily with a bare await import("c12"). When that specifier resolves through a symlink without realpathing, c12's own import "pathe" walks up from the symlink path and misses c12's store siblings.

Changes

  • The fix: the engine imports c12 through its real path (import.meta.resolverealpathSyncpathToFileURL). Evaluation errors still surface as the existing unreadable-config diagnostic.
  • Import purity: the module lexer cannot see import.meta.resolve, so the engine's conformance subjects excuse c12 explicitly via allowedUnimported: ["c12"] (conformance script ×2, engine conformance test). The tarball check gains the per-package allowedUnimported field.
  • Engine 0.2.1 (pnpm bump-cli-engine-version patch): the changed engine must ship under a new version. The registry families still peer 0.2.0, so the tarball check carries two recorded transition exceptions; the follow-up PR that pins the families' 0.2.1-peering releases removes them (same train as the 0.2.0 transition, Engine 0.2.0: the changed engine must ship, and CI now forces the bump #200chore(release): bump to 8.0.0-rc.5 #207).
  • The deferred ledger entry tracking this defect is removed.

Verification

  • Dev-layout A/B: with a marked prisma.config.ts in a scratch dir, node packages/cli/dist/cli.js migration list built from main fails with the pathe error; built from this branch it evaluates the config (remaining error is the expected absent-orm-section complaint).
  • Packed @prisma/cli + engine tarballs installed with pnpm and hoist=false: config evaluates — the previously broken published shape.
  • pnpm run conformance (packages/cli): 0 failing, 3 allowed (the recorded transition mismatches), 5 subjects.
  • Engine suite 819 passed; CLI suite 831 passed; conformance package tests 59 passed; credential-free e2e passed; check-engine-version.mjs origin/main: 0.2.1 consistent; typecheck and grammar green.

After merge

  1. main's publish run ships @prisma/cli-engine@0.2.1.
  2. prisma/composer and prisma/prisma release @prisma/composer-cli and @prisma/orm-toolchain peering 0.2.1.
  3. A follow-up PR here pins those releases and empties the exception list.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 46 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a211767f-b30a-4cbc-bb85-2f108f4af546

📥 Commits

Reviewing files that changed from the base of the PR and between 28c9835 and 784c585.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • .drive/projects/prisma-cli-v8/deferred.md
  • packages/cli/package.json
  • packages/prisma/package.json

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 97e12cd4-a3e7-4abf-9639-9e2b71ca195e

📥 Commits

Reviewing files that changed from the base of the PR and between b02432d and 28c9835.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • .drive/projects/prisma-cli-v8/deferred.md
  • packages/cli-conformance/src/checks/tarball.ts
  • packages/cli-engine/package.json
  • packages/cli-engine/src/config-loader.ts
  • packages/cli-engine/tests/conformance.test.ts
  • packages/cli/package.json
  • packages/cli/scripts/conformance.ts
  • packages/prisma/package.json
💤 Files with no reviewable changes (1)
  • .drive/projects/prisma-cli-v8/deferred.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Summary by CodeRabbit

  • Bug Fixes

    • Improved configuration loading reliability when using built CLI distributions, including configurations located in monorepos.
    • Updated validation to correctly support dynamic module resolution during packaged CLI checks.
  • Chores

    • Updated CLI engine package versions across the CLI and Prisma packages.
    • Refined package validation for approved dependency exceptions and temporary release transitions.
    • Removed an outdated investigation note related to module resolution.

Walkthrough

The CLI engine now resolves c12 through its real filesystem path before importing configuration files. Import-purity checks support allowed dynamically reached dependencies, including c12. Tarball conformance records temporary version-pin exceptions. The CLI engine version changes to 0.2.1, and dependent packages update their workspace references. The deferred pathe investigation is removed.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the config evaluation fix through pnpm symlink layouts and the CLI engine version update.
Description check ✅ Passed The description directly explains the symlink-related config evaluation failure, the real-path import fix, version update, conformance changes, and verification.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
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)
  • Create PR with unit tests
  • Commit unit tests in branch claude/config-eval-pnpm-symlink-4fa2e0
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/config-eval-pnpm-symlink-4fa2e0

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@pkg-pr-new

pkg-pr-new Bot commented Aug 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

npx https://pkg.pr.new/@prisma/cli@222
npx https://pkg.pr.new/@prisma/cli-engine@222

commit: 784c585

Under pnpm symlink layouts that are not realpath'd (this repo's dev
checkout; any install with hoist=false), resolving the bare specifier
"c12" lands on a symlink path from which c12's own imports miss its
store siblings, and every config file reports CLI.CONFIG_UNREADABLE
with "Cannot find package 'pathe'". Importing c12 via
import.meta.resolve plus realpath fixes resolution in both layouts;
errors still surface as the unreadable-config diagnostic.

The module lexer no longer sees a literal import of "c12", so the
import-purity checks excuse it explicitly: the engine subject and the
engine tarball entry in the CLI's conformance script, and the engine's
own conformance test. The tarball check learns a per-package
allowedUnimported field for this.

Also removes the deferred ledger entry that tracked this defect.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
pnpm bump-cli-engine-version patch — the c12 resolution change is
compatible, and published engine versions are immutable, so the changed
engine needs a new version. The families on the registry still peer
engine 0.2.0, which they must until 0.2.1 publishes, so the tarball
check carries two recorded exceptions for the transition; the follow-up
PR that pins the families' 0.2.1-peering releases removes them.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@wmadden-electric
wmadden-electric force-pushed the claude/config-eval-pnpm-symlink-4fa2e0 branch from 28c9835 to 784c585 Compare August 24, 2026 13:07
@wmadden-electric
wmadden-electric merged commit 42f09b9 into main Aug 24, 2026
14 checks passed
@wmadden-electric
wmadden-electric deleted the claude/config-eval-pnpm-symlink-4fa2e0 branch August 24, 2026 13:11
wmadden pushed a commit that referenced this pull request Aug 25, 2026
## At a glance

```bash
# before this PR merges
npm install prisma        # -> 7.9.1  (Prisma 7)
npm install prisma@next   # -> 8.0.0-rc.9

# after this PR merges
npm install prisma        # -> 8.0.0-rc.10  (the unified v8 CLI)
```

## The decision

We are cutting the bare `prisma` npm name over to the v8 line. Until
now, every 8.0.0-rc release published under the `next` dist-tag and
`latest` kept serving Prisma 7, so nobody landed on v8 without asking
for it. The operator ruled today (2026-08-25) that the RC line is ready
to be what a bare `npm install prisma` gets. The version number does not
change meaning: we stay on `8.0.0-rc.N` (this release is rc.10), and
GitHub Releases remain marked pre-release. Only the dist-tag policy
moves.

## How the flip actually happens

In this repo, merging a version-bump PR is the act that publishes: the
push to `main` carries a changed root version, and the publish workflow
ships it under the tag `releaseDistTag()` returns. This PR widens that
function so every release — RC or stable — publishes under `latest`.
**Merging this PR is therefore the cutover itself**: it bumps rc.9 →
rc.10 and the resulting publish moves `latest` on `prisma` and
`@prisma/cli` in one deliberate, reviewable act.

## What rc.10 ships (since rc.9)

- Config files evaluate correctly when the CLI is reached through pnpm
symlink layouts that are not realpath'd (#222) — previously every
config-reading command failed with `CLI.CONFIG_UNREADABLE` in those
setups.
- The engine's CI detector is exported and the skills staleness notice
uses it, so Jenkins/TeamCity/Azure pipelines stop seeing the notice in
their logs (#224).
- The `prisma init` scaffold fixes (#225).
- Current command-family releases, both peering the exact engine this
repo ships (`@prisma/cli-engine@0.2.3`), so one engine resolves per
install and the conformance exception list is empty again:
`@prisma/composer-cli@0.14.0` and `@prisma/orm-toolchain@8.0.0-rc.7`
(which carries the PostgreSQL temporal-codec representations and the
`limit`/`offset` pagination rename).

## What happens to the `next` tag and to v7 users

- `next` is retired: the publish path no longer moves it, and
`scripts/cutover-dist-tags.sh` (operator-run) removes it from all three
names and fixes the engine's stale tags. Text that says `prisma@next`
should move to plain `prisma` — after this merge they resolve the same
thing anyway, until the tag is removed.
- Existing v7 installs are untouched: lockfiles pin resolved versions,
and `prisma@7.9.1` stays installable by version. The v7 train's new
publish home (`prisma7`) is being handled separately and does not block
this.

## Alternatives considered

- **A one-off `workflow_dispatch` with `dist-tag: latest`** — moves
`latest` once, but every subsequent RC release would publish under
`next` again and leave `latest` stale on rc.10. The widened rule makes
the routine release path keep `latest` current.
- **Waiting for stable `8.0.0`** — the rollout plan always left the flip
timing to an operator judgement after an RC soak, not to the stable
release; the operator ruled the soak is over.
- **Keeping `next` synced to `latest`** — considered so existing
`prisma@next` instructions would keep resolving the newest release, and
dropped: re-pointing a tag on an already-published version cannot
authenticate over OIDC, and npm's granular tokens go no narrower than
package write — a standing sync would mean a standing publish-capable
token, defeating the repo's OIDC-only invariant. Retiring the tag is the
honest alternative.

## Verification

Script tests green (33/0 on determine-version-utils). Conformance with
the empty exception list: **5 subjects checked, nothing to report**, on
both the release and dev channels. Lint and the CLI/engine suites green.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
birhantprkc pushed a commit to birhantprkc/prisma that referenced this pull request Aug 25, 2026
…ne@0.2.2 (prisma#30111)

prisma-cli published `@prisma/cli-engine@0.2.2`: config evaluation works
through pnpm symlink layouts that are not realpath'd
(prisma/prisma-cli#222) and the engine's CI detector is exported
(prisma/prisma-cli#224). The registry's 0.2.0 predates both; 0.2.1 is
skipped — no family released against it. `@prisma/orm-toolchain`
declares the engine as an exact peer, so it must release against the
engine version the `prisma` bin will ship.

- Every `@prisma/cli-engine` reference moves 0.2.0 → 0.2.2 (manifests,
fixtures, examples, the init-journey harness literal).
- `pnpm bump-version`: 8.0.0-rc.5 → 8.0.0-rc.6, stamped across the
workspace.
- Release notes at `docs/releases/v8.0.0-rc.6.md` (`check:release-notes
--mode pr` passes) plus the matching `CHANGELOG.md` entry, covering
prisma#30096 and prisma#30097 — the two PRs merged since rc.5 — and the engine move.
- `check:upgrade-coverage` passes in both modes.

Merging publishes the release under `latest`, which unblocks the
prisma-cli PR that pins it and removes the engine-transition exceptions.
The composer half of the train is prisma/composer#256.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Bundled `prisma-8` skills and upgrade guidance are now included in ORM
package tarballs.
  * Skill setup is now handled through `prisma init`.

* **Breaking Changes**
* PostgreSQL temporal columns now use explicit `Temporal` or text
representations instead of `Date`.
* `prisma orm init` no longer installs skills or supports
`--skip-skills`.

* **Documentation**
* Added `8.0.0-rc.6` release notes and upgrade instructions, including
contract artifact updates and temporal migration examples.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
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.

1 participant