Ordo/Command/Job/Ice.pm untested

filter: Statementstmt 0.0% 0 / 31 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 51 CC 3 SCAR 16.1
CC
3
Cov
0%
execute
12.0
name
2.0
summary
2.0
CRAP 5.0
1 package App::Ordo::Command::Job::Ice;
2 use Moo;
3 use feature qw(say);
4 extends 'App::Ordo::Command::Base';
5  
6 use Term::ANSIColor qw(colored);
7  
8 sub name { "job ice" }
9 sub summary { "Skip job without blocking dependents" }
10 sub usage { "<path/name>" }
11  
12 sub option_spec { {} }
13  
14 sub execute {
15 my ($self, $opt, $name) = @_;
16  
17 unless ($name) {
18 say colored(["bold red"], "Usage: job ice <path/name>");
19 return;
20 }
21  
22 my $res = $self->api->call('ice_job', { name => $name });
23  
24 if ($res->{success}) {
25 say colored(["bold cyan"], "Job '$name' iced");
26 say colored(["bright_black"], "Downstream jobs will run as soon as upstream complete");
27 } else {
28 say colored(["bold red"], "Failed to ice job: " . ($res->{message} || 'error'));
29 }
30 }
31  
32 1;