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