diff --git a/src/lib/Hydra/Controller/Jobset.pm b/src/lib/Hydra/Controller/Jobset.pm index 0fa18717..75f1738a 100644 --- a/src/lib/Hydra/Controller/Jobset.pm +++ b/src/lib/Hydra/Controller/Jobset.pm @@ -206,7 +206,6 @@ sub updateJobset { , nixexprinput => $nixExprInput , enabled => $enabled ? 1 : 0 , enableemail => defined $c->stash->{params}->{enableemail} ? 1 : 0 - , emailresponsible => defined $c->stash->{params}->{emailresponsible} ? 1 : 0 , emailoverride => trim($c->stash->{params}->{emailoverride}) || "" , hidden => defined $c->stash->{params}->{visible} ? 0 : 1 , keepnr => int(trim($c->stash->{params}->{keepnr})) @@ -232,7 +231,7 @@ sub updateJobset { my $input = $jobset->jobsetinputs->create({ name => $name, type => $type, - checkresponsible => $c->stash->{params}->{"input-$baseName-checkresponsible"} + emailresponsible => defined $c->stash->{params}->{"input-$baseName-emailresponsible"} ? 1 : 0 }); # Set the values for this input. diff --git a/src/lib/Hydra/Helper/AddBuilds.pm b/src/lib/Hydra/Helper/AddBuilds.pm index d8b1af8b..99f1b85e 100644 --- a/src/lib/Hydra/Helper/AddBuilds.pm +++ b/src/lib/Hydra/Helper/AddBuilds.pm @@ -148,7 +148,7 @@ sub fetchInputSystemBuild { } sub fetchInput { - my ($plugins, $db, $project, $jobset, $name, $type, $value, $checkresponsbile) = @_; + my ($plugins, $db, $project, $jobset, $name, $type, $value, $emailresponsible) = @_; my @inputs; if ($type eq "build") { @@ -179,7 +179,7 @@ sub fetchInput { foreach my $input (@inputs) { $input->{type} = $type; - $input->{checkresponsible} = $checkresponsible; + $input->{emailresponsible} = $emailresponsible; } return @inputs; @@ -545,7 +545,7 @@ sub checkBuild { , uri => $input->{uri} , revision => $input->{revision} , value => $input->{value} - , checkresponsible => $input->{checkresponsible} + , emailresponsible => $input->{emailresponsible} , dependency => $input->{id} , path => $input->{storePath} || "" # !!! temporary hack , sha256hash => $input->{sha256hash} diff --git a/src/lib/Hydra/Helper/CatalystUtils.pm b/src/lib/Hydra/Helper/CatalystUtils.pm index 08ca5587..296f3118 100644 --- a/src/lib/Hydra/Helper/CatalystUtils.pm +++ b/src/lib/Hydra/Helper/CatalystUtils.pm @@ -259,10 +259,11 @@ sub getResponsibleAuthors { my $nrCommits = 0; my %authors; + my @emailable_authors; if ($prevBuild) { foreach my $curInput ($build->buildinputs_builds) { - next unless (($curInput->type eq "git" || $curInput->type eq "hg") && $curInput->checkresponsible); + next unless ($curInput->type eq "git" || $curInput->type eq "hg"); my $prevInput = $prevBuild->buildinputs_builds->find({ name => $curInput->name }); next unless defined $prevInput; @@ -278,12 +279,13 @@ sub getResponsibleAuthors { foreach my $commit (@commits) { #print STDERR "$commit->{revision} by $commit->{author}\n"; $authors{$commit->{author}} = $commit->{email}; + push @emailable_authors, $commit->{email} if $curInput->emailresponsible; $nrCommits++; } } } - return (\%authors, $nrCommits); + return (\%authors, $nrCommits, \@emailable_authors); } diff --git a/src/lib/Hydra/Plugin/EmailNotification.pm b/src/lib/Hydra/Plugin/EmailNotification.pm index f18a6569..e30f48af 100644 --- a/src/lib/Hydra/Plugin/EmailNotification.pm +++ b/src/lib/Hydra/Plugin/EmailNotification.pm @@ -79,14 +79,12 @@ sub buildFinished { } } - my ($authors, $nrCommits) = getResponsibleAuthors($build, $self->{plugins}); + my ($authors, $nrCommits, $emailable_authors) = 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]); - if ($build->jobset->emailresponsible) { - $addresses{$authors->{$_}} = { builds => [ $build ] } foreach (keys %{$authors}); - } + $addresses{$_} = { builds => [ $build ] } foreach (@{$emailable_authors}); } # Send an email to each interested address. diff --git a/src/lib/Hydra/Schema/BuildInputs.pm b/src/lib/Hydra/Schema/BuildInputs.pm index 3c2bb0fb..dafae860 100644 --- a/src/lib/Hydra/Schema/BuildInputs.pm +++ b/src/lib/Hydra/Schema/BuildInputs.pm @@ -72,7 +72,7 @@ __PACKAGE__->table("BuildInputs"); data_type: 'text' is_nullable: 1 -=head2 checkresponsible +=head2 emailresponsible data_type: 'integer' default_value: 0 @@ -111,7 +111,7 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 1 }, "value", { data_type => "text", is_nullable => 1 }, - "checkresponsible", + "emailresponsible", { data_type => "integer", default_value => 0, is_nullable => 0 }, "dependency", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, @@ -176,7 +176,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-10-07 14:04:49 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ks8PxHXTwtG+Zco0CAzECg +# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-10-08 13:08:15 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OaJPzRM+8XGsu3eIkqeYEw 1; diff --git a/src/lib/Hydra/Schema/JobsetInputs.pm b/src/lib/Hydra/Schema/JobsetInputs.pm index f1773693..c6dafde1 100644 --- a/src/lib/Hydra/Schema/JobsetInputs.pm +++ b/src/lib/Hydra/Schema/JobsetInputs.pm @@ -57,7 +57,7 @@ __PACKAGE__->table("JobsetInputs"); data_type: 'text' is_nullable: 0 -=head2 checkresponsible +=head2 emailresponsible data_type: 'integer' default_value: 0 @@ -74,7 +74,7 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 0 }, "type", { data_type => "text", is_nullable => 0 }, - "checkresponsible", + "emailresponsible", { data_type => "integer", default_value => 0, is_nullable => 0 }, ); @@ -150,7 +150,7 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-10-07 14:04:49 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OvSrNdXWqco666sy+rvsKw +# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-10-08 13:06:15 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+mZZqLjQNwblb/EWW1alLQ 1; diff --git a/src/lib/Hydra/Schema/Jobsets.pm b/src/lib/Hydra/Schema/Jobsets.pm index 2953b063..8ca9d174 100644 --- a/src/lib/Hydra/Schema/Jobsets.pm +++ b/src/lib/Hydra/Schema/Jobsets.pm @@ -95,12 +95,6 @@ __PACKAGE__->table("Jobsets"); default_value: 1 is_nullable: 0 -=head2 emailresponsible - - data_type: 'integer' - default_value: 0 - is_nullable: 0 - =head2 hidden data_type: 'integer' @@ -160,8 +154,6 @@ __PACKAGE__->add_columns( { data_type => "integer", default_value => 1, is_nullable => 0 }, "enableemail", { data_type => "integer", default_value => 1, is_nullable => 0 }, - "emailresponsible", - { data_type => "integer", default_value => 0, is_nullable => 0 }, "hidden", { data_type => "integer", default_value => 0, is_nullable => 0 }, "emailoverride", @@ -295,7 +287,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-10-07 14:04:49 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hJ41oHEb9PjzluvL7f/ypw +# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-10-08 13:06:15 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BjT60mlrN7bnljqCMHbPEw 1; diff --git a/src/root/edit-jobset.tt b/src/root/edit-jobset.tt index 47213f11..383bbea9 100644 --- a/src/root/edit-jobset.tt +++ b/src/root/edit-jobset.tt @@ -26,7 +26,7 @@ [% IF edit %][% END %]
Input name | Type | Values | Check for responsible commits? |
---|---|---|---|
Input name | Type | Values | Notify committers |