An unconsumed --confirm should fail every command, once bucket key delete and project env delete consume it
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- cli
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 26
- Fork
- 4
- Merge medio
- 12h 11m
- PR unite (30g)
- 38
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di prisma/prisma-cli
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
prisma/prisma-cli#416 ·
I maintainer di solito rispondono entro 1 giorno
-
service logs --tail accepts negative and fractional numbersForse di nuovo libera @somcpp l’ha presa 68 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
prisma/prisma-cli#309 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
The update notice tells users to install @prisma/cli and does not recognise a global prisma installAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
prisma/prisma-cli#306 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
prisma/prisma-cli#305 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
prisma/prisma-cli#302 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di prisma/prisma-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
zabuton-app/meguri#875 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
iruzen-dono/workless#117 ·
I maintainer di solito rispondono entro 1 giorno
-
area:api area:web wave wave:trivial
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
vetro-protocol/vetro-monorepo#1321 ·
I maintainer di solito rispondono entro 1 giorno