An unconsumed --confirm should fail every command, once bucket key delete and project env delete consume it
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 55/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript
- 領域
- cli
研究方向
Read packages/cli-engine/src/execution/prompts.ts and trace how leftoverConfirmTokens handles commands that do not declare statements. Then inspect packages/cli/src/commands/bucket/key-delete.ts and project/env-delete.ts, along with the cited e2e tests, ADR 0006, and docs/reference/error-reference.md. Done means unconsumed --confirm fails every command and both commands and documentation match that rule.
由索引模型根據 Issue 內容生成。
描述
The problem
--confirm <token> is a flag every command accepts. When no consent prompt in the run asks for the token, the value is ignored without a word:
prisma bucket key delete bkt_123 bkey_456 --confirm bkey_456
# deletes the key, exits 0; --confirm did nothing
A misspelled token is silent in the same way. The engine wants to treat an unconsumed --confirm as CLI.CONSENT_UNUSED, the same error a leftover statement flag gets.
#337 first made that rule apply to every command. The real-API e2e suite then failed on two commands, so #337 narrowed the rule: an unconsumed --confirm fails the run only on a command that declares statements. On every other command a leftover --confirm stays silent. This issue tracks applying the rule to every command.
Commands that take --confirm but never consume it
These commands never call ctx.prompt.consent. Their e2e tests still pass --confirm, and users may too:
bucket key delete(packages/cli/src/commands/bucket/key-delete.ts; e2epackages/cli/e2e/bucket.e2e.ts, which passes--confirm <key-id>)project env delete(packages/cli/src/commands/project/env-delete.ts; e2epackages/cli/e2e/project-lifecycle.e2e.ts, which passes--confirm <name>)
Each needs one of two fixes: ask for consent with a token, as bucket delete does, or drop --confirm from its callers and docs.
Commands that ask for consent
I checked every ctx.prompt.consent call in packages/cli/src:
project transfer,project deletepostgres delete,postgres backup restore,postgres connection delete,postgres connection rotatebucket deleteservice delete,service version delete,service version rollback,service domain delete
Each one asks for consent on every path that reaches the destructive call. The only earlier exits are argument and usage errors, and those fail the run anyway. So none of them leaves a --confirm unconsumed on a successful run.
Done when
bucket key deleteandproject env deleteconsume--confirm, or no longer take it.- The engine reports an unconsumed
--confirmasCLI.CONSENT_UNUSEDon every command. That means removing the "declares statements" condition inleftoverConfirmTokens(packages/cli-engine/src/execution/prompts.ts). - ADR 0006 and the
CLI.CONSENT_UNUSEDentry indocs/reference/error-reference.mdare updated to match.
- 主要語言
- TypeScript
- 星號
- 26
- 分支
- 4
- 平均合併
- 12 小時 11 分鐘
- 30 天內合併 PR
- 38
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
prisma/prisma-cli 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
prisma/prisma-cli#416 ·
維護者通常 1 天內回覆
-
service logs --tail accepts negative and fractional numbers可能重新可做 @somcpp 於 68 天前認領,目前沒有進行中的 PR。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
prisma/prisma-cli#309 · 1 則留言 ·
維護者通常 1 天內回覆
-
The update notice tells users to install @prisma/cli and does not recognise a global prisma install未關閉
難度 2/5 1-3 小時 新手友好度 84/100
prisma/prisma-cli#306 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 88/100
prisma/prisma-cli#305 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 85/100
prisma/prisma-cli#302 ·
維護者通常 1 天內回覆
查看 prisma/prisma-cli 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 82/100
zabuton-app/meguri#875 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 86/100
iruzen-dono/workless#117 ·
維護者通常 1 天內回覆
-
area:api area:web wave wave:trivial
難度 2/5 1-3 小時 新手友好度 67/100
-
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
vetro-protocol/vetro-monorepo#1321 ·
維護者通常 1 天內回覆