Skip to content

TML-3900: The error for consent nobody gave says so in plain words on its first line - #31179

Draft
wmadden-electric wants to merge 10 commits into
mainfrom
tml-3900-engine-0-10-1
Draft

wmadden-electric wants to merge 10 commits into
mainfrom
tml-3900-engine-0-10-1

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

A user removes a field from a model and runs prisma migration plan in a script, where nobody can answer a prompt. The plan would drop a column that holds data, so the command stops.

Before:

✘ [CLI.CONSENT_REQUIRED] "Shop.legacy" needs a statement, and the session is not interactive.
  why: Drop column "legacy" from "Store Front" would lose the values of field "Shop.legacy".
→ Run the command again with --rename Shop.legacy:Shop.rating
→ Run the command again with --delete Shop.legacy

After:

✘ [CLI.CONSENT_REQUIRED] This command requires explicit consent, but it was not provided.
  why: Drop column "legacy" from "Store Front" would lose the values of field "Shop.legacy".
→ Run the command again with --rename Shop.legacy:Shop.rating
→ Run the command again with --delete Shop.legacy

Only the first line changes. Under --yes it reads This command requires explicit consent, and --yes does not give it. The sentence is the same for one unanswered question and for several.

The change

The first line is written by @prisma/cli-engine, not by this repository. Engine 0.10.2 (prisma/prisma-cli#397) rewords it. This pull request moves every package from engine 0.10.0 to 0.10.2 and updates what depends on the text:

  • 33 package.json pins and the lockfile.
  • Tests that assert the first line: the prompt adapter's unit test and 12 CLI journey files. The --yes sentence is asserted too. No source file changes.
  • An upgrade note under upgrade-instructions/pending/cli-engine-0-10-2/. It tells anyone who matched the old first line to check the error's code and meta.unanswered instead.

What does not change

The why line, the next-step lines, meta, the error code and the exit code. Scripts that read those are unaffected.

Also in this pull request

Project documents for the migration statements project, with no effect on behaviour:

  • projects/migration-statements/spec.md states its purpose and its rule about these errors in plainer words.
  • projects/migration-statements/deferred.md records the problems found by manual QA of these errors, for later work. Three of them break a requirement of the spec, and each entry says which. All three behave the same on main.

For reviewers

Tests that named the subject in the first line ("Bug", "Task") can no longer do so, because the line is now a fixed sentence. Each such assertion checks the subjects through meta.unanswered.

Engine 0.10.1 was published with a different wording that was withdrawn. Nothing uses it, and the upgrade note's detection also catches a project pinned to it.

Fixes TML-3900.

Agent: hammurabi-19

…efusals in plain words

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
… refusal now leads with the question itself (engine 0.10.1)

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
…ch the refusal text of engine 0.10.1

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@wmadden-electric
wmadden-electric requested a review from a team as a code owner November 22, 2026 23:04
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The CLI updates consent-required error message handling, revises related unit and integration test expectations, and updates @prisma/cli-engine dependency pins from 0.10.0 to 0.10.1.

Changes: CLI consent-error update

Layer / File(s) Summary
Consent error message handling
packages/1-framework/3-tooling/cli/src/orm/plan-question-prompt.ts, packages/1-framework/3-tooling/cli/test/orm/plan-question-prompt.test.ts
The prompt logic removes keep-data phrases from the error message and optional why text. Unit tests cover the revised messages and confirm that guidance for multiple questions appears once in nextActions.
Integration journey expectations
test/integration/test/cli-journeys/*.e2e.test.ts
Journey assertions use summary for consent questions and data-loss descriptions, and why for the explanation that the run cannot ask for a choice.
Engine version pins and upgrade instructions
apps/*/package.json, examples/*/package.json, packages/1-framework/3-tooling/{cli,config-loader}/package.json, packages/3-extensions/*/package.json, packages/3-targets/mysql/*/package.json, packages/9-public/@prisma/orm-toolchain/package.json, test/e2e/framework/test/**/fixtures/package.json, test/integration/package.json, test/integration/test/fixtures/cli/*/package.json, upgrade-instructions/pending/cli-engine-0-10-1/*/instructions.md
Manifests update @prisma/cli-engine from 0.10.0 to 0.10.1. Upgrade instructions describe the revised consent-error text and direct code to use the error code and meta.unanswered rather than parse human-readable text.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Suggested reviewers: sevinf, stevenmcclankerton

Merge Risk: Minimal · up to be2ac

This change moves the engine to 0.10.1, so consent-required errors now lead with what would be lost. It adjusts the prompt handling and test expectations to match, and adds an upgrade note. No concrete defect was found, so the merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
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.
Title check Passed The title names a specific behavior change: the consent-required error for unanswered statement questions now states the data-loss consequence on its first line. The changeset matches this. The engine…
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names a specific behavior change: the consent-required error for unanswered statement questions now states the data-loss consequence on its first line. The changeset matches this. The engine bump to 0.10.1, the plan-question-prompt rewrite, and the updated CLI journey tests all move the data-loss sentence into summary and the non-interactive explanation into why. The title identifies the primary change, but it uses the internal ticket ID and some wording that a reader must interpret, so it is related but not the full scope.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: prisma/orm
  • Branch: main
  • File: .coderabbit.yml
  • Commit: 748ff35
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5f9a85bf-ee5e-46ba-89d1-9ad5db7c954b
Commits

Reviewing files that changed from the base of the PR and between 748ff35 and be2ac32.

Files ignored due to path filters: 3

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • projects/migration-statements/deferred.md is excluded by !projects/**
  • projects/migration-statements/spec.md is excluded by !projects/**
Files selected for processing: 53

  • apps/lsp-playground/package.json
  • apps/telemetry-backend/package.json
  • examples/bundle-size/package.json
  • examples/mongo-blog-leaderboard/package.json
  • examples/mongo-demo/package.json
  • examples/multi-extension-monorepo/package.json
  • examples/paradedb-demo/package.json
  • examples/prisma-8-cloudflare-worker/package.json
  • examples/prisma-8-demo-mariadb/package.json
  • examples/prisma-8-demo-mysql/package.json
  • examples/prisma-8-demo-sqlite/package.json
  • examples/prisma-8-demo/package.json
  • examples/prisma-8-postgis-demo/package.json
  • examples/prisma7-adoption/package.json
  • examples/react-router-demo/package.json
  • examples/retail-store/package.json
  • examples/supabase/package.json
  • packages/1-framework/3-tooling/cli/package.json
  • packages/1-framework/3-tooling/cli/src/orm/plan-question-prompt.ts
  • packages/1-framework/3-tooling/cli/test/orm/plan-question-prompt.test.ts
  • packages/1-framework/3-tooling/config-loader/package.json
  • packages/3-extensions/citext/package.json
  • packages/3-extensions/paradedb/package.json
  • packages/3-extensions/pgvector/package.json
  • packages/3-extensions/postgis/package.json
  • packages/3-extensions/supabase/package.json
  • packages/3-targets/mysql/1-mysql/9-facade/package.json
  • packages/3-targets/mysql/2-mariadb/9-facade/package.json
  • packages/3-targets/mysql/3-live-tests/package.json
  • packages/9-public/@prisma/orm-toolchain/package.json
  • test/e2e/framework/test/fixtures/package.json
  • test/e2e/framework/test/sqlite/fixtures/package.json
  • test/integration/package.json
  • test/integration/test/cli-journeys/delete-statements-migration.mongo.e2e.test.ts
  • test/integration/test/cli-journeys/enum-value-statements.mongo.e2e.test.ts
  • test/integration/test/cli-journeys/keep-documents-advice.mongo.e2e.test.ts
  • test/integration/test/cli-journeys/rename-delete-statements.mongo.e2e.test.ts
  • test/integration/test/cli-journeys/stored-name-chains-and-merges.e2e.test.ts
  • test/integration/test/cli-journeys/stored-name-chains-and-merges.sqlite.e2e.test.ts
  • test/integration/test/cli-journeys/stored-name-db-update.e2e.test.ts
  • test/integration/test/cli-journeys/stored-name-db-update.sqlite.e2e.test.ts
  • test/integration/test/cli-journeys/table-map-change.e2e.test.ts
  • test/integration/test/cli-journeys/table-map-change.sqlite.e2e.test.ts
  • test/integration/test/cli-journeys/value-object-backfill.mongo.e2e.test.ts
  • test/integration/test/cli-journeys/value-object-statements.e2e.test.ts
  • test/integration/test/cli-journeys/value-object-statements.mongo.e2e.test.ts
  • test/integration/test/cli-journeys/value-object-statements.sqlite.e2e.test.ts
  • test/integration/test/cli-journeys/variant-storage-moves.e2e.test.ts
  • test/integration/test/cli-journeys/variant-storage-moves.sqlite.e2e.test.ts
  • test/integration/test/fixtures/cli/cli-e2e-test-app/package.json
  • test/integration/test/fixtures/cli/cli-integration-test-app/package.json
  • upgrade-instructions/pending/cli-engine-0-10-1/app/instructions.md
  • upgrade-instructions/pending/cli-engine-0-10-1/extension/instructions.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@pkg-pr-new

pkg-pr-new Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@prisma/orm-extension-arktype-json

npm i https://pkg.pr.new/@prisma/orm-extension-arktype-json@31179

@prisma/orm-extension-middleware-cache

npm i https://pkg.pr.new/@prisma/orm-extension-middleware-cache@31179

@prisma/orm-extension-paradedb

npm i https://pkg.pr.new/@prisma/orm-extension-paradedb@31179

@prisma/orm-extension-pgvector

npm i https://pkg.pr.new/@prisma/orm-extension-pgvector@31179

@prisma/orm-extension-postgis

npm i https://pkg.pr.new/@prisma/orm-extension-postgis@31179

@prisma/orm-extension-supabase

npm i https://pkg.pr.new/@prisma/orm-extension-supabase@31179

@prisma/orm-family-mongo

npm i https://pkg.pr.new/@prisma/orm-family-mongo@31179

@prisma/orm-family-sql

npm i https://pkg.pr.new/@prisma/orm-family-sql@31179

@prisma/orm-framework

npm i https://pkg.pr.new/@prisma/orm-framework@31179

@prisma/orm-mariadb

npm i https://pkg.pr.new/@prisma/orm-mariadb@31179

@prisma/orm-mongo

npm i https://pkg.pr.new/@prisma/orm-mongo@31179

@prisma/orm-mysql

npm i https://pkg.pr.new/@prisma/orm-mysql@31179

@prisma/orm-postgres

npm i https://pkg.pr.new/@prisma/orm-postgres@31179

@prisma/orm-postgres-contrib

npm i https://pkg.pr.new/@prisma/orm-postgres-contrib@31179

@prisma/orm-sqlite

npm i https://pkg.pr.new/@prisma/orm-sqlite@31179

@prisma/orm-target-mariadb

npm i https://pkg.pr.new/@prisma/orm-target-mariadb@31179

@prisma/orm-target-mongo

npm i https://pkg.pr.new/@prisma/orm-target-mongo@31179

@prisma/orm-target-mysql

npm i https://pkg.pr.new/@prisma/orm-target-mysql@31179

@prisma/orm-target-postgres

npm i https://pkg.pr.new/@prisma/orm-target-postgres@31179

@prisma/orm-target-sqlite

npm i https://pkg.pr.new/@prisma/orm-target-sqlite@31179

@prisma/orm-toolchain

npm i https://pkg.pr.new/@prisma/orm-toolchain@31179

commit: 3bc1c9c

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
postgres / no-emit 304.19 KB (0%)
postgres / emit 265.31 KB (0%)
mongo / no-emit 240.37 KB (0%)
mongo / emit 194.51 KB (0%)
cf-worker / no-emit 368.49 KB (0%)
cf-worker / emit 325.23 KB (0%)

@wmadden-electric
wmadden-electric marked this pull request as draft November 22, 2026 23:38
… refusal now starts "This command requires explicit consent" and keeps the question in why (engine 0.10.2)

Moves @prisma/cli-engine to 0.10.2, which keeps the 0.10.0 refusal and changes only its first line. The prompt adapter and the journeys go back to reading the question from why, and the pending upgrade note now describes the change from 0.10.0 to 0.10.2.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
…10.1

Drops the entry about a several-line first line, keeps the manual QA problems that still hold with engine 0.10.2, and quotes their 0.10.2 text.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@wmadden-electric wmadden-electric changed the title TML-3900: When a command cannot ask about a change that would lose data, its error leads with what would be lost TML-3900: The error for consent nobody gave says so in plain words on its first line Nov 23, 2026
…ion about GeoPoint.lat or Address.zip, and the --yes refusal checks its first line

The old first line named the subject, so it also proved there was one question. The fixed sentence of engine 0.10.2 proves neither, so the journeys now read meta.unanswered. The db update --yes step now asserts the --yes sentence, which no test checked.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
…art of the old first line, and looks in snapshot, TSX and JSX files too

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
… suggest a rename but acts only on flags or answers, and links "statement" to "explicit consent"

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
…, and the three that break a spec requirement say which

Parts already covered by an existing entry are added to that entry instead: the next actions per flag, SQLite label quoting, the DDL preview, and the unused-flag advice.

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

This branch has not been deployed

No deployments
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