Include who-broke-the-build information in notification emails

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2013-10-07 11:13:37 -04:00
parent 272d9e235d
commit f8b80c99c2

View file

@ -29,6 +29,11 @@ The following dependent jobs also failed:
[% END -%]
[% END -%]
[% IF nrCommits > 0 -%]
This is likely due to [% IF nrCommits > 1 -%][% nrCommits %] commits by [% END -%][% authorList %].
[% END -%]
[% IF build.buildstatus == 0 -%]
Yay!
[% ELSE -%]
@ -74,6 +79,13 @@ sub buildFinished {
}
}
my ($authors, $nrCommits) = getResponsibleAuthors($build, $self->{plugins});
my $authorList;
if (scalar keys %{authors} > 0) {
my @x = map { "$_ <$authors->{$_}>" } (sort keys %{$authors});
$authorList = join(" or ", scalar @x > 1 ? join(", ", @[0..scalar @x - 2]): (), $x[-1]);
}
# Send an email to each interested address.
# !!! should use the Template Toolkit here.
@ -89,6 +101,8 @@ sub buildFinished {
, baseurl => $self->{config}->{'base_uri'} || "http://localhost:3000"
, showJobName => \&showJobName, showStatus => \&showStatus
, showSystem => index($build->job->name, $build->system) == -1
, nrCommits => $nrCommits
, authorList => $authorList
};
my $body;