提交 2c350101 编写于 作者: J jbq

Issue number: 747

List of possible culprits for repeated failed builds should be cumulative


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@4666 71c3de6d-444a-0410-be80-ed276b4c234a
上级 ace3257d
......@@ -37,6 +37,7 @@ import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.mail.Address;
import javax.servlet.ServletException;
import org.kohsuke.stapler.StaplerRequest;
......@@ -70,6 +71,8 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
*/
private Integer quietPeriod = null;
public volatile Set<User> culprits = new HashSet<User>();
/**
* If this project is configured to be only built on a certain label,
* this value will be set to that label.
......
......@@ -117,6 +117,9 @@ public class MailSender<P extends AbstractProject<P, B>, B extends AbstractBuild
appendBuildUrl(build, buf);
msg.setText(buf.toString());
// Reset the list of culprits
build.getProject().culprits.clear();
return msg;
}
......@@ -248,18 +251,18 @@ public class MailSender<P extends AbstractProject<P, B>, B extends AbstractBuild
listener.getLogger().println("Trying to send e-mails to individuals who broke the build. sizeof(changeset)=="+count);
}
Set<User> users = new HashSet<User>();
for (Entry change : build.getChangeSet()) {
User a = change.getAuthor();
if (users.add(a)) {
String adrs = Util.fixEmpty(a.getProperty(Mailer.UserProperty.class).getAddress());
if(debug)
listener.getLogger().println(" User "+a.getId()+" -> "+adrs);
if (adrs != null)
rcp.add(new InternetAddress(adrs));
else {
listener.getLogger().println("Failed to send e-mail to " + a.getFullName() + " because no e-mail address is known, and no default e-mail domain is configured");
}
build.getProject().culprits.add(change.getAuthor());
}
for (User a : build.getProject().culprits) {
String adrs = Util.fixEmpty(a.getProperty(Mailer.UserProperty.class).getAddress());
if(debug)
listener.getLogger().println(" User "+a.getId()+" -> "+adrs);
if (adrs != null)
rcp.add(new InternetAddress(adrs));
else {
listener.getLogger().println("Failed to send e-mail to " + a.getFullName() + " because no e-mail address is known, and no default e-mail domain is configured");
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册