cli: prompt before destructive commands, add idempotent flags, and fail fast
Los mantenedores suelen responder en 2 días
@xue-ding-e ya está trabajando en esto.
Desde el 14/10/2026.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 40/100
Línea de trabajo
Start with the CLI entry point at core/cli/src/main.rs:359 and the client retry defaults at core/common/src/types/args/mod.rs:384, then trace the listed command handlers and their error handling. Check existing CLI tests for prompts, flags, timeouts, and exit codes; done means the proposed behaviors work across the named commands and transports, with regression tests covering the distinctions and non-TTY behavior.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
stream delete,stream purge,topic delete,topic purge,partition delete,segment delete,consumer-group delete,user delete,pat deleteandcontext deleterun at once, with no prompt.- A provisioning script cannot run twice. If a stream exists,
stream createfails. If it does not exist,stream deletefails. iggy pingagainst a stopped server returns after 10.06 s withError: IggyClient(SdkError(CannotEstablishConnection)), a Rust debug value. The wait comes from the CLI client defaults (core/common/src/types/args/mod.rs:384): 10 retries, 1 s apart (#3903). Over WebSocket the CLI waits 60 s, and over QUIC it waits about 100 s per attempt.- Server down, wrong password, "not found" and "already exists" all exit with code 1, so a script cannot tell them apart.
Proposal
- On a TTY, show what a destructive command will delete, and ask for
y. Add-y, --yesto each of these commands. If stdin is not a TTY, keep the current behavior. - Add
--if-not-existstostream create,topic create,consumer-group createanduser create. Add--if-existsto the matching delete commands and topat delete. Treat the "already exists" or "not found" error of the server as success. A check before the call can race with another client. - Add
--connect-timeout(for example5s) for the connection and the login on every transport. The retries then run inside this time. The timeout also covers a login that gets no reply (#4262). - Print the error and its cause chain instead of the
Debugvalue (core/cli/src/main.rs:359). The top-levelDisplayis only a label, for example "Iggy client error". - Add distinct exit codes for connection, authentication, "not found" and "already exists" errors. Do not use 2 (clap usage errors) or 101 (panics).
Notes
- A script that starts from a terminal also has a TTY on stdin, so the prompt is a breaking change for it.
- With
--if-not-exists,user createkeeps the old password of an existing user.pat creategets no such flag, because it cannot print the token of an existing PAT. - The partition and segment commands take a count, so the new flags do not apply to them.
- While #3735 is open, the error details stay empty. For example, the CLI prints "Stream with ID: 0 was not found." for a missing stream.
- Lenguaje dominante
- Rust
- Estrellas
- 5.3k
- Forks
- 548
- Merge medio
- 2 d 20 h
- PR fusionados (30 d)
- 194
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/iggy
-
go good first issue test
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 2 días
-
go good first issue test
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 2 días
-
go good first issue test
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 2 días
-
good first issue java test
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 2 días
-
good first issue javascript test
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 2 días
Todos los issues de apache/iggy
Issues similares
-
marketing
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
S: Untriaged T: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
libnyanpasu/clash-nyanpasu#6537 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Menos de una hora Aptitud para principiantes 62/100
tauri-apps/tao#1445 ·
Los mantenedores suelen responder en 1 día
-
bug P3
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
nearai/compose-manager#95 ·
Los mantenedores suelen responder en 1 día