php qt commands exit with status 0 when they report an error
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず 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分
- マージ済み PR(30日)
- 61
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 1週間以上 初心者へのやさしさ 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