php qt commands exit with status 0 when they report an error
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
先找出 CliCommand::error() 和 CliCommand::execute(),接著追蹤命令回傳值如何轉換為程序結束狀態。檢查 issue 中列出的 config:publish 情況,並新增或執行針對已回報錯誤與成功命令的測試。完成標準是:error() 導致狀態 1、正常完成導致狀態 0,且行為變更記錄在 changelog 中。
由索引模型根據 Issue 內容生成。
描述
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
- 主要語言
- PHP
- 星號
- 44
- 分支
- 22
- 平均合併
- 2 小時 49 分鐘
- 30 天內合併 PR
- 61
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
quantum-php/framework 的其他 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
quantum-php/framework#739 ·
維護者通常 1 天內回覆
-
tech debt testing
難度 2/5 1-3 小時 新手友好度 72/100
quantum-php/framework#696 ·
維護者通常 1 天內回覆
-
routing testing
難度 2/5 1-3 小時 新手友好度 76/100
quantum-php/framework#547 ·
維護者通常 1 天內回覆
-
enhancement
難度 4/5 3-5 天 新手友好度 48/100
quantum-php/framework#741 ·
維護者通常 1 天內回覆
-
enhancement
難度 5/5 一週以上 新手友好度 40/100
quantum-php/framework#740 ·
維護者通常 1 天內回覆
查看 quantum-php/framework 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 66/100
維護者通常 1 天內回覆
-
🐛 Web Bug
難度 2/5 1-3 小時 新手友好度 64/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 86/100
omeka/plugin-Commenting#72 ·
-
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆
-
`mercure()` Twig function: the `lastEventId` option adds query parameters that Mercure hubs 1.0+ ignore可能已有人在做 @daFish 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100