Skip to content

Commit

Permalink
Merge remote-tracking branch 'buildbot/master' into travis_integration
Browse files Browse the repository at this point in the history
  • Loading branch information
rutsky committed Aug 21, 2013
2 parents 579fa09 + 0933fea commit 8af4589
Show file tree
Hide file tree
Showing 43 changed files with 817 additions and 738 deletions.
5 changes: 3 additions & 2 deletions Makefile
Expand Up @@ -9,8 +9,9 @@ apidocs:
$(MAKE) -C apidocs

pylint:
cd master; $(MAKE) pylint
cd slave; $(MAKE) pylint
$(MAKE) -C master pylint; master_res=$$?; \
$(MAKE) -C slave pylint; slave_res=$$?; \
if [ $$master_res != 0 ] || [ $$slave_res != 0 ]; then exit 1; fi

pyflakes:
pyflakes master/buildbot slave/buildslave
8 changes: 7 additions & 1 deletion common/pylintrc
Expand Up @@ -83,10 +83,13 @@ disable=
C0202,
C0204,
C0301,
C0303,
C0304,
C0321,
C0322,
C0323,
C0324,
C1001,
E0101,
E0102,
E0202,
Expand All @@ -106,6 +109,7 @@ disable=
E1124,
F0401,
R0401,
W0121,
W0122,
W0142,
W0101,
Expand Down Expand Up @@ -139,13 +143,15 @@ disable=
W0621,
W0622,
W0631,
W0632,
W0701,
W0702,
W0703,
W0710,
W1001,
W1401,
W1402
W1402,
W1501

[REPORTS]

Expand Down
9 changes: 9 additions & 0 deletions common/validate.sh
Expand Up @@ -88,6 +88,15 @@ check_relnotes || not_ok "$REVRANGE does not add release notes"
status "running pyflakes"
sandbox/bin/pyflakes master/buildbot slave/buildslave || not_ok "failed pyflakes"

status "running pylint (SLOW)"
status "..master"
(cd master; time pylint --rcfile=../common/pylintrc buildbot); master_res=$?
status "..slave"
(cd slave; time pylint --rcfile=../common/pylintrc buildslave); slave_res=$?
if [ $master_res != 0 ] || [ $slave_res != 0 ]; then
not_ok "failed pylint";
fi

status "building docs"
make -C master/docs VERSION=latest clean html || not_ok "docs failed"

Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/buildslave/base.py
Expand Up @@ -864,7 +864,7 @@ def _substantiate(self, build):
def start_instance_result(result):
# If we don't report success, then preparation failed.
if not result:
log.msg("Slave '%s' doesn not want to substantiate at this time" % (self.slavename,))
log.msg("Slave '%s' does not want to substantiate at this time" % (self.slavename,))
d = self.substantiation_deferred
self.substantiation_deferred = None
d.callback(False)
Expand Down
1 change: 1 addition & 0 deletions master/buildbot/buildslave/libvirt.py
Expand Up @@ -14,6 +14,7 @@
# Portions Copyright Buildbot Team Members
# Portions Copyright 2010 Isotoma Limited

from __future__ import absolute_import
import os

from twisted.internet import defer, utils, threads
Expand Down
4 changes: 2 additions & 2 deletions master/buildbot/changes/svnpoller.py
Expand Up @@ -198,7 +198,7 @@ def determine_prefix(output):
try:
doc = xml.dom.minidom.parseString(output)
except xml.parsers.expat.ExpatError:
log.msg("SVNPoller: SVNPoller._determine_prefix_2: ExpatError in '%s'"
log.msg("SVNPoller: SVNPoller.get_prefix: ExpatError in '%s'"
% output)
raise
rootnodes = doc.getElementsByTagName("root")
Expand Down Expand Up @@ -337,7 +337,7 @@ def create_changes(self, new_logentries):
kind = p.getAttribute("kind")
action = p.getAttribute("action")
path = "".join([t.data for t in p.childNodes])
# the rest of buildbot is certaily not yet ready to handle
# the rest of buildbot is certainly not yet ready to handle
# unicode filenames, because they get put in RemoteCommands
# which get sent via PB to the buildslave, and PB doesn't
# handle unicode.
Expand Down
10 changes: 2 additions & 8 deletions master/buildbot/clients/tryclient.py
Expand Up @@ -861,19 +861,13 @@ def getAvailableBuilderNames(self):
d.addCallback(self._getBuilderNames, self._getBuilderNames2)
return d
if self.connect == "ssh":
print "Cannot get availble builders over ssh."
print "Cannot get available builders over ssh."
sys.exit(1)
raise RuntimeError(
"unknown connecttype '%s', should be 'pb'" % self.connect)

def _getBuilderNames(self, remote, output):
# Older schedulers won't support the properties argument, so only
# attempt to send them when necessary.
properties = self.config.get('properties', {})
if properties:
d = remote.callRemote("getAvailableBuilderNames", properties)
else:
d = remote.callRemote("getAvailableBuilderNames")
d = remote.callRemote("getAvailableBuilderNames")
d.addCallback(self._getBuilderNames2)
return d

Expand Down
7 changes: 3 additions & 4 deletions master/buildbot/process/buildrequestdistributor.py
Expand Up @@ -462,8 +462,7 @@ def _sortBuilders(self, buildernames):
builders = yield defer.maybeDeferred(lambda :
sorter(self.master, builders))
except Exception:
log.msg("Exception prioritizing builders; order unspecified")
log.err(Failure())
log.err(Failure(), "prioritizing builders; order unspecified")

# and return the names
rv = [ b.name for b in builders ]
Expand Down Expand Up @@ -492,9 +491,9 @@ def _activityLoop(self):
bldr_name = self._pending_builders.pop(0)
self.pending_builders_lock.release()

# get the actual builder object
bldr = self.botmaster.builders.get(bldr_name)
try:
# get the actual builder object
bldr = self.botmaster.builders.get(bldr_name)
if bldr:
yield self._maybeStartBuildsOnBuilder(bldr)
except Exception:
Expand Down
12 changes: 2 additions & 10 deletions master/buildbot/process/buildstep.py
Expand Up @@ -30,7 +30,6 @@
EXCEPTION, RETRY, worst_status
from buildbot.process import metrics, properties
from buildbot.util.eventual import eventually
from buildbot.interfaces import BuildSlaveTooOldError

class BuildStepFailed(Exception):
pass
Expand Down Expand Up @@ -362,8 +361,7 @@ def __init__(self, workdir, command, env=None,
usePTY="slave-config", logEnviron=True,
collectStdout=False,collectStderr=False,
interruptSignal=None,
initialStdin=None, decodeRC={0:SUCCESS},
user=None):
initialStdin=None, decodeRC={0:SUCCESS}):

self.command = command # stash .command, set it later
self.fake_command = [w[2] if (isinstance(w, tuple) and len(w) == 3 and w[0] =='obfuscated')
Expand All @@ -386,8 +384,6 @@ def __init__(self, workdir, command, env=None,
}
if interruptSignal is not None:
args['interruptSignal'] = interruptSignal
if user is not None:
args['user'] = user
RemoteCommand.__init__(self, "shell", args, collectStdout=collectStdout,
collectStderr=collectStderr,
decodeRC=decodeRC)
Expand All @@ -399,10 +395,6 @@ def _start(self):
# fixup themselves
if self.step.slaveVersion("shell", "old") == "old":
self.args['dir'] = self.args['workdir']
if ('user' in self.args and
self.step.slaveVersionIsOlderThan("shell", "2.16")):
m = "slave does not support the 'user' parameter"
raise BuildSlaveTooOldError(m)
what = "command '%s' in dir '%s'" % (self.fake_command,
self.args['workdir'])
log.msg(what)
Expand Down Expand Up @@ -509,7 +501,7 @@ def setDefaultWorkdir(self, workdir):
pass

def addFactoryArguments(self, **kwargs):
# this is here for backwards compatability
# this is here for backwards compatibility
pass

def _getStepFactory(self):
Expand Down
29 changes: 17 additions & 12 deletions master/buildbot/process/factory.py
Expand Up @@ -13,23 +13,22 @@
#
# Copyright Buildbot Team Members

import warnings
from twisted.python import deprecate, versions

from buildbot import interfaces, util
from buildbot.process.build import Build
from buildbot.process.buildstep import BuildStep
from buildbot.steps.source import CVS, SVN
from buildbot.steps.shell import Configure, Compile, Test, PerlModuleTest

class ArgumentsInTheWrongPlace(Exception):
"""When calling BuildFactory.addStep(stepinstance), addStep() only takes
one argument. You passed extra arguments to addStep(), which you probably
intended to pass to your BuildStep constructor instead. For example, you
should do::
f.addStep(ShellCommand(command=['echo','stuff'], haltOnFailure=True))
# deprecated, use BuildFactory.addStep
@deprecate.deprecated(versions.Version("buildbot", 0, 8, 6))
def s(steptype, **kwargs):
# convenience function for master.cfg files, to create step
# specification tuples
return interfaces.IBuildStepFactory(steptype(**kwargs))

instead of::
f.addStep(ShellCommand(command=['echo','stuff']), haltOnFailure=True)
"""

class BuildFactory(util.ComparableMixin):
"""
Expand Down Expand Up @@ -58,7 +57,13 @@ def newBuild(self, requests):
b.setStepFactories(self.steps)
return b

def addStep(self, step):
def addStep(self, step, **kwargs):
if kwargs or (type(step) == type(BuildStep) and issubclass(step, BuildStep)):
warnings.warn(
"Passing a BuildStep subclass to factory.addStep is "
"deprecated. Please pass a BuildStep instance instead.",
DeprecationWarning, stacklevel=2)
step = step(**kwargs)
self.steps.append(interfaces.IBuildStepFactory(step))

def addSteps(self, steps):
Expand Down
4 changes: 2 additions & 2 deletions master/buildbot/process/properties.py
Expand Up @@ -354,7 +354,7 @@ def getRenderingFor(self, build):


def _getInterpolationList(fmtstring):
# TODO: Verify that no positial substitutions are requested
# TODO: Verify that no positional substitutions are requested
dd = collections.defaultdict(str)
fmtstring % dd
return dd.keys()
Expand Down Expand Up @@ -642,7 +642,7 @@ def renderer(fn):

class _DefaultRenderer(object):
"""
Default IRenderable adaptor. Calls .getRenderingFor if availble, otherwise
Default IRenderable adaptor. Calls .getRenderingFor if available, otherwise
returns argument unchanged.
"""

Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/schedulers/trysched.py
Expand Up @@ -264,7 +264,7 @@ def perspective_try(self, branch, revision, patch, repository, project,
from buildbot.status.client import makeRemote
defer.returnValue(makeRemote(bss))

def perspective_getAvailableBuilderNames(self, properties={}):
def perspective_getAvailableBuilderNames(self):
# Return a list of builder names that are configured
# for the try service
# This is mostly intended for integrating try services
Expand Down
4 changes: 2 additions & 2 deletions master/buildbot/scripts/base.py
Expand Up @@ -43,8 +43,8 @@ def getConfigFileFromTac(basedir):
# execute the .tac file to see if its configfile location exists
tacFile = os.path.join(basedir, 'buildbot.tac')
if os.path.exists(tacFile):
# don't mess with the global namespace
tacGlobals = {}
# don't mess with the global namespace, but set __file__ for relocatable buildmasters
tacGlobals = {'__file__' : tacFile}
execfile(tacFile, tacGlobals)
return tacGlobals.get("configfile", "master.cfg")
else:
Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/status/status_gerrit.py
Expand Up @@ -93,7 +93,7 @@ def buildStarted(self, builderName, build):

def buildFinished(self, builderName, build, result):
"""Do the SSH gerrit verify command to the server."""
message, verified, reviewed = self.reviewCB(builderName, build, result, self.reviewArg)
message, verified, reviewed = self.reviewCB(builderName, build, result, self.status, self.reviewArg)
self.sendCodeReviews(build, message, verified, reviewed)

def sendCodeReviews(self, build, message, verified=0, reviewed=0):
Expand Down

0 comments on commit 8af4589

Please sign in to comment.