Skip to content

feat: always run Composer through the unified Prisma CLI - #11

Merged
kristof-siket merged 5 commits into
mainfrom
feat/unified-prisma-cli
Aug 21, 2026
Merged

feat: always run Composer through the unified Prisma CLI#11
kristof-siket merged 5 commits into
mainfrom
feat/unified-prisma-cli

Conversation

@kristof-siket

@kristof-siket kristof-siket commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Note

Ready to merge. prisma@8.0.0-rc.7 is published embedding Composer 0.11.0 (verified on npm), and the prisma-version default here points at that release. This PR merges before pdp-control-plane#4969, which waits for this action to ship.

Release steps after merge: smoke-test one fixture repository with its workflow pinned to the merge SHA (exercises the bunx prisma@8.0.0-rc.7 fallback), then move the v1 tag. Moving v1 migrates existing repositories off the dying @prisma/composer-cli path in place; their workflows need no edits.

Why

The platform is consolidating on the unified prisma CLI (Prisma 8), which mounts the Composer command family as prisma composer deploy|destroy …. The standalone @prisma/composer-cli will stop shipping, and generated setup PRs will install prisma as the devDependency instead.

So the action stops choosing between CLIs. #10 proposed probing for the unified CLI and keeping both paths alive; with the consolidation decided, there is only one CLI to run. Every deploy and destroy now goes through prisma composer.

What

  • composer-version is removed (not deprecated): an undeclared input only warns in workflow runs, and a visible warning beats a silently ignored value. Existing workflows that set it keep running.

  • main.mjs: the selection keys off node_modules/.bin/prisma in the working directory.

    • Present → bun run --bun prisma composer <deploy|destroy> … (log label composer=local prisma CLI (bun run --bun)).
    • Absent → bunx --bun -p prisma@<prisma-version> prisma composer <deploy|destroy> … (label names the version).
    • --bun stays on both paths: the converge child Composer spawns must run under Bun (fix: run the local Composer bin with bun run --bun so the converge child runs under Bun too #8). Stage and module still travel as argv-array entries, never through a shell.
  • cli.mjs replaces composer.mjs; tests/cli.test.mjs replaces tests/composer.test.mjs with the same node:test style — local bin → bun run, absent → bunx with the input version, and verbatim arg pass-through for deploy and destroy.

  • action.yml: new prisma-version input, defaulting to the released 8.0.0-rc.7. composer-version is removed from the declared inputs.

  • README.md: phases paragraph and inputs table updated. Repositories with a prisma devDependency deploy with their own installed version; everything else uses the pinned fallback.

  • ci.yml: the action.yml sanity check now also requires prisma-version.

Untouched: build-command: none, OIDC/credential resolution, build reporting, and the post-step teardown wiring.

Compatibility with pre-swap repositories

Repositories generated before the devDependency swap pin @prisma/composer-cli and carry no prisma bin, so they take the bunx fallback. Their prisma-composer.config.ts files have no orm section, and the unified CLI reads them the same way — they keep deploying without a regenerated setup PR.

composer-version is not removed: deleting a declared input is a breaking change for existing workflows that set it (GitHub warns on unexpected inputs). It stays declared with a deprecation line in its description and is never read.

Open question for the operator

Should the bunx fallback be removed once the fleet regenerates onto the prisma devDependency, or kept permanently for hand-written workflows that never carry a local CLI? Removing it later makes the local bin a hard requirement; keeping it means prisma-version needs occasional bumps.

Tests

  • node --test tests/*.test.mjs — 45 tests, all pass (was 44: −4 composer selection, +5 CLI selection).
  • node --check main.mjs / post.mjs / credentials.mjs — pass; action.yml and ci.yml parse, and the updated sanity check passes.
  • Offline smoke of main.mjs with stubbed bun/bunx on PATH (the same drill as feat: run Composer under Bun for all repos #7/fix: run the local Composer bin with bun run --bun so the converge child runs under Bun too #8):
    • deploy, local bin present → $ bun run --bun prisma composer deploy module.ts --stage feat/smoke, exit 0.
    • destroy, no local bin → $ bunx --bun -p prisma@8.0.0-rc.7 prisma composer destroy module.ts --stage feat/smoke, exit 0.
  • Not tested: a real deploy against the platform — blocked on the same release this PR waits for.

Release (after the blockers clear)

Tag a new minor and move v1, as with previous interface changes. Generated workflows need no edit; the CLI swap arrives through the moved tag.

🤖 Generated with Claude Code

kristof-siket and others added 4 commits August 20, 2026 14:52
The platform is consolidating on the unified prisma CLI, which mounts the
Composer command family as prisma composer. The standalone
@prisma/composer-cli stops shipping, so the action stops choosing between
CLIs: a repo with a local prisma bin runs it via bun run --bun; every
other repo gets the pinned prisma package via bunx. The new prisma-version
input pins that fallback; composer-version stays declared but is ignored,
because removing an input breaks workflows that set it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
An undeclared input only produces a workflow warning, and a visible warning
beats a silently ignored value. The unified CLI version comes from the
repository's prisma devDependency, with prisma-version as the bunx fallback.
@kristof-siket
kristof-siket marked this pull request as ready for review August 20, 2026 15:01
First release whose embedded Composer reads the generated files.
@kristof-siket
kristof-siket merged commit 54c75da into main Aug 21, 2026
5 checks passed
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