php qt commands exit with status 0 when they report an error
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Empieza por localizar CliCommand::error() y CliCommand::execute(), y luego sigue cómo los valores de retorno de los comandos se convierten en estados de salida del proceso. Comprueba los casos de config:publish indicados en el issue y añade o ejecuta pruebas específicas para los errores reportados y los comandos que terminan correctamente. El objetivo se cumple cuando error() da lugar al estado 1, la finalización normal da lugar al estado 0 y el cambio de comportamiento queda registrado en el changelog.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
A php qt command that stops on an error prints the message with CliCommand::error() and returns, but the process still exits with status 0. CliCommand::execute() calls exec() and always returns Command::SUCCESS. Scripts, deploy steps and CI jobs cannot tell such a failure from a success.
Where it happens
Eight core commands report errors this way: config:publish, cron:run, debugbar, core:env, module:generate, openapi, cache:clear and route:list. Application commands that extend CliCommand behave the same. A command that throws an exception already exits with a non-zero status; only errors reported through error() are affected.
For example, php qt config:publish Cache exits with 0 when shared/config/cache.php already exists and -y is not given, although nothing was published.
Scope
CliCommand::error()marks the command as failed.CliCommand::execute()returnsCommand::FAILUREwhen the command was marked as failed, andCommand::SUCCESSotherwise.exec()keeps its signature, so existing commands, core and application, need no change.
Acceptance criteria
- a command that calls
error()exits with status 1 - a command that finishes without
error()exits with status 0 config:publishexits with 1 for an existing file without-y, an unknown package or module, and a failed copy- the change is listed in the changelog as a behavior change, since scripts that ignored the status may now see failures
- Lenguaje dominante
- PHP
- Estrellas
- 44
- Forks
- 22
- Merge medio
- 2 h 49 min
- PR fusionados (30 d)
- 61
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 quantum-php/framework
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
quantum-php/framework#739 ·
Los mantenedores suelen responder en 1 día
-
tech debt testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
quantum-php/framework#696 ·
Los mantenedores suelen responder en 1 día
-
routing testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
quantum-php/framework#547 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
quantum-php/framework#741 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 40/100
quantum-php/framework#740 ·
Los mantenedores suelen responder en 1 día
Todos los issues de quantum-php/framework
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
🐛 Web Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
omeka/plugin-Commenting#72 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
`mercure()` Twig function: the `lastEventId` option adds query parameters that Mercure hubs 1.0+ ignorePosiblemente ocupada @daFish la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100