Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Confusing results when calling run_task on undefined target

オープン
#1,463 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
perl
領域
devops

調査の方向性

issue にある最小限の Perl 再現コードから始め、on => undef を指定して run_task が呼び出された場合の処理を追跡します。関連する task 呼び出しと戻り値の挙動を比較し、その後、意図された結果が一貫して返される値なのか明示的なエラーなのかを判断し、このケースのカバレッジを追加します。

索引モデルが issue の本文から書いたものです。

説明

bug

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:

  1. Call run_task with on => 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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

RexOps/Rex のほかの issue

RexOps/Rex の issue をすべて見る

似ている issue

Perl の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。