Author: Armin Rigo <[email protected]>
Branch:
Changeset: r1015:1767edfa9b72
Date: 2016-08-25 09:22 +0200
http://bitbucket.org/pypy/buildbot/changeset/1767edfa9b72/
Log: Forbid "stop build" to be clicked with a blank field. More
precisely, a reason must be given which starts with "!". This
condition is written down clearly in the error we get if we don't
specify it, so it should not deter human beings, but be enough to
stop accidents or 3rd-party bots.
diff --git a/bot2/pypybuildbot/master.py b/bot2/pypybuildbot/master.py
--- a/bot2/pypybuildbot/master.py
+++ b/bot2/pypybuildbot/master.py
@@ -6,6 +6,7 @@
from buildbot.buildslave import BuildSlave
from buildbot.status.html import WebStatus
from buildbot.status.web import authz
+from buildbot.process.build import Build
#from buildbot import manhole
from pypybuildbot.pypylist import PyPyList, NumpyStatusList
from pypybuildbot.ircbot import IRC # side effects
@@ -18,6 +19,14 @@
raise ValidationError, "Please write your name in the
corresponding field."
return ForceScheduler.force(self, owner, builder_name, **kwargs)
+# Forbid "stop build" without a reason that starts with "!"
+def _checkStopBuild(self, reason=""):
+ if ": !" not in reason:
+ raise ValidationError, "Please write a reason that starts with '!'."
+ return _baseStopBuild(self, reason)
+_baseStopBuild = Build.stopBuild
+Build.stopBuild = _checkStopBuild
+
if we_are_debugging():
channel = '#buildbot-test'
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit