Repository navigation
chore(deps): CI runs Composer under the prisma CLI users install today (8.0.0-rc.39), with one copy of the ORM and of Composer - #485
Conversation
…r packages, and the temporary ORM toolchain override is deleted prisma 8.0.0-rc.39 depends on the ORM 8.0.0-rc.28 packages and @prisma/cli-engine 0.10.4, the versions this workspace pins, so the root prisma>@prisma/orm-toolchain override is no longer needed. It also now depends on @prisma/composer and @prisma/composer-prisma-cloud 0.41.2, which its own deploy code imports. Root pnpm overrides point both at the workspace packages, as @prisma/composer-cli already is, so the host loads one copy of @prisma/composer and CI tests the workspace code rather than the last release. The root also declares @prisma/composer-prisma-cloud as a devDependency, like the other two, so its link sits beside the hoisted host. @prisma/compute-sdk moves to 0.47.0 with the host. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
…rkspace @prisma/composer and @prisma/composer-prisma-cloud A drifted override would leave the host loading the published copies beside the workspace ones while CI stays green. The check now resolves both packages from the installed host and fails unless each is the workspace package, as it already did for @prisma/composer-cli/family. The gotchas entry describes all three overrides. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
…ckage the installed host depends on The check now reads the installed prisma host's own dependencies instead of a hand-written list. Every workspace package among them must resolve from the host to the workspace package, so a host release that adds one fails until the root has its override and devDependency. Every other @prisma package the host shares with a workspace package (the engine, the ORM packages, the Management API SDK) must be one copy, which replaces the engine-only comparison and covers the ORM now that the toolchain override is gone. The header and the gotchas entry no longer suggest CI runs the host's own deploy path; .drive/deferred.md records that gap. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
…talled copy of a shared package A workspace package that names a shared @prisma package only as a peer has no copy of its own, and was reported as loading a different copy "at none". Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
|
✅ Gizmo reviewed 99dfd6f — posted 0 inline comment(s) this pass. Open findings: none Change walkthroughThis PR retargets CI from Workspace wiring. The root package.json drops the Guard. scripts/check-cli-engine-pin-host.mjs replaces its two hardcoded assertions with a general rule driven by the installed host's Incremental delta (this pass). scripts/check-cli-engine-pin-host.test.mjs gains one test covering the previously untested branch of Docs. .drive/deferred.md records the deleted override and the check's blind spot (nothing in CI exercises the host's own no-config deploy path); the gotchas/dependabot notes now describe all three overrides. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
commit: |
…nds on that is not installed Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
At a glance
The examples, the website and the integration tests in this repository run the published
prismaCLI, which this repository calls the host. Its version is pinned once, in thecatalogofpnpm-workspace.yaml. This pull request moves the pin from 8.0.0-rc.35 to 8.0.0-rc.39, the release users get from npm today. The rootpackage.jsonchanges with it:"devDependencies": { "@prisma/composer": "workspace:0.41.2", "@prisma/composer-cli": "workspace:0.41.2", + "@prisma/composer-prisma-cloud": "workspace:0.41.2", }, "pnpm": { "overrides": { + "@prisma/composer": "workspace:*", "@prisma/composer-cli": "workspace:*", - "@prisma/cli-engine": "0.10.4", - "prisma>@prisma/orm-toolchain": "8.0.0-rc.28" + "@prisma/composer-prisma-cloud": "workspace:*", + "@prisma/cli-engine": "0.10.4" },The check that guards this setup now reads the host's own dependencies, and passes only if the host loads the workspace's Composer packages and one copy of each Prisma package it shares with the workspace:
Linked issue
n/a: small change.
Summary
CI should test Composer under the
prismaCLI that users run, and until now it ran an older one that needed a workaround to install only one copy of Prisma ORM. With rc.39 the workaround (theprisma>@prisma/orm-toolchainoverride above) is deleted, and two new overrides keep the host on the workspace's own Composer code.Testing performed
Each command was run only on the files and packages this change touches:
node --test scripts/check-cli-engine-pin-host.test.mjs: 14 tests pass. They include a host dependency on a workspace package with no override, a second copy of an ORM package nested under the host, a package that a workspace package names only as a peer, a shared package that is not installed, and several failures reported together.pnpm check:cli-engine-pinpasses on the real install. It fails, naming the package, when a second copy of@prisma/composer,@prisma/orm-toolchainor@prisma/management-api-sdkis placed beside the host (each was removed afterwards), and when the@prisma/composer-prisma-cloudoverride is removed and the tree reinstalled.node scripts/lint-orm-pins.mjs(36 specifiers, all 8.0.0-rc.28) andnode --test scripts/check-orm-pins.test.mjspass.prisma contract emitinexamples/orm-demoworks without the deleted override and leaves the committed contract unchanged.pnpm typecheckin that example passes.pnpm install --frozen-lockfilepasses.Checklist
git commit -s) per the DCO.Notes for the reviewer
Why the old override can go. The rc.35 host depends on
@prisma/orm-toolchain(the ORM package with its CLI commands and migration tools) at 8.0.0-rc.25, while the workspace is on Prisma ORM 8.0.0-rc.28. With two ORM versions installed,prisma contract emitfailed, so the override forced the host onto the workspace's toolchain. rc.39 depends on ORM 8.0.0-rc.28 and on@prisma/cli-engine0.10.4 (the CLI framework the host and Composer's commands share), the versions the workspace already pins. So nothing needs forcing.Why two overrides are added. The workspace already redirects the host's
@prisma/composer-cli(the package of Composer'sprismacommands) to the workspace package, so CI tests the workspace's commands rather than the last release. Since rc.37 (per its publishedpackage.json) the host also depends on@prisma/composerand@prisma/composer-prisma-cloud: its ownprisma deployfor a repository without a Composer config imports both, and hands a config built with@prisma/composerto@prisma/composer-cli. Without overrides, pnpm would install the published 0.41.2 copies beside the host, so one process would load two copies of@prisma/composer, and the host's deploy would run the last release instead of this repository's code.@prisma/composer-prisma-cloudalso becomes a root devDependency, as the other two already are, so its link sits in the rootnode_modules, where the host looks for it.How the check changed.
scripts/check-cli-engine-pin-host.mjsused to check two things: that the host resolves the workspace's@prisma/composer-cli, and that the two share one@prisma/cli-engine. It now reads the installed host'spackage.jsonand checks each dependency:@prisma/*dependency that a workspace package also declares must be the same copy from the host as from that package (a package that has no copy installed is skipped). This covers the engine, the ORM packages and@prisma/management-api-sdk, and it takes over the job the deleted override did: one copy of the ORM.It lists the workspace packages with
pnpm -r ls --depth -1 --json, and finds each package by its folder innode_modules, because@prisma/management-api-sdkdoes not export./package.json.What the check does not cover. It proves where packages resolve. Nothing in this repository runs the host's own no-config
prisma deploy, which uses Composer's public API, so a breaking change there would pass CI here and fail in the next host release..drive/deferred.md(the repository's list of deferred work) records this.gotchas.mdnow describes all three overrides. The comment in.github/dependabot.ymlnow says the host pins its own Composer and ORM packages, andpnpm-workspace.yamlloses its comment about the deleted override.Lockfile. Besides the override list, only
prisma, its new dependencies and@prisma/compute-sdk(0.43.0 to 0.47.0) change. There is one copy each of the engine, the Management API SDK and every@prisma/orm-*package, and no published@prisma/composer*package. Some keys now write@prisma/orm-toolchainwithout itsmagicastpeer inside another package's name; that is pnpm's own output (pnpm install --lockfile-only --fix-lockfilewrites the same), and every link points at an entry that exists.Alternatives considered.
@prisma/composerand@prisma/composer-prisma-cloud, and let them install from npm. Rejected: the host's deploy code would load the published@prisma/composerbeside the workspace's, in one process.Agent: saladin-14