From b29d7b10918466cbcf42418ad139073909c6931b Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 26 Feb 2014 11:05:46 -0500 Subject: [PATCH] Only email responsible authors when the build has changed --- src/lib/Hydra/Plugin/EmailNotification.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/Hydra/Plugin/EmailNotification.pm b/src/lib/Hydra/Plugin/EmailNotification.pm index 3a478a60..511fc1ed 100644 --- a/src/lib/Hydra/Plugin/EmailNotification.pm +++ b/src/lib/Hydra/Plugin/EmailNotification.pm @@ -80,7 +80,9 @@ sub buildFinished { my ($authors, $nrCommits, $emailable_authors) = getResponsibleAuthors($build, $self->{plugins}); my $authorList; - if (scalar keys %{$authors} > 0) { + my $prevBuild = getPreviousBuild($build); + if (scalar keys %{$authors} > 0 && + ((!defined $prevBuild) || ($build->buildstatus != $prevBuild->buildstatus))) { my @x = map { "$_ <$authors->{$_}>" } (sort keys %{$authors}); $authorList = join(" or ", scalar @x > 1 ? join(", ", @x[0..scalar @x - 2]): (), $x[-1]); $addresses{$_} = { builds => [ $build ] } foreach (@{$emailable_authors});