Confusing results when calling run_task on undefined target
まだ誰も着手していません。
評価
調査の方向性
issue にある最小限の Perl 再現コードから始め、on => undef を指定して run_task が呼び出された場合の処理を追跡します。関連する task 呼び出しと戻り値の挙動を比較し、その後、意図された結果が一貫して返される値なのか明示的なエラーなのかを判断し、このケースのカバレッジを追加します。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
When calling my $return = run_task $task, on => undef;, the value of $return is always 1.
(Originally reported by @sdondley via IRC, thanks!)
How to reproduce it
Steps to reproduce the behavior:
- Call
run_taskwithon => undef.
Shortest code example that demonstrates the bug:
task 'abc', sub {
return 'abc';
};
task 'run_task_undef', sub {
my $return = run_task 'abc', on => undef;
say $return;
};
Expected behavior
While a task's returned value might not be well-defined, it would be nice to have as consistent behavior as possible between the various calls. In this case, returning "abc" instead of 1.
Currently run_task $task, on => undef seems to execute on the same target as the calling task, which might be confusing and/or error-prone. Perhaps it's best to die() with an error message in this case.
Circumstances
- Rex version: current master
- Perl version: 5.32.0
- OS running rex: Gentoo
- OS managed by rex: Gentoo
- How rex was installed: dzil install
Debug log
- 主要言語
- Perl
- スター
- 736
- フォーク
- 217
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
RexOps/Rex のほかの issue
-
is_redhat() misses Rocky/Alma/CentOS Stream/Oracle Linux lsb_release IDs -> pkg dies "OS/Provider not supported"対応中かも @stantheman0128 が 18 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
triage needed
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
triage needed
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
jimsalterjrs/sanoid#1116 · リアクション 1 件 ·
-
Add .gitattributes so share/skel keeps LF on a Windows git checkout対応中かも @sadhana-s-codez が 3 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
PerlDancer/Dancer2#1854 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
major/MySQLTuner-perl#1007 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100