And move some stuff into CatalystUtils for use by other plugins.
RPTSGIRCCSEDEBRB5H465A5JULJH5KFYAMR573SKNTPSJSCYEICQC
DHMGSAEBNLE453UMEI3ZFN7PT5ZVDT2QHMZDDBSGY5ATTHPILGWAC
LDICTHWYJ2SP6IU3PK2K2PW5FN54HP7W4KTL324YYTTNPVJ4HSLQC
PPF3MVKHCWONBUR66V34SRPNTPVU2YS2UJ533C7FKAX3PIQJD3YQC
KAZWI5G4DN2WUW7L2KWZR3D3QQJON4ISQYP7CRLC5HAOPIDYQGRQC
LBNVQXUBEZ45SOTGVXK5UEZXIAIZTJLWZNUYFI4JZ6J65N3KPDVQC
7UJ5YV4VUSXMKB57KKXDG6KLIXMQXO45VO5UTOT46BHQJBFZ7XKQC
LMETCA7G76HUDV2ZVOOIH6TI6UG7RJ5VCZNWRAAZVIQOWG6XLX5QC
PCKLFRT5IZVLG47GQQ23GBSROKUR4CUEZW4PRVGREHNDFTCZ7VBAC
N45RZUQ6E7XXUPVWMR2SSZZB57ZD236PEMBCCOCAQOUOYFVJDBXQC
CS7T2XFIISZ7TPQ6FFRIDYPR6BDCQHURP4JE4YKLI4OYSNWKZCHAC
JAUTUNGIF2UZ4YJYL5YXBUUKO774OLQZKAJ7VZNUEWAKVJL5L2DAC
3PNG7NIBQQURUUPRVQXYL342OT7JUUYOMY2JJNP6YDX7SYJDZMYAC
JUZVPV6SRNYHJMA457OKS2COZ4NWG7EFDXDD33IBDLKFGOZDJ4NQC
LUPEGYR76IIJFCEV6QU3VII2DNOHH3W3RHQI77LDFZU7B5QETTHQC
BLVQGJ4LITFCIR3KAUX3GWAHMYH3XXFC4BDXUSXUVEJFEJ7IMM4AC
5EQYVRWECBDJORGI5DRIOUEJXSXMRCQNT2562BM4Z4U52LT7JUHAC
QDJRQIFFTRQZ6GWIQD33R6RZ4AOW6F5IOFGSLSUU35E4QR454K7AC
}, {rows => 1, order_by => "me.id DESC"});
return $prevBuild;
, -not => { buildstatus => { -in => [4, 3]} }
}, { rows => 1, order_by => "me.id DESC" })->single;
}
sub showJobName {
my ($build) = @_;
return $build->project->name . ":" . $build->jobset->name . ":" . $build->job->name;
}
sub showStatus {
my ($build) = @_;
my $status = "Failed";
given ($build->buildstatus) {
when (0) { $status = "Success"; }
when (1) { $status = "Failed"; }
when (2) { $status = "Dependency failed"; }
when (4) { $status = "Cancelled"; }
when (6) { $status = "Failed with output"; }
}
return $status;
sub showStatus {
my ($build) = @_;
my $status = "Failed";
given ($build->buildstatus) {
when (0) { $status = "Success"; }
when (1) { $status = "Failed"; }
when (2) { $status = "Dependency failed"; }
when (4) { $status = "Cancelled"; }
when (6) { $status = "Failed with output"; }
}
return $status;
}
sub showJobName {
my ($build) = @_;
return $build->project->name . ":" . $build->jobset->name . ":" . $build->job->name;
}
sub getPrevBuild {
my ($self, $build) = @_;
return $self->{db}->resultset('Builds')->search(
{ project => $build->project->name
, jobset => $build->jobset->name
, job => $build->job->name
, system => $build->system
, finished => 1
, id => { '<', $build->id }
, -not => { buildstatus => { -in => [4, 3]} }
}, { order_by => ["id DESC"], rows => 1 }
)->single;
}