Skip to content

Commit

Permalink
added force mode issue #956 on buildbot tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
varunsharma committed Mar 16, 2014
1 parent 66784b8 commit 2f360b7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion master/buildbot/status/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ class MailNotifier(base.StatusReceiverMultiService):
"subject", "sendToInterestedUsers", "customMesg",
"messageFormatter", "extraHeaders"]

possible_modes = ("change", "failing", "passing", "problem", "warnings", "exception")
possible_modes = ("change", "failing", "passing", "problem", "warnings",
"exception", "force")

def __init__(self, fromaddr, mode=("failing", "passing", "warnings"),
categories=None, builders=None, addLogs=False,
Expand Down Expand Up @@ -290,6 +291,7 @@ def __init__(self, fromaddr, mode=("failing", "passing", "warnings"),
when the previous build passed
- "warnings": send mail if a build contain warnings
- "exception": send mail if a build fails due to an exception
- "force": send mail to the user who forces a build.
- "all": always send mail
Defaults to ("failing", "passing", "warnings").
Expand Down Expand Up @@ -398,6 +400,8 @@ def __init__(self, fromaddr, mode=("failing", "passing", "warnings"),
mode = ("failing", "passing", "warnings", "exception")
elif mode == "warnings":
mode = ("failing", "warnings")
elif mode == "force":
mode = ("force",)
else:
mode = (mode,)
for m in mode:
Expand Down Expand Up @@ -506,6 +510,8 @@ def isMailNeeded(self, build, results):
return False # ignore this build

prev = self.getPreviousBuild(build)
if "force" in self.mode:
return True
if "change" in self.mode:
if prev and prev.getResults() != results:
return True
Expand Down

0 comments on commit 2f360b7

Please sign in to comment.