Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Confusing results when calling run_task on undefined target

Aperta
#1,463 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
perl
Ambito
devops

Direzione di ricerca

Inizia con la riproduzione minima in Perl nell’issue e traccia run_task quando viene chiamato con on => undef. Confronta il suo comportamento di ritorno con quello di chiamate a task correlate, quindi determina se il risultato previsto sia un valore restituito in modo coerente o un errore esplicito, e aggiungi la coverage per questo caso.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Perl
Stelle
736
Fork
217
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di RexOps/Rex

Tutte le issue di RexOps/Rex

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.