php qt commands exit with status 0 when they report an error
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 78/100
Rechercherichtung
Beginne damit, CliCommand::error() und CliCommand::execute() zu finden, und verfolge dann, wie Rückgabewerte von Befehlen zu Prozess-Exit-Status werden. Prüfe die im Issue aufgeführten Fälle von config:publish und füge gezielte Tests für gemeldete Fehler und erfolgreiche Befehle hinzu oder führe sie aus. Das Ziel ist erreicht, wenn error() zu Status 1 führt, ein normaler Abschluss zu Status 0 führt und die Verhaltensänderung im Changelog festgehalten ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- PHP
- Sterne
- 44
- Forks
- 22
- Ø Merge
- 2 Std. 49 Min.
- Gemergte PRs (30 T.)
- 61
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus quantum-php/framework
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
quantum-php/framework#739 ·
Maintainer antworten meist innerhalb von 1 Tag
-
tech debt testing
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
quantum-php/framework#696 ·
Maintainer antworten meist innerhalb von 1 Tag
-
routing testing
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
quantum-php/framework#547 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
quantum-php/framework#741 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 40/100
quantum-php/framework#740 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in quantum-php/framework
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
Maintainer antworten meist innerhalb von 1 Tag
-
🐛 Web Bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 86/100
omeka/plugin-Commenting#72 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
`mercure()` Twig function: the `lastEventId` option adds query parameters that Mercure hubs 1.0+ ignoreEvtl. vergeben @daFish hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100