Commit f40190e
authored
A release of the CLI depends only on released product versions (#192)
## The defect
`prisma@8.0.0-rc.3` shipped depending on `@prisma/composer@0.6.0-dev.16`
and `@prisma/orm-toolchain@8.0.0-rc.1-dev.40` — dev builds, in a
release. Two reasons, and neither was a decision:
1. **Nothing checked.** Conformance verified import purity, validators,
and tarball installs. Nothing looked at whether a shipped dependency was
a dev build, so interim pins from earlier slices sat in the manifest
until a release publish carried them to the registry.
2. **The automation that would have moved them has never run.**
`auto-repin.yml` followed each product's release dist-tag, so it would
have moved these pins onto real releases — but it needed a token that
was never provisioned, so it never executed once.
## The rule, and how it is kept
Operator ruling (2026-08-17): **a non-dev CLI depends on the latest
non-dev composer and ORM; a dev CLI depends on their latest dev
builds.**
- The **committed manifests hold the released versions**, kept current
by `update-product-versions.yml`. `main` therefore stays releasable, and
every version change arrives as a pull request CI has tested. A release
publish uses those pins exactly as committed, so a release is
reproducible from its tag.
- A **dev publish rewrites them** to each product's `dev` dist-tag in
CI, ephemerally — the same treatment the CLI's own version already gets.
Build and conformance run after the rewrite, in the same run, so a
broken product dev build fails the dev publish instead of shipping
inside it.
- **Check 4 of the conformance suite refuses a release whose
dependencies include a `-dev.` version.** It takes the channel from
`determine-version.ts`, and it has no exception mechanism on purpose: a
suppressed finding exits 0, which is exactly how rc.3 shipped.
One script serves both channels (`--channel release|dev`), so the two
cannot drift apart. It now edits `packages/prisma/package.json` as well
as `packages/cli/package.json` — the old one ignored the unscoped
package, whose dependency list must match.
## The shell moves to `@prisma/composer-cli`
`@prisma/composer` dropped its `./family` export when composer split its
CLI out, so the old pin only worked because it was a dev build from
*before* the split. The shell and `packages/prisma` now depend on
`@prisma/composer-cli@0.6.0-dev.22`, which declares `@prisma/cli-engine`
as an exact peer at `0.1.1` — the version this repo ships. That removes
one of the two engine copies an install resolved, and composer's
recorded pin exception is deleted.
The engine-pin check now reads a family's `peerDependencies` as well as
its `dependencies`. Without that it would have silently stopped
measuring composer the moment composer did the right thing.
`@prisma/composer` stays as a devDependency: the startup probe imports
it to prove the eager-loading detector works, and pnpm's strict layout
will not resolve an undeclared package.
## Consequence: releases are blocked, correctly
Neither product has published a non-dev version this CLI can use, so
check 4 fails the release channel today. That is the check working. What
each product needs to publish:
- **`@prisma/composer-cli@0.6.0`** — its only non-dev version — **cannot
be installed at all.** It was published with `npm publish` instead of
`pnpm publish`, so its dependency on `@prisma/composer` is the literal
string `workspace:0.6.0`; `npm install @prisma/composer-cli@0.6.0` fails
with `EUNSUPPORTEDPROTOCOL`. Composer needs to publish with `pnpm
publish` from a commit that peers the engine at the shipped version
(`0.6.0-dev.22` already does). Composer's repo has no check that
installs its own tarball, which is how this reached the registry; check
3 here catches exactly that class and is worth porting.
- **`@prisma/orm-toolchain@8.0.0-rc.1`** has no engine relationship, and
its `./cli` export contains no `ormCommandFamily` — only
`createContractEmitCommand`, `createFormatCommand`,
`loadContractFromTs`. The engine-based family exists only in dev builds,
and the newest of those went back to declaring the engine at `0.0.9`.
prisma/prisma needs to adapt to the current engine and publish that as a
release.
The ORM's engine-pin exception is the last one left; it dies with that
publish, after which the check can move from pin equality to peer
satisfaction. Recorded in `deferred.md`.
## Also here
- `DEPLOY_GITHUB_TOKEN` replaces `REPIN_PAT`, and the workflow is
renamed from `auto-repin` to `update-product-versions`.
`docs/oss/release-automation.md` is new: what the token is for, why it
belongs to a service account, the exact permissions, the notification
step each product repo needs, and a table of failure modes. The token is
provisioned in all three repositories.
- The workflow closes any earlier open version-update pull request
before opening a new one. Two of them race each other's auto-merge and
one lands on a stale lockfile.
- `minimumReleaseAgeExclude` entries become per-package. They named
exact interim versions, so every version change needed an edit here too.
- `turbo.json` declares `PUBLISH_CHANNEL` for the conformance task.
turbo passes only declared variables through, so undeclared it would
have read `release` in every run — found by running it.
## Verification
- `pnpm lint`, `pnpm typecheck`, `pnpm test` (979 tests), `pnpm
test:scripts` (63) all pass.
- `PUBLISH_CHANNEL=dev pnpm check:conformance`: 0 failing, 2 allowed —
the ORM's engine mismatch, on the record.
- `PUBLISH_CHANNEL=release pnpm check:conformance`: 4 failing, one per
dev dependency per published package. This is what would have stopped
rc.3.
- The `@prisma/composer-cli@0.6.0` install failure was reproduced in a
clean sandbox, not inferred from its manifest.
---------
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>1 parent bb79d8f commit f40190e
30 files changed
Lines changed: 1294 additions & 397 deletions
File tree
- .drive/projects/prisma-cli-v8
- .github/workflows
- docs
- architecture/adrs
- oss
- packages
- cli-conformance
- src
- checks
- tests
- cli
- scripts
- src
- tests
- fixtures
- prisma
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
122 | 128 | | |
| 129 | + | |
| 130 | + | |
123 | 131 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
117 | 126 | | |
118 | 127 | | |
119 | 128 | | |
| |||
123 | 132 | | |
124 | 133 | | |
125 | 134 | | |
| 135 | + | |
126 | 136 | | |
127 | 137 | | |
128 | 138 | | |
| |||
141 | 151 | | |
142 | 152 | | |
143 | 153 | | |
144 | | - | |
145 | | - | |
146 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
147 | 157 | | |
148 | 158 | | |
149 | 159 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
156 | 169 | | |
157 | 170 | | |
| 171 | + | |
| 172 | + | |
158 | 173 | | |
159 | 174 | | |
160 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
0 commit comments