Eliminate duplicate getPreviousBuild functions
[?]
Jun 27, 2013, 4:08 PM
RPTSGIRCCSEDEBRB5H465A5JULJH5KFYAMR573SKNTPSJSCYEICQCDependencies
- [2]
DHMGSAEB* hydra: reinstate proper error for non existing build, Hydra/9 - [3]
LDICTHWYUse Template::Toolkit to generate email messages - [4]
PPF3MVKHImprove email notifications status messages - [5]
2M7J26V4inital version of links to diff in scm - [6]
BLVQGJ4LUse OO-style plugins - [7]
QDJRQIFFIf multiple dependent builds fail, send a single email - [8]
LBNVQXUB* Build the /build stuff in a separate controller. - [9]
LSZLZHJYAllow users to edit their own settings - [10]
LMETCA7GCleanup - [11]
LUPEGYR7Hydra: In case of failure, also show changes between last succesful build and the first failed build after this - [12]
GJFYEU3S* Nix now stores logs by default as bzip2, make sure the build page uncompresses before showing. - [13]
JAUTUNGIbug fix - [14]
FPK5LF53* Put the project-related actions in a separate controller. Put the - [15]
3Y7AFJSS* Support linking to the latest job in a view for a specific platform, e.g. - [16]
5EQYVRWEAdd a plugin mechanism - [17]
KAZWI5G4* hydra: buildpage, show changes since last build/successful build - [18]
LGNML7VJDon't use a prepared statement for the active build steps query - [19]
HQGXL4MXAdd validation for project and jobset names - [20]
JUZVPV6Squalify id column in queries - [21]
3PNG7NIBRemove trailing whitespace - [22]
PCKLFRT5Support push notification of repository changes - [23]
5NO7NCKT* Refactoring. - [24]
XJRJ4J7MAdd user registration - [25]
E6SL7QRUOmit the system type if it's part of the job name - [*]
7UJ5YV4V* Provide a channel for each project containing all the latest - [*]
N45RZUQ6Reduce I/O in build listings by only fetching required columns - [*]
CS7T2XFI
Change contents
- replacement in src/lib/Hydra/Controller/Build.pm at line 27
$c->stash->{prevBuild} = getPreviousBuild($c, $c->stash->{build});$c->stash->{prevBuild} = getPreviousBuild($c->stash->{build}); - edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 13
use feature qw/switch/; - edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 22
parseJobsetName - edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 27[28.569][29.180]
parseJobsetNameshowJobNameshowStatus - replacement in src/lib/Hydra/Helper/CatalystUtils.pm at line 45
my ($c, $build) = @_;my ($build) = @_; - replacement in src/lib/Hydra/Helper/CatalystUtils.pm at line 47
(my $prevBuild) = $c->model('DB::Builds')->search(return $build->job->builds->search( - edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 50
, project => $build->project->name, jobset => $build->jobset->name, job => $build->job->name - replacement in src/lib/Hydra/Helper/CatalystUtils.pm at line 51[5.2469]→[5.0:49](∅→∅),[5.587]→[5.0:49](∅→∅),[5.49]→[5.2470:2471](∅→∅),[5.2471]→[5.638:661](∅→∅),[5.638]→[5.638:661](∅→∅)
}, {rows => 1, order_by => "me.id DESC"});return $prevBuild;, -not => { buildstatus => { -in => [4, 3]} }}, { rows => 1, order_by => "me.id DESC" })->single; - edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 228
}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; - edit in src/lib/Hydra/Plugin/EmailNotification.pm at line 5
use feature qw/switch/; - edit in src/lib/Hydra/Plugin/EmailNotification.pm at line 15[5.34]→[5.331:333](∅→∅),[5.331]→[5.331:333](∅→∅),[5.333]→[3.15:54](∅→∅),[3.54]→[5.385:413](∅→∅),[5.385]→[5.385:413](∅→∅),[5.413]→[3.55:89](∅→∅),[3.89]→[5.440:482](∅→∅),[5.440]→[5.440:482](∅→∅),[5.482]→[4.0:41](∅→∅),[4.41]→[5.547:643](∅→∅),[5.547]→[5.547:643](∅→∅),[5.643]→[4.42:95](∅→∅),[4.95]→[5.643:669](∅→∅),[5.643]→[5.643:669](∅→∅),[5.669]→[3.90:223](∅→∅),[3.223]→[5.35:37](∅→∅),[5.669]→[5.35:37](∅→∅)
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;} - edit in src/lib/Hydra/Plugin/EmailNotification.pm at line 17
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;} - replacement in src/lib/Hydra/Plugin/EmailNotification.pm at line 54
my $prevBuild = getPrevBuild($self, $b);my $prevBuild = getPreviousBuild($b); - replacement in src/lib/Hydra/Plugin/EmailNotification.pm at line 87
{ build => $build, prevBuild => getPrevBuild($self, $build){ build => $build, prevBuild => getPreviousBuild($build)