Factor a getResponsibleAuthors helper out of the HipChatNotification
[?]
Oct 7, 2013, 1:44 PM
BEFHUCGNM3FRVAEDTOSSBRKOUNRC2IIYKEIVIVREUBGAEORVRQJACDependencies
- [2]
RPTSGIRCEliminate duplicate getPreviousBuild functions - [3]
7OS2VAOOFix Hipchat notification - [4]
IBW53PUCHipChat notification: add support for Mercurial inputs for determining who might have broken the build. - [5]
ZO457GFGHipChat notification: do not include latest commits of all inputs in 'who-broke-the-build' list. Use only committers from inputs that have actually changed since previous build. - [6]
ZDEHAFHVAdd a plugin for HipChat notification - [7]
NB2VOKIRInclude names of committers in HipChat notifications - [8]
H6D6OVYKGet rid of a warning in the HipChat plugin - [*]
LBNVQXUB* Build the /build stuff in a separate controller. - [*]
CS7T2XFI - [*]
PCKLFRT5Support push notification of repository changes
Change contents
- edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 30
getResponsibleAuthors - edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 252[12.1816][11.367]
# Determine who broke/fixed the build.sub getResponsibleAuthors {my ($build, $plugins) = @_; - edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 258
my $prevBuild = getPreviousBuild($build); - edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 260
my $nrCommits = 0;my %authors;if ($prevBuild) {foreach my $curInput ($build->buildinputs_builds) {next unless ($curInput->type eq "git" || $curInput->type eq "hg");my $prevInput = $prevBuild->buildinputs_builds->find({ name => $curInput->name });next unless defined $prevInput;next if $curInput->type ne $prevInput->type;next if $curInput->uri ne $prevInput->uri;next if $curInput->revision eq $prevInput->revision;my @commits;foreach my $plugin (@{$plugins}) {push @commits, @{$plugin->getCommits($curInput->type, $curInput->uri, $prevInput->revision, $curInput->revision)};}foreach my $commit (@commits) {#print STDERR "$commit->{revision} by $commit->{author}\n";$authors{$commit->{author}} = $commit->{email};$nrCommits++;}}}return (\%authors, $nrCommits);} - edit in src/lib/Hydra/Plugin/HipChatNotification.pm at line 42[6.2076]→[6.2076:2200](∅→∅),[6.2200]→[4.0:79](∅→∅),[4.79]→[6.2250:2502](∅→∅),[6.2250]→[6.2250:2502](∅→∅),[6.2502]→[5.0:65](∅→∅),[5.65]→[6.1278:1279](∅→∅),[6.2502]→[6.1278:1279](∅→∅),[6.1278]→[6.1278:1279](∅→∅),[6.1279]→[6.2503:2728](∅→∅)
my $nrCommits = 0;my %authors;if ($prevBuild) {foreach my $curInput ($build->buildinputs_builds) {next unless ($curInput->type eq "git" || $curInput->type eq "hg");my $prevInput = $prevBuild->buildinputs_builds->find({ name => $curInput->name });next unless defined $prevInput;next if $curInput->type ne $prevInput->type;next if $curInput->uri ne $prevInput->uri;next if $curInput->revision eq $prevInput->revision;my @commits;foreach my $plugin (@{$self->{plugins}}) {push @commits, @{$plugin->getCommits($curInput->type, $curInput->uri, $prevInput->revision, $curInput->revision)};} - replacement in src/lib/Hydra/Plugin/HipChatNotification.pm at line 43[6.2729]→[6.2729:2773](∅→∅),[6.2773]→[3.0:76](∅→∅),[3.76]→[6.2848:2972](∅→∅),[6.2848]→[6.2848:2972](∅→∅)
foreach my $commit (@commits) {#print STDERR "$commit->{revision} by $commit->{author}\n";$authors{$commit->{author}} = $commit->{email};$nrCommits++;}}}my ($authors, $nrCommits) = getResponsibleAuthors($build, $self->{plugins}); - replacement in src/lib/Hydra/Plugin/HipChatNotification.pm at line 63
if (scalar keys %authors > 0) {if (scalar keys %{$authors} > 0) { - replacement in src/lib/Hydra/Plugin/HipChatNotification.pm at line 65
my @x = map { "<a href='mailto:$authors{$_}'>$_</a>" } (sort keys %authors);my @x = map { "<a href='mailto:$authors->{$_}'>$_</a>" } (sort keys %{$authors});