Repository navigation
docs(drive): shape the consolidate-clis project (TML-3172) - #29909
Conversation
Land the shaping artifacts for the CLI-consolidation project: spec, plan, the accepted consolidated command-tree design, and the current-state inventory of the five existing CLIs. Refs: TML-3172 Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
|
|
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (6)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Slice contracts for the first two Phase 1 slices: routing all Prisma 8 migration/db commands through the control client, and building Composer's programmatic deploy API over @internal/assemble. Refs: TML-3172 Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
size-limit report 📦
|
…risma#29911) After this PR, no CLI command module reaches `@internal/migration-tools` at runtime — every operation goes through the control-api seam. At the top of a command module, the change looks like this: ```ts // before — commands/migrate.ts reaches business logic directly import { findLatestMigration, isGraphNode, parseContractRef } from '@internal/migration-tools/...'; // after — the same operations, through the seam; only published types remain importable import type { RefEntry, Refs } from '@internal/migration-tools/refs'; import { refuseMarkerOutsideGraph, resolveContractRef } from '../control-api/operations/...'; ``` Why this matters: the CLI implementation is destined to move to the consolidated `prisma` CLI repo while the control client stays here as the product's programmatic API. That move is only possible if commands hold no business logic — this PR makes the seam airtight. (Stacked on the project's shaping PR prisma#29909; the reviewable diff is the four TML-3173 commits.) ## How it's built up - **Fourteen command modules re-routed** (db-init, db-sign, db-update, migrate, the migration interrogatives, ref), plus the shared status-overlay helper. Command modules keep argv parsing and rendering; policy moves down. - **New control-api operations** wrap each migration-tools touchpoint together with its existing CLI error mapping, returning `Result<T, CliStructuredError>` (the established db-verify pattern): ref/contract resolution, graph queries, invariant refusals, caught-error mapping, snapshot resolution, safe refs read, ref advancement. - **Whole policy cores moved verbatim** where the command was mostly business logic (`ref`, `migration-new`, `migration-plan`, `migration-check`, `migration-list`, `migrate --show`), with render callbacks (`onContextResolved`, `onSeeded`, `onPreflightComplete`) so the commands still print at exactly the same points. - **Behavior is pinned, not asserted**: zero changes under `test/integration/` (~50 journey suites green), goldens untouched except one forced import repath, and the cast ratchet improves (841 → 837). ## Verification `@internal/cli` build + 1,423 package tests green; full integration suite 314/317 files green (the 3 failures are environmental: a host-timezone artifact that passes under `TZ=UTC`, and two hook timeouts that pass in isolation); `lint:deps`, `lint:casts` green. ## Caveat worth knowing The dependency-cruiser rule added here (`cli-commands-no-runtime-migration-tools`) is currently **dormant**: the repo's cruise excludes `node_modules`/`dist`, so no cross-package edges exist for any boundary rule to fire on — a pre-existing repo-wide blind spot (TML-3178). The operative enforcement is the runtime-import grep, which returns clean. Coverage of the moved cores is a known pre-existing gap tracked in TML-3179. ## Alternatives considered - *Route only enough to satisfy a lint* — rejected: the point is the host-repo port, so whole cores moved where commands were mostly policy. - *A bespoke import-scanner script instead of the dep-cruiser rule* — deferred: one declarative rule in the established tool beats another ad-hoc scanner; the blind spot that currently mutes it is filed to be fixed repo-wide (TML-3178). - *Renaming the moved `execute*Command` functions now* — deliberately not: keeping names makes the diff mechanically reviewable; renames come with the command→result→renderer reshape in the next slice. Refs: TML-3173 🤖 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** * Added shared capabilities for migration planning, checking, graph visualization, references, and contract resolution. * Added offline `migrate --show` planning with preflight results. * Improved migration creation, planning, status, listing, and reference workflows. * Expanded the public control API with migration and contract operations. * **Bug Fixes** * Standardized structured CLI error handling and validation for invalid paths, markers, invariants, and contract snapshots. * **Documentation** * Clarified error guidance for `db update` and invalid contract files. * **Tests** * Added comprehensive coverage for planning, references, graph validation, snapshot resolution, and error handling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]>
Shaping PR for the CLI-consolidation project: one
prismaCLI and oneprisma.config.tsacross Prisma 8, Composer, and the platform, before launch. Direction agreed Will/Luan 2026-08-05; this PR lands the artifacts for validation.What this adds
Four documents under
projects/consolidate-clis/:prismain prisma/prisma-cli; ORM and Composer as ordinary pinned dependencies with@prisma/devas the only optional package; the CLI never builds the user's app and never does package management; config evaluation never errors (per-section diagnostics, versioneddefineConfigmarker); launch scope = port existing surfaces, stub Composer's control client until its programmatic API lands.db/postgressplit,migrateunderdb, retained Prisma Next verb conventions).Review focus
Refs: TML-3172
🤖 Generated with Claude Code