From warner at users.sourceforge.net Tue May 3 04:31:22 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 03 May 2005 04:31:22 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.14,1.15 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11507/buildbot/scripts Modified Files: runner.py Log Message: * buildbot/scripts/runner.py (Maker.makefile): chmod before edit, deals better with source Makefile coming from a read-only CVS checkout. Thanks to Nick Trout for the catch. * buildbot/__init__.py (version): bump to 0.6.4+ while between releases Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- runner.py 26 Apr 2005 20:10:10 -0000 1.14 +++ runner.py 3 May 2005 04:31:20 -0000 1.15 @@ -67,13 +67,13 @@ print "installing sample in Makefile.sample instead" target = "Makefile.sample" shutil.copy(source, target) + os.chmod(target, 0600) f = open(target, "a") f.write("\n") f.write("tap:\n") f.write("\t" + cmd + "\n") f.write("\n") f.close() - os.chmod(target, 0600) def sampleconfig(self, source): target = "master.cfg" From warner at users.sourceforge.net Tue May 3 04:31:22 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 03 May 2005 04:31:22 +0000 Subject: [Buildbot-commits] buildbot/buildbot __init__.py,1.11,1.12 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11507/buildbot Modified Files: __init__.py Log Message: * buildbot/scripts/runner.py (Maker.makefile): chmod before edit, deals better with source Makefile coming from a read-only CVS checkout. Thanks to Nick Trout for the catch. * buildbot/__init__.py (version): bump to 0.6.4+ while between releases Index: __init__.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/__init__.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- __init__.py 28 Apr 2005 07:57:28 -0000 1.11 +++ __init__.py 3 May 2005 04:31:20 -0000 1.12 @@ -1,3 +1,3 @@ #! /usr/bin/python -version = "0.6.4" +version = "0.6.4+" From warner at users.sourceforge.net Tue May 3 04:31:23 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 03 May 2005 04:31:23 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.405,1.406 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11507 Modified Files: ChangeLog Log Message: * buildbot/scripts/runner.py (Maker.makefile): chmod before edit, deals better with source Makefile coming from a read-only CVS checkout. Thanks to Nick Trout for the catch. * buildbot/__init__.py (version): bump to 0.6.4+ while between releases Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.405 retrieving revision 1.406 diff -u -d -r1.405 -r1.406 --- ChangeLog 28 Apr 2005 07:57:28 -0000 1.405 +++ ChangeLog 3 May 2005 04:31:20 -0000 1.406 @@ -1,3 +1,12 @@ +2005-05-02 Brian Warner + + * buildbot/scripts/runner.py (Maker.makefile): chmod before edit, + deals better with source Makefile coming from a read-only CVS + checkout. Thanks to Nick Trout for the catch. + + * buildbot/__init__.py (version): bump to 0.6.4+ while between + releases + 2005-04-28 Brian Warner * buildbot/__init__.py (version): Releasing buildbot-0.6.4 From warner at users.sourceforge.net Tue May 3 04:34:05 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 03 May 2005 04:34:05 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status html.py,1.58,1.59 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12050 Modified Files: html.py Log Message: update comment, thanks to Stephen Thorne Index: html.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- html.py 26 Apr 2005 20:25:30 -0000 1.58 +++ html.py 3 May 2005 04:34:02 -0000 1.59 @@ -1251,7 +1251,8 @@ if strip[-1] == None: if sourceEvents[i-1]: filler = IBox(sourceEvents[i-1]).getBox() - else: # TODO: can this actually happen? + else: + # this can happen if you delete part of the build history filler = Box(text=["?"], align="center") strip[-1] = filler strip[-1].parms['rowspan'] = 1 From warner at users.sourceforge.net Tue May 3 04:59:50 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 03 May 2005 04:59:50 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts sample.cfg,1.3,1.4 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16565/buildbot/scripts Modified Files: sample.cfg Log Message: improve docs for c['buildbotURL'], thanks to Nick Trout. Index: sample.cfg =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/sample.cfg,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- sample.cfg 1 Oct 2004 00:42:00 -0000 1.3 +++ sample.cfg 3 May 2005 04:59:47 -0000 1.4 @@ -123,11 +123,12 @@ c['projectURL'] = "http://buildbot.sourceforge.net/" # the 'buildbotURL' string should point to the location where the buildbot's -# internal web server is visible. This is typically at the port number set in -# the Waterfall 'status' entry, but at an externally-visible host name which -# the buildbot cannot on its own. +# internal web server (usually the html.Waterfall page) is visible. This +# typically uses the port number set in the Waterfall 'status' entry, but +# with an externally-visible host name which the buildbot cannot figure out +# without some help. -c['buildbotURL'] = "http://localhost:8080/" +c['buildbotURL'] = "http://localhost:8010/" # finally we define the name that the buildmaster has been waiting for. From warner at users.sourceforge.net Tue May 3 04:59:51 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 03 May 2005 04:59:51 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.406,1.407 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16565 Modified Files: ChangeLog Log Message: improve docs for c['buildbotURL'], thanks to Nick Trout. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.406 retrieving revision 1.407 diff -u -d -r1.406 -r1.407 --- ChangeLog 3 May 2005 04:31:20 -0000 1.406 +++ ChangeLog 3 May 2005 04:59:48 -0000 1.407 @@ -1,5 +1,8 @@ 2005-05-02 Brian Warner + * buildbot/scripts/sample.cfg: improve docs for c['buildbotURL'], + thanks to Nick Trout. + * buildbot/scripts/runner.py (Maker.makefile): chmod before edit, deals better with source Makefile coming from a read-only CVS checkout. Thanks to Nick Trout for the catch. From warner at users.sourceforge.net Tue May 3 20:02:07 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 03 May 2005 20:02:07 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_vc.py,1.26,1.27 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3245/buildbot/test Modified Files: test_vc.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-117 Creator: Brian Warner support Baz, revisions for tla+baz, make error steps terminate build * buildbot/process/base.py (Build.startBuild): fix a bug that caused an exception when the build terminated in the very first step. (Build.stepDone): let steps return a status of EXCEPTION. This terminates the build right away, and sets the build's overall status to EXCEPTION too. * buildbot/process/step.py (BuildStep.failed): return a status of EXCEPTION when that is what has happened. * buildbot/process/step.py (Arch.computeSourceRevision): finally implement this, allowing Arch-based projects to get precise checkouts instead of always using the latest code (Bazaar): create variant of Arch to let folks use baz instead of tla. Requires a new buildslave too. * buildbot/slave/commands.py (Arch): add 'revision' argument (Bazaar): create variant of Arch that uses baz instead of tla. Remove the code that extracts the archive name from the register-archive output, since baz doesn't provide it, and require the user provide both the archive name and its location. * buildbot/test/test_vc.py (VC.testBazaar): added tests Index: test_vc.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- test_vc.py 26 Apr 2005 09:43:17 -0000 1.26 +++ test_vc.py 3 May 2005 20:02:04 -0000 1.27 @@ -64,13 +64,15 @@ # many VC systems can access the repository via HTTP self.Repository_HTTP = "http://localhost:%d" - self.have = {'arch': False, 'darcs': False, + self.have = {'tla': False, 'baz': False, 'darcs': False, 'svn': False, 'cvs': False, } for p in os.environ['PATH'].split(os.pathsep): if os.path.exists(os.path.join(p, 'tla')): - self.have['arch'] = True + self.have['tla'] = True + if os.path.exists(os.path.join(p, 'baz')): + self.have['baz'] = True if os.path.exists(os.path.join(p, 'darcs')): self.have['darcs'] = True if os.path.exists(os.path.join(p, 'svn')): @@ -90,8 +92,10 @@ if not self.have['svn']: log.msg("could not find usable 'svn', skipping Subversion tests") - if not self.have['arch']: - log.msg("could not find 'tla' on $PATH, skipping Arch tests") + if not self.have['tla']: + log.msg("could not find 'tla' on $PATH, skipping some Arch tests") + if not self.have['baz']: + log.msg("could not find 'baz' on $PATH, skipping some Arch tests") if not self.have['darcs']: log.msg("could not find 'darcs' on $PATH, skipping Darcs tests") if not self.have['cvs']: @@ -318,7 +322,7 @@ if metadir: self.loadConfig(config % 'export') - self.doBuild() #"export rebuild clobbers new files + self.doBuild() # export rebuild clobbers new files if metadir: self.shouldNotExist(workdir, metadir) self.shouldNotExist(workdir, "newfile") @@ -361,7 +365,7 @@ # Arch def testArch(self): - if not VCS.have['arch']: + if not VCS.have['tla']: raise unittest.SkipTest("Arch (tla) is not installed") self.do_vc("step.Arch", { 'url': VCS.RepositoryPath + "/Arch-Repository", @@ -384,6 +388,17 @@ # change it from the default, then 'tla update' won't work. os.system("tla register-archive -d test at buildbot.sf.net--testvc") + def testBazaar(self): + if not VCS.have['baz']: + raise unittest.SkipTest("Arch (baz) is not installed") + self.do_vc("step.Bazaar", { + 'url': VCS.RepositoryPath + "/Arch-Repository", + 'archive': "test at buildbot.sf.net--testvc", + 'version': "testvc--mainline--1", + }, + testRetry=False) + os.system("baz register-archive -d test at buildbot.sf.net--testvc") + class VC_HTTP(SetupMixin, unittest.TestCase): def serveHTTP(self): # launch an HTTP server to serve the repository files @@ -403,7 +418,7 @@ # Darcs has a metadir="_darcs", but it does not have an 'export' mode def testArchHTTP(self): - if not VCS.have['arch']: + if not VCS.have['tla']: raise unittest.SkipTest("Arch (tla) is not installed") self.do_vc("step.Arch", { 'url': VCS.Repository_HTTP % self.httpPort + "/Arch-Repository", @@ -411,6 +426,16 @@ }, testRetry=False) os.system("tla register-archive -d test at buildbot.sf.net--testvc") + def testBazaarHTTP(self): + if not VCS.have['baz']: + raise unittest.SkipTest("Arch (tla) is not installed") + self.do_vc("step.Bazaar", { + 'url': VCS.Repository_HTTP % self.httpPort + "/Arch-Repository", + 'archive': "test at buildbot.sf.net--testvc", + 'version': "testvc--mainline--1", + }, testRetry=False) + os.system("baz register-archive -d test at buildbot.sf.net--testvc") + class Patch(SetupMixin, unittest.TestCase): def failUnlessIn(self, substr, string): self.failUnless(string.find(substr) != -1) From warner at users.sourceforge.net Tue May 3 20:02:08 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 03 May 2005 20:02:08 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.27,1.28 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3245/buildbot/slave Modified Files: commands.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-117 Creator: Brian Warner support Baz, revisions for tla+baz, make error steps terminate build * buildbot/process/base.py (Build.startBuild): fix a bug that caused an exception when the build terminated in the very first step. (Build.stepDone): let steps return a status of EXCEPTION. This terminates the build right away, and sets the build's overall status to EXCEPTION too. * buildbot/process/step.py (BuildStep.failed): return a status of EXCEPTION when that is what has happened. * buildbot/process/step.py (Arch.computeSourceRevision): finally implement this, allowing Arch-based projects to get precise checkouts instead of always using the latest code (Bazaar): create variant of Arch to let folks use baz instead of tla. Requires a new buildslave too. * buildbot/slave/commands.py (Arch): add 'revision' argument (Bazaar): create variant of Arch that uses baz instead of tla. Remove the code that extracts the archive name from the register-archive output, since baz doesn't provide it, and require the user provide both the archive name and its location. * buildbot/test/test_vc.py (VC.testBazaar): added tests Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- commands.py 26 Apr 2005 21:37:16 -0000 1.27 +++ commands.py 3 May 2005 20:02:05 -0000 1.28 @@ -13,6 +13,7 @@ # version history: # >=1.17: commands are interruptable +# >=1.28: Arch understands 'revision', added Bazaar class CommandInterrupted(Exception): pass @@ -816,18 +817,21 @@ ['url'] (required): the repository string ['version'] (required): which version (i.e. branch) to retrieve + ['revision'] (optional): the 'patch-NN' argument to check out ['archive']: the archive name to use. If None, use the archive's default ['build-config']: if present, give to 'tla build-config' after checkout """ + arch_command = "tla" header = "arch operation" - archive = None buildconfig = None def setup(self, args): SourceBase.setup(self, args) + self.archive = args.get('archive') self.url = args['url'] self.version = args['version'] + self.revision = args.get('revision') def sourcedirIsUpdateable(self): if os.path.exists(os.path.join(self.builder.basedir, @@ -839,25 +843,21 @@ def doVCUpdate(self): # update: possible for mode in ('copy', 'update') d = os.path.join(self.builder.basedir, self.srcdir) - command = ['tla', 'replay'] + command = [self.arch_command, 'replay'] + if self.revision: + command.append(self.revision) c = ShellCommand(self.builder, command, d, sendRC=False, timeout=self.timeout) self.command = c return c.start() def doVCFull(self): - # to do a checkout, we first must register the archive. This - # involves passing the URL to arch and letting it tell us the - # archive name. + # to do a checkout, we must first "register" the archive by giving + # the URL to tla, which will go to the repository at that URL and + # figure out the archive name. tla will tell you the archive name + # when it is done, and all further actions must refer to this name. - if self.args['archive']: - # explicit archive name, we don't need to extract the default - # name from stdout - self.archive = self.args['archive'] - command = ['tla', 'register-archive', '--force', - self.archive, self.url] - else: - command = ['tla', 'register-archive', '--force', self.url] + command = [self.arch_command, 'register-archive', '--force', self.url] c = ShellCommand(self.builder, command, self.builder.basedir, sendRC=False, keepStdout=True, timeout=self.timeout) @@ -868,19 +868,30 @@ return d def _didRegister(self, res, c): - if not self.archive: - r = re.search(r'Registering archive: (\S+)\s*$', c.stdout) - if not r: - msg = "Unable to register archive" + # find out what tla thinks the archive name is. If the user told us + # to use something specific, make sure it matches. + r = re.search(r'Registering archive: (\S+)\s*$', c.stdout) + if r: + msg = "tla reports archive name is '%s'" % r.group(1) + log.msg(msg) + self.builder.sendUpdate({'header': msg+"\n"}) + if self.archive and r.group(1) != self.archive: + msg = (" mismatch, we wanted an archive named '%s'" + % self.archive) log.msg(msg) - log.msg('output is \"%s\"' % c.stdout) self.builder.sendUpdate({'header': msg+"\n"}) raise AbandonChain(-1) self.archive = r.group(1) - log.msg("computed archive name '%s'" % self.archive) - # TODO: revision - command = ['tla', 'get', '--archive', self.archive, '--no-pristine', - self.version, self.srcdir] + assert self.archive, "need archive name to continue" + return self._doGet() + + def _doGet(self): + ver = self.version + if self.revision: + ver += "--%s" % self.revision + command = [self.arch_command, 'get', '--archive', self.archive, + '--no-pristine', + ver, self.srcdir] c = ShellCommand(self.builder, command, self.builder.basedir, sendRC=False, timeout=self.timeout) self.command = c @@ -892,7 +903,7 @@ def _didGet(self, res): d = os.path.join(self.builder.basedir, self.srcdir) - command = ['tla', 'build-config', self.buildconfig] + command = [self.arch_command, 'build-config', self.buildconfig] c = ShellCommand(self.builder, command, d, sendRC=False, timeout=self.timeout) self.command = c @@ -902,6 +913,47 @@ registerSlaveCommand("arch", Arch, cvs_ver) +class Bazaar(Arch): + """Bazaar (/usr/bin/baz) is an alternative client for Arch repositories. + It is mostly option-compatible, but archive registration is different + enough to warrant a separate Command. + + ['archive'] (required): the name of the archive being used + """ + + arch_command = "baz" + + def setup(self, args): + Arch.setup(self, args) + # baz doesn't emit the repository name after registration (and + # grepping through the output of 'baz archives' is too hard), so we + # require that the buildmaster configuration to provide both the + # archive name and the URL. + self.archive = args['archive'] # required for Baz + + # in _didRegister, the regexp won't match, so we'll stick with the name + # in self.archive + + def _doGet(self): + # baz prefers ARCHIVE/VERSION. This will work even if + # my-default-archive is not set. + ver = self.archive + "/" + self.version + if self.revision: + ver += "--%s" % self.revision + command = [self.arch_command, 'get', '--no-pristine', + ver, self.srcdir] + c = ShellCommand(self.builder, command, self.builder.basedir, + sendRC=False, timeout=self.timeout) + self.command = c + d = c.start() + d.addCallback(self._abandonOnFailure) + if self.buildconfig: + d.addCallback(self._didGet) + return d + + + +registerSlaveCommand("bazaar", Bazaar, cvs_ver) class P4Sync(SourceBase): """A partial P4 source-updater. Requires manual setup of a per-slave P4 From warner at users.sourceforge.net Tue May 3 20:02:06 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 03 May 2005 20:02:06 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.407,1.408 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3245 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-117 Creator: Brian Warner support Baz, revisions for tla+baz, make error steps terminate build * buildbot/process/base.py (Build.startBuild): fix a bug that caused an exception when the build terminated in the very first step. (Build.stepDone): let steps return a status of EXCEPTION. This terminates the build right away, and sets the build's overall status to EXCEPTION too. * buildbot/process/step.py (BuildStep.failed): return a status of EXCEPTION when that is what has happened. * buildbot/process/step.py (Arch.computeSourceRevision): finally implement this, allowing Arch-based projects to get precise checkouts instead of always using the latest code (Bazaar): create variant of Arch to let folks use baz instead of tla. Requires a new buildslave too. * buildbot/slave/commands.py (Arch): add 'revision' argument (Bazaar): create variant of Arch that uses baz instead of tla. Remove the code that extracts the archive name from the register-archive output, since baz doesn't provide it, and require the user provide both the archive name and its location. * buildbot/test/test_vc.py (VC.testBazaar): added tests Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.407 retrieving revision 1.408 diff -u -d -r1.407 -r1.408 --- ChangeLog 3 May 2005 04:59:48 -0000 1.407 +++ ChangeLog 3 May 2005 20:02:04 -0000 1.408 @@ -1,3 +1,26 @@ +2005-05-03 Brian Warner + + * buildbot/process/base.py (Build.startBuild): fix a bug that + caused an exception when the build terminated in the very first + step. + (Build.stepDone): let steps return a status of EXCEPTION. This + terminates the build right away, and sets the build's overall + status to EXCEPTION too. + * buildbot/process/step.py (BuildStep.failed): return a status of + EXCEPTION when that is what has happened. + + * buildbot/process/step.py (Arch.computeSourceRevision): finally + implement this, allowing Arch-based projects to get precise + checkouts instead of always using the latest code + (Bazaar): create variant of Arch to let folks use baz instead of + tla. Requires a new buildslave too. + * buildbot/slave/commands.py (Arch): add 'revision' argument + (Bazaar): create variant of Arch that uses baz instead of tla. + Remove the code that extracts the archive name from the + register-archive output, since baz doesn't provide it, and require + the user provide both the archive name and its location. + * buildbot/test/test_vc.py (VC.testBazaar): added tests + 2005-05-02 Brian Warner * buildbot/scripts/sample.cfg: improve docs for c['buildbotURL'], From warner at users.sourceforge.net Tue May 3 20:02:06 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 03 May 2005 20:02:06 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process step.py,1.63,1.64 base.py,1.49,1.50 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3245/buildbot/process Modified Files: step.py base.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-117 Creator: Brian Warner support Baz, revisions for tla+baz, make error steps terminate build * buildbot/process/base.py (Build.startBuild): fix a bug that caused an exception when the build terminated in the very first step. (Build.stepDone): let steps return a status of EXCEPTION. This terminates the build right away, and sets the build's overall status to EXCEPTION too. * buildbot/process/step.py (BuildStep.failed): return a status of EXCEPTION when that is what has happened. * buildbot/process/step.py (Arch.computeSourceRevision): finally implement this, allowing Arch-based projects to get precise checkouts instead of always using the latest code (Bazaar): create variant of Arch to let folks use baz instead of tla. Requires a new buildslave too. * buildbot/slave/commands.py (Arch): add 'revision' argument (Bazaar): create variant of Arch that uses baz instead of tla. Remove the code that extracts the archive name from the register-archive output, since baz doesn't provide it, and require the user provide both the archive name and its location. * buildbot/test/test_vc.py (VC.testBazaar): added tests Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/base.py,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- base.py 24 Apr 2005 21:56:41 -0000 1.49 +++ base.py 3 May 2005 20:02:03 -0000 1.50 @@ -11,7 +11,8 @@ from buildbot import interfaces from buildbot.util import now -from buildbot.status.builder import SUCCESS, WARNINGS, FAILURE, Results +from buildbot.status.builder import SUCCESS, WARNINGS, FAILURE, EXCEPTION +from buildbot.status.builder import Results from buildbot.status.progress import BuildProgress class Build: @@ -270,7 +271,7 @@ self.build_status = build_status self.remote = remote self.remote.notifyOnDisconnect(self.lostRemote) - self.deferred = defer.Deferred() + d = self.deferred = defer.Deferred() try: self.setupBuild(expectations) # create .steps @@ -287,14 +288,13 @@ color="purple") self.finished = True self.results = FAILURE - d = self.deferred self.deferred = None d.callback(self) return d self.build_status.buildStarted(self) self.startNextStep() - return self.deferred + return d def setupBuild(self, expectations): # create the actual BuildSteps. If there are any name collisions, we @@ -418,6 +418,9 @@ self.result = WARNINGS if step.flunkOnWarnings: self.result = FAILURE + elif result == EXCEPTION: + self.result = EXCEPTION + terminate = True return terminate def lostRemote(self, remote): Index: step.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step.py,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- step.py 24 Apr 2005 21:56:41 -0000 1.63 +++ step.py 3 May 2005 20:02:01 -0000 1.64 @@ -566,7 +566,7 @@ # think that it is still running), but the build overall will now # finish log.msg("BuildStep.failed now firing callback") - self.deferred.callback(FAILURE) + self.deferred.callback(EXCEPTION) # utility methods that BuildSteps may find useful @@ -1191,14 +1191,11 @@ ShellCommand.start(self) class Arch(Source): - """Check out a source tree from an Arch repository at 'url'. 'version' - specifies which version number (development line) will be used for the - checkout: this is mostly equivalent to a branch name. - - This step will first register the archive, which requires a per-user - 'archive name' to correspond to the URL from which the sources can be - fetched. The archive's default name will be used for this unless you - override it by setting the 'archive' parameter. + """Check out a source tree from an Arch repository named 'archive' + available at 'url'. 'version' specifies which version number (development + line) will be used for the checkout: this is mostly equivalent to a + branch name. This version uses the 'tla' tool to do the checkout, to use + 'baz' see L{Bazaar} instead. """ name = "arch" @@ -1214,12 +1211,9 @@ @param version: the category--branch--version to check out @type archive: string - @param archive: an optional archive name, to override the one - provided by the repository. You might want to do this - if, for some reason, you are hosting the archive on - the same machine (and in the same account) as the - build slave, and you don't want to confuse local - access with remote access. + @param archive: The archive name. If provided, it must match the one + that comes from the repository. If not, the + repository's default will be used. """ Source.__init__(self, **kwargs) self.args.update({'url': url, @@ -1227,12 +1221,94 @@ 'archive': archive, }) - def startVC(self): + def checkSlaveVersion(self): slavever = self.slaveVersion("arch") assert slavever, "slave is too old, does not know about arch" + # slave 1.28 and later understand 'revision' + oldslave = False + try: + if slavever.startswith("1.") and int(slavever[2:]) < 28: + oldslave = True + except ValueError: + pass + if oldslave: + if not self.alwaysUseLatest: + log.msg("warning, slave is too old to use a revision") + + def startVC(self): + self.checkSlaveVersion() self.cmd = LoggedRemoteCommand("arch", self.args) ShellCommand.start(self) + def computeSourceRevision(self, changes): + # in Arch, fully-qualified revision numbers look like: + # arch at buildbot.sourceforge.net--2004/buildbot--dev--0--patch-104 + # For any given builder, all of this is fixed except the patch-104. + # The Change might have any part of the fully-qualified string, so we + # just look for the last part. We return the "patch-NN" string. + if not changes: + return None + lastChange = None + for c in changes: + if not c.revision: + continue + if c.revision.endswith("--base-0"): + rev = 0 + else: + i = c.revision.rindex("patch") + rev = int(c.revision[i+len("patch-"):]) + lastChange = max(lastChange, rev) + if lastChange is None: + return None + if lastChange == 0: + return "base-0" + return "patch-%d" % lastChange + +class Bazaar(Arch): + """Bazaar is an alternative client for Arch repositories. baz is mostly + compatible with tla, but archive registration is slightly different.""" + + + def __init__(self, url, version, archive, **kwargs): + """ + @type url: string + @param url: the Arch coordinates of the repository. This is + typically an http:// URL, but could also be the absolute + pathname of a local directory instead. + + @type version: string + @param version: the category--branch--version to check out + + @type archive: string + @param archive: The archive name (required). This must always match + the one that comes from the repository, otherwise the + buildslave will attempt to get sources from the wrong + archive. + """ + Source.__init__(self, **kwargs) + self.args.update({'url': url, + 'version': version, + 'archive': archive, + }) + + def checkSlaveVersion(self): + slavever = self.slaveVersion("arch") + assert slavever, "slave is too old, does not know about arch" + # slave 1.28 and later understand baz + oldslave = False + try: + if slavever.startswith("1.") and int(slavever[2:]) < 28: + oldslave = True + except ValueError: + pass + assert not oldslave, "slave is too old, does not know about baz" + + def startVC(self): + self.checkSlaveVersion() + self.cmd = LoggedRemoteCommand("bazaar", self.args) + ShellCommand.start(self) + + class todo_P4(Source): name = "p4" From warner at users.sourceforge.net Wed May 4 02:09:40 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 02:09:40 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_changes.py,1.2,1.3 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31343/buildbot/test Modified Files: test_changes.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-119 Creator: Brian Warner add 'buildbot sendchange' command * buildbot/scripts/runner.py (sendchange): new command to send a change to a buildbot.changes.pb.PBChangeSource receiver. * buildbot/test/test_changes.py (Sender): test it * buildbot/master.py (BuildMaster.startService): mark .readConfig after any reading of the config file, not just when we do it in startService. This makes some tests a bit cleaner. * buildbot/changes/pb.py: add some log messages Index: test_changes.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_changes.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- test_changes.py 24 Apr 2005 21:30:25 -0000 1.2 +++ test_changes.py 4 May 2005 02:09:38 -0000 1.3 @@ -1,8 +1,13 @@ # -*- test-case-name: buildbot.test.test_changes -*- from twisted.trial import unittest +dr = unittest.deferredResult +from twisted.internet import defer +from twisted.python import log +from buildbot import master from buildbot.changes import pb +from buildbot.scripts import runner d1 = {'files': ["Project/foo.c", "Project/bar/boo.c"], 'who': "marvin", @@ -53,3 +58,92 @@ self.failUnlessEqual(c3.comments, "mixed changes") self.failUnlessEqual(c3.who, "alice") +config_sender = """ +from buildbot.changes import pb +c = {} +c['bots'] = [] +c['builders'] = [] +c['sources'] = [pb.PBChangeSource(port=None)] +c['slavePortnum'] = 0 +BuildmasterConfig = c +""" + +class Sender(unittest.TestCase): + def setUp(self): + self.master = master.BuildMaster(".") + def tearDown(self): + d = defer.maybeDeferred(self.master.stopService) + dr(d) + + def testSender(self): + d = self.master.loadConfig(config_sender) + dr(d) + self.master.startService() + # TODO: BuildMaster.loadChanges replaces the change_svc object, so we + # have to load it twice. Clean this up. + d = self.master.loadConfig(config_sender) + dr(d) + + cm = self.master.change_svc + s1 = list(cm)[0] + port = self.master.slavePort._port.getHost().port + + options = {'username': "alice", + 'master': "localhost:%d" % port, + 'files': ["foo.c"], + } + + d = runner.sendchange(options) + dr(d) + + # now check that the change was received + self.failUnlessEqual(len(cm.changes), 1) + c = cm.changes.pop() + self.failUnlessEqual(c.who, "alice") + self.failUnlessEqual(c.files, ["foo.c"]) + self.failUnlessEqual(c.comments, "") + self.failUnlessEqual(c.revision, None) + + options['revision'] = "r123" + options['comments'] = "test change" + + d = runner.sendchange(options) + dr(d) + self.failUnlessEqual(len(cm.changes), 1) + c = cm.changes.pop() + self.failUnlessEqual(c.who, "alice") + self.failUnlessEqual(c.files, ["foo.c"]) + self.failUnlessEqual(c.comments, "test change") + self.failUnlessEqual(c.revision, "r123") + + # test options['logfile'] by creating a temporary file + logfile = self.mktemp() + f = open(logfile, "wt") + f.write("longer test change") + f.close() + options['comments'] = None + options['logfile'] = logfile + + d = runner.sendchange(options) + dr(d) + self.failUnlessEqual(len(cm.changes), 1) + c = cm.changes.pop() + self.failUnlessEqual(c.who, "alice") + self.failUnlessEqual(c.files, ["foo.c"]) + self.failUnlessEqual(c.comments, "longer test change") + self.failUnlessEqual(c.revision, "r123") + + # make sure that numeric revisions work too + options['logfile'] = None + del options['revision'] + options['revision_number'] = 42 + + d = runner.sendchange(options) + dr(d) + self.failUnlessEqual(len(cm.changes), 1) + c = cm.changes.pop() + self.failUnlessEqual(c.who, "alice") + self.failUnlessEqual(c.files, ["foo.c"]) + self.failUnlessEqual(c.comments, "") + self.failUnlessEqual(c.revision, 42) + From warner at users.sourceforge.net Wed May 4 02:09:41 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 02:09:41 +0000 Subject: [Buildbot-commits] buildbot/buildbot master.py,1.67,1.68 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31343/buildbot Modified Files: master.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-119 Creator: Brian Warner add 'buildbot sendchange' command * buildbot/scripts/runner.py (sendchange): new command to send a change to a buildbot.changes.pb.PBChangeSource receiver. * buildbot/test/test_changes.py (Sender): test it * buildbot/master.py (BuildMaster.startService): mark .readConfig after any reading of the config file, not just when we do it in startService. This makes some tests a bit cleaner. * buildbot/changes/pb.py: add some log messages Index: master.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- master.py 28 Apr 2005 07:34:27 -0000 1.67 +++ master.py 4 May 2005 02:09:38 -0000 1.68 @@ -659,7 +659,6 @@ # the config file, and it would be nice for the user to discover # this quickly. self.loadTheConfigFile() - self.readConfig = True if signal and hasattr(signal, "SIGHUP"): signal.signal(signal.SIGHUP, self._handleSIGHUP) for b in self.botmaster.builders.values(): @@ -884,6 +883,7 @@ self.loadConfig_Interlocks(interlocks) log.msg("configuration updated") + self.readConfig = True return defer.DeferredList(dl) def loadConfig_Slaves(self, bots): From warner at users.sourceforge.net Wed May 4 02:09:40 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 02:09:40 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.15,1.16 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31343/buildbot/scripts Modified Files: runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-119 Creator: Brian Warner add 'buildbot sendchange' command * buildbot/scripts/runner.py (sendchange): new command to send a change to a buildbot.changes.pb.PBChangeSource receiver. * buildbot/test/test_changes.py (Sender): test it * buildbot/master.py (BuildMaster.startService): mark .readConfig after any reading of the config file, not just when we do it in startService. This makes some tests a bit cleaner. * buildbot/changes/pb.py: add some log messages Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- runner.py 3 May 2005 04:31:20 -0000 1.15 +++ runner.py 4 May 2005 02:09:37 -0000 1.16 @@ -323,6 +323,60 @@ c = gtkPanes.GtkClient(master) c.run() +class SendChangeOptions(usage.Options): + optParameters = [ + ["master", "m", None, + "Location of the buildmaster's PBListener (host:port)"], + ["username", "u", None, "Username performing the commit"], + ["revision", "r", None, "Revision specifier (string)"], + ["revision_number", "n", None, "Revision specifier (integer)"], + ["comments", "m", None, "log message"], + ["logfile", "F", None, + "Read the log messages from this file (- for stdin)"], + ] + def getSynopsis(self): + return "Usage: buildbot sendchange [options] filenames.." + def parseArgs(self, *args): + self['files'] = args + + +def sendchange(config): + from buildbot.clients.sendchange import Sender + + opts = loadOptions() + user = config.get('username', opts.get('username')) + master = config.get('master', opts.get('master')) + revision = config.get('revision') + # SVN and P4 use numeric revisions + if config.get("revision_number"): + revision = int(config['revision_number']) + + comments = config.get('comments') + if not comments and config.get('logfile'): + if config['logfile'] == "-": + f = sys.stdin + else: + f = open(config['logfile'], "rt") + comments = f.read() + if comments is None: + comments = "" + + files = config.get('files', []) + + assert user, "you must provide a username" + assert master, "you must provide the master location" + + s = Sender(master, user) + d = s.send(revision, comments, files) + return d + +def do_sendchange(config): + d = sendchange(config) + d.addCallbacks(s.printSuccess, s.printFailure) + d.addCallback(s.stop) + s.run() + + class Options(usage.Options): synopsis = "Usage: buildbot [command options]" @@ -337,6 +391,9 @@ ['sighup', None, StopOptions, "SIGHUP a buildmaster to make it re-read the config file"], + ['sendchange', None, SendChangeOptions, + "Send a change to the buildmaster"], + ['debugclient', None, DebugClientOptions, "Launch a small debug panel GUI"], @@ -377,6 +434,8 @@ stop(so) elif command == "sighup": stop(so, "-HUP") + elif command == "sendchange": + do_sendchange(so) elif command == "debugclient": debugclient(so) elif command == "statuslog": From warner at users.sourceforge.net Wed May 4 02:09:41 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 02:09:41 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.408,1.409 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31343 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-119 Creator: Brian Warner add 'buildbot sendchange' command * buildbot/scripts/runner.py (sendchange): new command to send a change to a buildbot.changes.pb.PBChangeSource receiver. * buildbot/test/test_changes.py (Sender): test it * buildbot/master.py (BuildMaster.startService): mark .readConfig after any reading of the config file, not just when we do it in startService. This makes some tests a bit cleaner. * buildbot/changes/pb.py: add some log messages Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.408 retrieving revision 1.409 diff -u -d -r1.408 -r1.409 --- ChangeLog 3 May 2005 20:02:04 -0000 1.408 +++ ChangeLog 4 May 2005 02:09:39 -0000 1.409 @@ -1,5 +1,15 @@ 2005-05-03 Brian Warner + * buildbot/scripts/runner.py (sendchange): new command to send a + change to a buildbot.changes.pb.PBChangeSource receiver. + * buildbot/test/test_changes.py (Sender): test it + + * buildbot/master.py (BuildMaster.startService): mark .readConfig + after any reading of the config file, not just when we do it in + startService. This makes some tests a bit cleaner. + + * buildbot/changes/pb.py: add some log messages + * buildbot/process/base.py (Build.startBuild): fix a bug that caused an exception when the build terminated in the very first step. From warner at users.sourceforge.net Wed May 4 02:09:42 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 02:09:42 +0000 Subject: [Buildbot-commits] buildbot/buildbot/clients sendchange.py,NONE,1.1 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/clients In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31343/buildbot/clients Added Files: sendchange.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-119 Creator: Brian Warner add 'buildbot sendchange' command * buildbot/scripts/runner.py (sendchange): new command to send a change to a buildbot.changes.pb.PBChangeSource receiver. * buildbot/test/test_changes.py (Sender): test it * buildbot/master.py (BuildMaster.startService): mark .readConfig after any reading of the config file, not just when we do it in startService. This makes some tests a bit cleaner. * buildbot/changes/pb.py: add some log messages --- NEW FILE: sendchange.py --- from twisted.spread import pb from twisted.cred import credentials from twisted.internet import reactor from twisted.python import log class Sender: def __init__(self, master, user): self.user = user self.host, self.port = master.split(":") self.port = int(self.port) def send(self, revision, comments, files): change = {'who': self.user, 'files': files, 'comments': comments, 'revision': revision} f = pb.PBClientFactory() d = f.login(credentials.UsernamePassword("change", "changepw")) reactor.connectTCP(self.host, self.port, f) d.addCallback(lambda remote: remote.callRemote('addChange', change)) return d def printSuccess(self, res): print "change sent successfully" def printFailure(self, why): print "change NOT sent" print why def stop(self, res): reactor.stop() return res def run(self): reactor.run() From warner at users.sourceforge.net Wed May 4 02:09:40 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 02:09:40 +0000 Subject: [Buildbot-commits] buildbot/buildbot/changes pb.py,1.6,1.7 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/changes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31343/buildbot/changes Modified Files: pb.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-119 Creator: Brian Warner add 'buildbot sendchange' command * buildbot/scripts/runner.py (sendchange): new command to send a change to a buildbot.changes.pb.PBChangeSource receiver. * buildbot/test/test_changes.py (Sender): test it * buildbot/master.py (BuildMaster.startService): mark .readConfig after any reading of the config file, not just when we do it in startService. This makes some tests a bit cleaner. * buildbot/changes/pb.py: add some log messages Index: pb.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/pb.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- pb.py 24 Apr 2005 21:30:25 -0000 1.6 +++ pb.py 4 May 2005 02:09:38 -0000 1.7 @@ -3,6 +3,7 @@ import os, os.path from twisted.application import service +from twisted.python import log from buildbot.pbutil import NewCredPerspective from buildbot.changes.changes import Change @@ -22,7 +23,9 @@ return self def detached(self, mind): pass + def perspective_addChange(self, changedict): + log.msg("perspective_addChange called") pathnames = [] for path in changedict['files']: if self.prefix: From warner at users.sourceforge.net Wed May 4 04:14:00 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 04:14:00 +0000 Subject: [Buildbot-commits] buildbot/contrib arch_buildbot.py,NONE,1.1 Message-ID: Update of /cvsroot/buildbot/buildbot/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23854/contrib Added Files: arch_buildbot.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-121 Creator: Brian Warner add arch_buildbot.py hook script, to send Changes to the buildmaster * contrib/arch_buildbot.py: utility that can run as an Arch hook script to notify the buildmaster about changes --- NEW FILE: arch_buildbot.py --- #! /usr/bin/python # this script is meant to run as an Arch post-commit hook (and also as a # pre-commit hook), using the "arch-meta-hook" framework. See # http://wiki.gnuarch.org/NdimMetaHook for details. The pre-commit hook # creates a list of files (and log comments), while the post-commit hook # actually notifies the buildmaster. # this script doesn't handle partial commits quite right: it will tell the # buildmaster that everything changed, not just the filenames you give to # 'tla commit'. import os, commands, cStringIO from buildbot.scripts import runner # Just modify the appropriate values below and then put this file in two # places: ~/.arch-params/hooks/ARCHIVE/=precommit/90buildbot.py and # ~/.arch-params/hooks/ARCHIVE/=commit/10buildbot.py master = "localhost:9989" username = os.getlogin() # or use an explicit string, like "warner" # Remember that for this to work, your buildmaster's master.cfg needs to have # a c['sources'] list which includes a pb.PBChangeSource instance. os.chdir(os.getenv("ARCH_TREE_ROOT")) filelist = ",,bb-files" comments = ",,bb-comments" if os.getenv("ARCH_HOOK_ACTION") == "precommit": files = [] out = commands.getoutput("tla changes") for line in cStringIO.StringIO(out).readlines(): if line[0] in "AMD": # add, modify, delete files.append(line[3:]) if files: f = open(filelist, "w") f.write("".join(files)) f.close() # comments logfiles = [f for f in os.listdir(".") if f.startswith("++log.")] if len(logfiles) > 1: print ("Warning, multiple ++log.* files found, getting comments " "from the first one") open(comments, "w").write(open(logfiles[0], "r").read()) elif os.getenv("ARCH_HOOK_ACTION") == "commit": revision = os.getenv("ARCH_REVISION") files = [] if os.path.exists(filelist): f = open(filelist, "r") for line in f.readlines(): files.append(line.rstrip()) if not files: # buildbot insists upon having at least one modified file (otherwise # the prefix-stripping mechanism will ignore the change) files = ["dummy"] if os.path.exists(commentfile): comments = open(commentfile, "r").read() else: comments = "commit from arch" c = {'master': master, 'username': username, 'revision': revision, 'comments': comments, 'files': files} runner.do_sendchange(c) os.unlink(filelist) os.unlink(commentfile) From warner at users.sourceforge.net Wed May 4 04:14:00 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 04:14:00 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.409,1.410 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23854 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-121 Creator: Brian Warner add arch_buildbot.py hook script, to send Changes to the buildmaster * contrib/arch_buildbot.py: utility that can run as an Arch hook script to notify the buildmaster about changes Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.409 retrieving revision 1.410 diff -u -d -r1.409 -r1.410 --- ChangeLog 4 May 2005 02:09:39 -0000 1.409 +++ ChangeLog 4 May 2005 04:13:58 -0000 1.410 @@ -1,5 +1,8 @@ 2005-05-03 Brian Warner + * contrib/arch_buildbot.py: utility that can run as an Arch hook + script to notify the buildmaster about changes + * buildbot/scripts/runner.py (sendchange): new command to send a change to a buildbot.changes.pb.PBChangeSource receiver. * buildbot/test/test_changes.py (Sender): test it From warner at users.sourceforge.net Wed May 4 04:14:22 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 04:14:22 +0000 Subject: [Buildbot-commits] buildbot/contrib arch_buildbot.py,1.1,1.2 Message-ID: Update of /cvsroot/buildbot/buildbot/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24022/contrib Modified Files: arch_buildbot.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-122 Creator: Brian Warner oops, fix hook script fix arch_buildbot.py Index: arch_buildbot.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/contrib/arch_buildbot.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- arch_buildbot.py 4 May 2005 04:13:57 -0000 1.1 +++ arch_buildbot.py 4 May 2005 04:14:20 -0000 1.2 @@ -25,7 +25,7 @@ os.chdir(os.getenv("ARCH_TREE_ROOT")) filelist = ",,bb-files" -comments = ",,bb-comments" +commentfile = ",,bb-comments" if os.getenv("ARCH_HOOK_ACTION") == "precommit": files = [] @@ -42,7 +42,7 @@ if len(logfiles) > 1: print ("Warning, multiple ++log.* files found, getting comments " "from the first one") - open(comments, "w").write(open(logfiles[0], "r").read()) + open(commentfile, "w").write(open(logfiles[0], "r").read()) elif os.getenv("ARCH_HOOK_ACTION") == "commit": revision = os.getenv("ARCH_REVISION") From warner at users.sourceforge.net Wed May 4 04:14:34 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 04:14:34 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.410,1.411 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24073 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-123 Creator: Brian Warner make 'buildbot sendchange' actually work * buildbot/scripts/runner.py (sendchange): oops, fix the command so 'buildbot sendchange' actually works. The earlier test only covered the internal (non-reactor-running) form. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.410 retrieving revision 1.411 diff -u -d -r1.410 -r1.411 --- ChangeLog 4 May 2005 04:13:58 -0000 1.410 +++ ChangeLog 4 May 2005 04:14:31 -0000 1.411 @@ -1,5 +1,9 @@ 2005-05-03 Brian Warner + * buildbot/scripts/runner.py (sendchange): oops, fix the command + so 'buildbot sendchange' actually works. The earlier test only + covered the internal (non-reactor-running) form. + * contrib/arch_buildbot.py: utility that can run as an Arch hook script to notify the buildmaster about changes From warner at users.sourceforge.net Wed May 4 04:14:33 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 04:14:33 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.16,1.17 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24073/buildbot/scripts Modified Files: runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-123 Creator: Brian Warner make 'buildbot sendchange' actually work * buildbot/scripts/runner.py (sendchange): oops, fix the command so 'buildbot sendchange' actually works. The earlier test only covered the internal (non-reactor-running) form. Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- runner.py 4 May 2005 02:09:37 -0000 1.16 +++ runner.py 4 May 2005 04:14:31 -0000 1.17 @@ -340,7 +340,7 @@ self['files'] = args -def sendchange(config): +def sendchange(config, runReactor=False): from buildbot.clients.sendchange import Sender opts = loadOptions() @@ -368,14 +368,12 @@ s = Sender(master, user) d = s.send(revision, comments, files) + if runReactor: + d.addCallbacks(s.printSuccess, s.printFailure) + d.addCallback(s.stop) + s.run() return d -def do_sendchange(config): - d = sendchange(config) - d.addCallbacks(s.printSuccess, s.printFailure) - d.addCallback(s.stop) - s.run() - class Options(usage.Options): synopsis = "Usage: buildbot [command options]" @@ -435,7 +433,7 @@ elif command == "sighup": stop(so, "-HUP") elif command == "sendchange": - do_sendchange(so) + do_sendchange(so, True) elif command == "debugclient": debugclient(so) elif command == "statuslog": From warner at users.sourceforge.net Wed May 4 04:14:40 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 04:14:40 +0000 Subject: [Buildbot-commits] buildbot/contrib arch_buildbot.py,1.2,1.3 Message-ID: Update of /cvsroot/buildbot/buildbot/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24121/contrib Modified Files: arch_buildbot.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-124 Creator: Brian Warner more tweaks More tweaks to fix contrib/arch_buildbot.py Index: arch_buildbot.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/contrib/arch_buildbot.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- arch_buildbot.py 4 May 2005 04:14:20 -0000 1.2 +++ arch_buildbot.py 4 May 2005 04:14:38 -0000 1.3 @@ -64,7 +64,7 @@ c = {'master': master, 'username': username, 'revision': revision, 'comments': comments, 'files': files} - runner.do_sendchange(c) + runner.sendchange(c, True) os.unlink(filelist) os.unlink(commentfile) From warner at users.sourceforge.net Wed May 4 05:01:37 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 05:01:37 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.411,1.412 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1451 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-126 Creator: Brian Warner let arch_buildbot.py survive if there are no logfiles * contrib/arch_buildbot.py: survive if there are no logfiles, don't use os.getlogin() Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.411 retrieving revision 1.412 diff -u -d -r1.411 -r1.412 --- ChangeLog 4 May 2005 04:14:31 -0000 1.411 +++ ChangeLog 4 May 2005 05:01:18 -0000 1.412 @@ -1,5 +1,8 @@ 2005-05-03 Brian Warner + * contrib/arch_buildbot.py: survive if there are no logfiles + (username): just use a string, os.getlogin isn't reliable + * buildbot/scripts/runner.py (sendchange): oops, fix the command so 'buildbot sendchange' actually works. The earlier test only covered the internal (non-reactor-running) form. From warner at users.sourceforge.net Wed May 4 05:01:20 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 05:01:20 +0000 Subject: [Buildbot-commits] buildbot/contrib arch_buildbot.py,1.3,1.4 Message-ID: Update of /cvsroot/buildbot/buildbot/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1451/contrib Modified Files: arch_buildbot.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-126 Creator: Brian Warner let arch_buildbot.py survive if there are no logfiles * contrib/arch_buildbot.py: survive if there are no logfiles, don't use os.getlogin() Index: arch_buildbot.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/contrib/arch_buildbot.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- arch_buildbot.py 4 May 2005 04:14:38 -0000 1.3 +++ arch_buildbot.py 4 May 2005 05:01:17 -0000 1.4 @@ -18,7 +18,7 @@ # ~/.arch-params/hooks/ARCHIVE/=commit/10buildbot.py master = "localhost:9989" -username = os.getlogin() # or use an explicit string, like "warner" +username = "myloginname" # Remember that for this to work, your buildmaster's master.cfg needs to have # a c['sources'] list which includes a pb.PBChangeSource instance. @@ -42,7 +42,8 @@ if len(logfiles) > 1: print ("Warning, multiple ++log.* files found, getting comments " "from the first one") - open(commentfile, "w").write(open(logfiles[0], "r").read()) + if logfiles: + open(commentfile, "w").write(open(logfiles[0], "r").read()) elif os.getenv("ARCH_HOOK_ACTION") == "commit": revision = os.getenv("ARCH_REVISION") From warner at users.sourceforge.net Wed May 4 05:31:12 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 05:31:12 +0000 Subject: [Buildbot-commits] buildbot/contrib arch_buildbot.py,1.4,1.5 Message-ID: Update of /cvsroot/buildbot/buildbot/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7439/contrib Modified Files: arch_buildbot.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-129 Creator: Brian Warner arch_buildbot.py: don't unlink files that don't exist Index: arch_buildbot.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/contrib/arch_buildbot.py,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- arch_buildbot.py 4 May 2005 05:01:17 -0000 1.4 +++ arch_buildbot.py 4 May 2005 05:31:10 -0000 1.5 @@ -67,5 +67,7 @@ 'revision': revision, 'comments': comments, 'files': files} runner.sendchange(c, True) - os.unlink(filelist) - os.unlink(commentfile) + if os.path.exists(filelist): + os.unlink(filelist) + if os.path.exists(commentfile): + os.unlink(commentfile) From warner at users.sourceforge.net Wed May 4 06:44:33 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 06:44:33 +0000 Subject: [Buildbot-commits] buildbot/buildbot master.py,1.68,1.69 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20934/buildbot Modified Files: master.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-131 Creator: Brian Warner remove deprecated config keys * buildbot/master.py (BuildMaster.loadConfig): finally remove deprecated config keys: webPortnum, webPathname, irc, manholePort, and configuring builders with tuples. * buildbot/test/test_config.py: stop testing compatibility with deprecated config keys * buildbot/test/test_run.py: same Index: master.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- master.py 4 May 2005 02:09:38 -0000 1.68 +++ master.py 4 May 2005 06:44:30 -0000 1.69 @@ -744,8 +744,7 @@ known_keys = "bots sources builders slavePortnum " + \ "debugPassword manhole " + \ "interlocks status projectName projectURL buildbotURL" - deprecated_keys = "webPortnum webPathname irc" - known_keys = (known_keys + " " + deprecated_keys).split() + known_keys = known_keys.split() for k in config.keys(): if k not in known_keys: log.msg("unknown key '%s' defined in config dictionary" % k) @@ -758,7 +757,6 @@ slavePortnum = config['slavePortnum'] # optional - irc = config.get('irc') debugPassword = config.get('debugPassword') manhole = config.get('manhole') interlocks = config.get('interlocks', []) @@ -767,10 +765,6 @@ projectURL = config.get('projectURL') buildbotURL = config.get('buildbotURL') - # deprecated - webPortnum = config.get('webPortnum') - webPathname = config.get('webPathname') - manholePort = config.get('manholePort') except KeyError, e: log.msg("config dictionary is missing a required parameter") log.msg("leaving old configuration in place") @@ -792,8 +786,6 @@ why = ("builder '%s' appears multiple times for " + \ "interlock %s") % (bname, name) raise ValueError, why - if webPortnum is not None and type(webPortnum) != int: - raise TypeError, "webPortnum '%s' must be an int" % webPortnum for s in status: assert interfaces.IStatusReceiver(s) @@ -802,11 +794,6 @@ dirnames = [] for b in builders: if type(b) is tuple: - warnings.warn("defining builder %s with a tuple is deprecated" - ", please use a dict instead" % b[0], - DeprecationWarning) - continue - if type(b) is tuple: raise ValueError("builder %s must be defined with a dict, " "not a tuple" % b[0]) if b['slavename'] not in slavenames: @@ -841,11 +828,7 @@ self.checker.addUser("debug", debugPassword) self.debugPassword = debugPassword - # self.manholePort - if manholePort is not None: - warnings.warn("c['manholePort'] is deprecated, use c['manhole'] = master.Manhole(port, username, password) instead", - DeprecationWarning) - manhole = Manhole(manholePort, "admin", "admin") + # self.manhole if manhole != self.manhole: # changing if self.manhole: @@ -863,7 +846,7 @@ # botmaster will handle startup/shutdown issues. dl.append(self.loadConfig_Builders(builders)) - d = self.loadConfig_status(status, irc, webPortnum, webPathname) + d = self.loadConfig_status(status) dl.append(d) # self.slavePort @@ -923,12 +906,6 @@ newNames = [] newList = {} for data in newBuilders: - if type(data) is tuple: - name, slavename, builddir, factory = data - data = {'name': name, - 'slavename': slavename, - 'builddir': builddir, - 'factory': factory} name = data['name'] newList[name] = data newNames.append(name) @@ -983,30 +960,7 @@ self.botmaster.builderNames = newNames return defer.DeferredList(dl) - def loadConfig_status(self, status, - irc=None, webPortnum=None, webPathname=None): - - # these three are for backwards compatibility - - if irc is not None: - warnings.warn("c['irc'] is deprecated, use c['status'] = [words.IRC(args)] instead", - DeprecationWarning) - for addr,v in irc.items(): - host, port = addr - assert port == 6667 - nick, channels = v - status.append(IRC(host, nick, channels)) - - if webPortnum is not None: - warnings.warn("c['webPortnum'] is deprecated, use c['status'] = [html.Waterfall(http_port=PORT)] instead", - DeprecationWarning) - status.append(Waterfall(http_port=webPortnum)) - if webPathname is not None: - warnings.warn("c['webPathname'] is deprecated, use c['status'] = [html.Waterfall(distrib_port=NAME)] instead", - DeprecationWarning) - status.append(Waterfall(distrib_port=webPathname)) - - # here is where the real work happens + def loadConfig_status(self, status): dl = [] # remove old ones From warner at users.sourceforge.net Wed May 4 06:44:33 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 06:44:33 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_config.py,1.17,1.18 test_run.py,1.29,1.30 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20934/buildbot/test Modified Files: test_config.py test_run.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-131 Creator: Brian Warner remove deprecated config keys * buildbot/master.py (BuildMaster.loadConfig): finally remove deprecated config keys: webPortnum, webPathname, irc, manholePort, and configuring builders with tuples. * buildbot/test/test_config.py: stop testing compatibility with deprecated config keys * buildbot/test/test_run.py: same Index: test_config.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_config.py,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- test_config.py 27 Apr 2005 23:24:04 -0000 1.17 +++ test_config.py 4 May 2005 06:44:31 -0000 1.18 @@ -82,7 +82,8 @@ c['bots'] = [('bot1', 'pw1')] c['sources'] = [] f1 = BasicBuildFactory('cvsroot', 'cvsmodule') -c['builders'] = [('builder1', 'bot1', 'workdir', f1)] +c['builders'] = [{'name':'builder1', 'slavename':'bot1', + 'builddir':'workdir', 'factory':f1}] c['slavePortnum'] = 9999 BuildmasterConfig = c """ @@ -94,7 +95,8 @@ c['bots'] = [('bot1', 'pw1')] c['sources'] = [] f1 = BasicBuildFactory('cvsroot', 'cvsmodule2') -c['builders'] = [('builder1', 'bot1', 'workdir', f1)] +c['builders'] = [{'name':'builder1', 'slavename':'bot1', + 'builddir':'workdir', 'factory':f1}] c['slavePortnum'] = 9999 BuildmasterConfig = c """ @@ -157,17 +159,6 @@ ircCfg1 = \ """ -c = {} -c['bots'] = [] -c['sources'] = [] -c['builders'] = [] -c['slavePortnum'] = 9999 -c['irc'] = {('irc.us.freenode.net', 6667): ('buildbot', ['twisted'])} -BuildmasterConfig = c -""" - -ircCfg2 = \ -""" from buildbot.status import words c = {} c['bots'] = [] @@ -178,7 +169,7 @@ BuildmasterConfig = c """ -ircCfg3 = \ +ircCfg2 = \ """ from buildbot.status import words c = {} @@ -191,7 +182,7 @@ BuildmasterConfig = c """ -ircCfg4 = \ +ircCfg3 = \ """ from buildbot.status import words c = {} @@ -205,17 +196,6 @@ webCfg1 = \ """ -c = {} -c['bots'] = [] -c['sources'] = [] -c['builders'] = [] -c['slavePortnum'] = 9999 -c['webPortnum'] = 9980 # backwards compatibility -BuildmasterConfig = c -""" - -webCfg2 = \ -""" from buildbot.status import html c = {} c['bots'] = [] @@ -226,7 +206,7 @@ BuildmasterConfig = c """ -webCfg3 = \ +webCfg2 = \ """ from buildbot.status import html c = {} @@ -240,17 +220,6 @@ webNameCfg1 = \ """ -c = {} -c['bots'] = [] -c['sources'] = [] -c['builders'] = [] -c['slavePortnum'] = 9999 -c['webPathname'] = '~/.twistd-web-pb' # backwards compatibility -BuildmasterConfig = c -""" - -webNameCfg2 = \ -""" from buildbot.status import html c = {} c['bots'] = [] @@ -261,7 +230,7 @@ BuildmasterConfig = c """ -webNameCfg3 = \ +webNameCfg2 = \ """ from buildbot.status import html c = {} @@ -293,11 +262,16 @@ c['bots'] = [('bot1', 'pw1')] c['sources'] = [] f1 = BasicBuildFactory('cvsroot', 'cvsmodule') -c['builders'] = [('builder1', 'bot1', 'workdir', f1), - ('builder2', 'bot1', 'workdir2', f1), - ('builder4', 'bot1', 'workdir4', f1), - ('builder5', 'bot1', 'workdir5', f1), - ] +c['builders'] = [ + { 'name': 'builder1', 'slavename': 'bot1', + 'builddir': 'workdir', 'factory': f1 }, + { 'name': 'builder2', 'slavename': 'bot1', + 'builddir': 'workdir2', 'factory': f1 }, + { 'name': 'builder4', 'slavename': 'bot1', + 'builddir': 'workdir4', 'factory': f1 }, + { 'name': 'builder5', 'slavename': 'bot1', + 'builddir': 'workdir5', 'factory': f1 }, + ] c['interlocks'] = [('lock1', ['builder1'], ['builder2', 'builder3']), ] c['slavePortnum'] = 9999 @@ -312,12 +286,18 @@ c['bots'] = [('bot1', 'pw1')] c['sources'] = [] f1 = BasicBuildFactory('cvsroot', 'cvsmodule') -c['builders'] = [('builder1', 'bot1', 'workdir', f1), - ('builder2', 'bot1', 'workdir2', f1), - ('builder3', 'bot1', 'workdir3', f1), - ('builder4', 'bot1', 'workdir4', f1), - ('builder5', 'bot1', 'workdir5', f1), - ] +c['builders'] = [ + { 'name': 'builder1', 'slavename': 'bot1', + 'builddir': 'workdir', 'factory': f1 }, + { 'name': 'builder2', 'slavename': 'bot1', + 'builddir': 'workdir2', 'factory': f1 }, + { 'name': 'builder3', 'slavename': 'bot1', + 'builddir': 'workdir3', 'factory': f1 }, + { 'name': 'builder4', 'slavename': 'bot1', + 'builddir': 'workdir4', 'factory': f1 }, + { 'name': 'builder5', 'slavename': 'bot1', + 'builddir': 'workdir5', 'factory': f1 }, + ] c['interlocks'] = [('lock1', ['builder1'], ['builder2', 'builder3']), ] c['slavePortnum'] = 9999 @@ -332,12 +312,18 @@ c['bots'] = [('bot1', 'pw1')] c['sources'] = [] f1 = BasicBuildFactory('cvsroot', 'cvsmodule') -c['builders'] = [('builder1', 'bot1', 'workdir', f1), - ('builder2', 'bot1', 'workdir2', f1), - ('builder3', 'bot1', 'workdir3', f1), - ('builder4', 'bot1', 'workdir4', f1), - ('builder5', 'bot1', 'workdir5', f1), - ] +c['builders'] = [ + { 'name': 'builder1', 'slavename': 'bot1', + 'builddir': 'workdir', 'factory': f1 }, + { 'name': 'builder2', 'slavename': 'bot1', + 'builddir': 'workdir2', 'factory': f1 }, + { 'name': 'builder3', 'slavename': 'bot1', + 'builddir': 'workdir3', 'factory': f1 }, + { 'name': 'builder4', 'slavename': 'bot1', + 'builddir': 'workdir4', 'factory': f1 }, + { 'name': 'builder5', 'slavename': 'bot1', + 'builddir': 'workdir5', 'factory': f1 }, + ] c['interlocks'] = [('lock1', ['builder1'], ['builder2', 'builder3']), ('lock2', ['builder3', 'builder4'], ['builder5']), ] @@ -353,12 +339,18 @@ c['bots'] = [('bot1', 'pw1')] c['sources'] = [] f1 = BasicBuildFactory('cvsroot', 'cvsmodule') -c['builders'] = [('builder1', 'bot1', 'workdir', f1), - ('builder2', 'bot1', 'workdir2', f1), - ('builder3', 'bot1', 'workdir3', f1), - ('builder4', 'bot1', 'workdir4', f1), - ('builder5', 'bot1', 'workdir5', f1), - ] +c['builders'] = [ + { 'name': 'builder1', 'slavename': 'bot1', + 'builddir': 'workdir', 'factory': f1 }, + { 'name': 'builder2', 'slavename': 'bot1', + 'builddir': 'workdir2', 'factory': f1 }, + { 'name': 'builder3', 'slavename': 'bot1', + 'builddir': 'workdir3', 'factory': f1 }, + { 'name': 'builder4', 'slavename': 'bot1', + 'builddir': 'workdir4', 'factory': f1 }, + { 'name': 'builder5', 'slavename': 'bot1', + 'builddir': 'workdir5', 'factory': f1 }, + ] c['interlocks'] = [('lock1', ['builder1'], ['builder2', 'builder3']), ('lock2', ['builder1', 'builder4'], ['builder5']), ] @@ -374,12 +366,18 @@ c['bots'] = [('bot1', 'pw1')] c['sources'] = [] f1 = BasicBuildFactory('cvsroot', 'cvsmodule') -c['builders'] = [('builder1', 'bot1', 'workdir', f1), - ('builder2', 'bot1', 'workdir2', f1), - ('builder3', 'bot1', 'workdir3', f1), - ('builder4', 'bot1', 'workdir4', f1), - ('builder5', 'bot1', 'workdir5', f1), - ] +c['builders'] = [ + { 'name': 'builder1', 'slavename': 'bot1', + 'builddir': 'workdir', 'factory': f1 }, + { 'name': 'builder2', 'slavename': 'bot1', + 'builddir': 'workdir2', 'factory': f1 }, + { 'name': 'builder3', 'slavename': 'bot1', + 'builddir': 'workdir3', 'factory': f1 }, + { 'name': 'builder4', 'slavename': 'bot1', + 'builddir': 'workdir4', 'factory': f1 }, + { 'name': 'builder5', 'slavename': 'bot1', + 'builddir': 'workdir5', 'factory': f1 }, + ] c['interlocks'] = [('lock2', ['builder1', 'builder4'], ['builder5']), ] c['slavePortnum'] = 9999 @@ -394,11 +392,16 @@ c['bots'] = [('bot1', 'pw1')] c['sources'] = [] f1 = BasicBuildFactory('cvsroot', 'cvsmodule') -c['builders'] = [('builder1', 'bot1', 'workdir', f1), - ('builder2', 'bot1', 'workdir2', f1), - ('builder3', 'bot1', 'workdir3', f1), - ('builder4', 'bot1', 'workdir4', f1), - ] +c['builders'] = [ + { 'name': 'builder1', 'slavename': 'bot1', + 'builddir': 'workdir', 'factory': f1 }, + { 'name': 'builder2', 'slavename': 'bot1', + 'builddir': 'workdir2', 'factory': f1 }, + { 'name': 'builder3', 'slavename': 'bot1', + 'builddir': 'workdir3', 'factory': f1 }, + { 'name': 'builder4', 'slavename': 'bot1', + 'builddir': 'workdir4', 'factory': f1 }, + ] c['interlocks'] = [('lock2', ['builder1', 'builder4'], ['builder5']), ] c['slavePortnum'] = 9999 @@ -413,11 +416,16 @@ c['bots'] = [('bot1', 'pw1')] c['sources'] = [] f1 = BasicBuildFactory('cvsroot', 'cvsmodule') -c['builders'] = [('builder1', 'bot1', 'workdir', f1), - ('builder2', 'bot1', 'workdir2', f1), - ('builder3', 'bot1', 'workdir3', f1), - ('builder4', 'bot1', 'workdir4', f1), - ] +c['builders'] = [ + { 'name': 'builder1', 'slavename': 'bot1', + 'builddir': 'workdir', 'factory': f1 }, + { 'name': 'builder2', 'slavename': 'bot1', + 'builddir': 'workdir2', 'factory': f1 }, + { 'name': 'builder3', 'slavename': 'bot1', + 'builddir': 'workdir3', 'factory': f1 }, + { 'name': 'builder4', 'slavename': 'bot1', + 'builddir': 'workdir4', 'factory': f1 }, + ] c['interlocks'] = [] c['slavePortnum'] = 9999 BuildmasterConfig = c @@ -670,27 +678,28 @@ def testIRC(self): master = self.buildmaster master.loadChanges() - master.loadConfig(emptyCfg) + d = master.loadConfig(emptyCfg) + dr(d) self.checkIRC(master, {}) - master.loadConfig(ircCfg1) - expected = {'irc.us.freenode.net': ('buildbot', ['twisted'])} - self.checkIRC(master, expected) - - master.loadConfig(ircCfg2) + d = master.loadConfig(ircCfg1) + dr(d) expected = {'irc.us.freenode.net': ('buildbot', ['twisted'])} self.checkIRC(master, expected) - master.loadConfig(ircCfg3) + d = master.loadConfig(ircCfg2) + dr(d) expected = {'irc.us.freenode.net': ('buildbot', ['twisted']), 'irc.example.com': ('otherbot', ['chan1', 'chan2'])} self.checkIRC(master, expected) - master.loadConfig(ircCfg4) + d = master.loadConfig(ircCfg3) + dr(d) expected = {'irc.us.freenode.net': ('buildbot', ['knotted'])} self.checkIRC(master, expected) - master.loadConfig(ircCfg1) + d = master.loadConfig(ircCfg1) + dr(d) expected = {'irc.us.freenode.net': ('buildbot', ['twisted'])} self.checkIRC(master, expected) @@ -698,66 +707,60 @@ master = self.buildmaster master.loadChanges() - master.loadConfig(webCfg1) + d = master.loadConfig(webCfg1) + dr(d) ports = self.checkPorts(master, [(9999, pb.PBServerFactory), (9980, Site)]) p = ports[1] - master.loadConfig(webCfg1) # nothing should be changed - ports = self.checkPorts(master, [(9999, pb.PBServerFactory), - (9980, Site)]) - self.failUnlessIdentical(p, ports[1], - "web port was changed even though " + \ - "configuration was not") - - master.loadConfig(webCfg2) # still nothing changes + d = master.loadConfig(webCfg1) # nothing should be changed + dr(d) ports = self.checkPorts(master, [(9999, pb.PBServerFactory), (9980, Site)]) self.failUnlessIdentical(p, ports[1], "web port was changed even though " + \ "configuration was not") - master.loadConfig(webCfg3) # changes to 9981 + d = master.loadConfig(webCfg2) # changes to 9981 + dr(d) ports = self.checkPorts(master, [(9999, pb.PBServerFactory), (9981, Site)]) self.failIf(p is ports[1], "web port was unchanged but configuration was changed") - master.loadConfig(emptyCfg) + d = master.loadConfig(emptyCfg) + dr(d) self.checkPorts(master, [(9999, pb.PBServerFactory)]) def testWebPathname(self): master = self.buildmaster master.loadChanges() - master.loadConfig(webNameCfg1) + d = master.loadConfig(webNameCfg1) + dr(d) self.checkPorts(master, [(9999, pb.PBServerFactory), ('~/.twistd-web-pb', pb.PBServerFactory)]) unixports = self.UNIXports(master) f = unixports[0].args[1] self.failUnless(isinstance(f.root, ResourcePublisher)) - master.loadConfig(webNameCfg1) # nothing should be changed - self.checkPorts(master, [(9999, pb.PBServerFactory), - ('~/.twistd-web-pb', pb.PBServerFactory)]) - self.failUnlessIdentical(f, self.UNIXports(master)[0].args[1], - "web factory was changed even though " + \ - "configuration was not") - - master.loadConfig(webNameCfg2) # still nothing changes + d = master.loadConfig(webNameCfg1) # nothing should be changed + dr(d) self.checkPorts(master, [(9999, pb.PBServerFactory), ('~/.twistd-web-pb', pb.PBServerFactory)]) self.failUnlessIdentical(f, self.UNIXports(master)[0].args[1], "web factory was changed even though " + \ "configuration was not") - master.loadConfig(webNameCfg3) + d = master.loadConfig(webNameCfg2) + dr(d) self.checkPorts(master, [(9999, pb.PBServerFactory), ('bar.socket', pb.PBServerFactory)]) self.failIf(f is self.UNIXports(master)[0].args[1], "web factory was unchanged but configuration was changed") - master.loadConfig(emptyCfg) + d = master.loadConfig(emptyCfg) + dr(d) self.checkPorts(master, [(9999, pb.PBServerFactory)]) def testDebugPassword(self): Index: test_run.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_run.py,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- test_run.py 27 Apr 2005 12:10:15 -0000 1.29 +++ test_run.py 4 May 2005 06:44:31 -0000 1.30 @@ -31,7 +31,8 @@ c['sources'] = [] c['builders'] = [] f1 = factory.QuickBuildFactory('fakerep', 'cvsmodule', configure=None) -c['builders'].append(('quick', 'bot1', 'quickdir', f1)) +c['builders'].append({'name':'quick', 'slavename':'bot1', + 'builddir': 'quickdir', 'factory': f1}) c['slavePortnum'] = 0 BuildmasterConfig = c """ From warner at users.sourceforge.net Wed May 4 06:44:33 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 06:44:33 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.412,1.413 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20934 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-131 Creator: Brian Warner remove deprecated config keys * buildbot/master.py (BuildMaster.loadConfig): finally remove deprecated config keys: webPortnum, webPathname, irc, manholePort, and configuring builders with tuples. * buildbot/test/test_config.py: stop testing compatibility with deprecated config keys * buildbot/test/test_run.py: same Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.412 retrieving revision 1.413 diff -u -d -r1.412 -r1.413 --- ChangeLog 4 May 2005 05:01:18 -0000 1.412 +++ ChangeLog 4 May 2005 06:44:31 -0000 1.413 @@ -1,3 +1,12 @@ +2005-05-04 Brian Warner + + * buildbot/master.py (BuildMaster.loadConfig): finally remove + deprecated config keys: webPortnum, webPathname, irc, manholePort, + and configuring builders with tuples. + * buildbot/test/test_config.py: stop testing compatibility with + deprecated config keys + * buildbot/test/test_run.py: same + 2005-05-03 Brian Warner * contrib/arch_buildbot.py: survive if there are no logfiles From warner at users.sourceforge.net Wed May 4 07:04:20 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 07:04:20 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_web.py,1.12,1.13 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24566/buildbot/test Modified Files: test_web.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-133 Creator: Brian Warner fix phase=0 rendering, remove debug message * buildbot/status/html.py (WaterfallStatusResource.body): fix exception in phase=0 rendering * buildbot/test/test_web.py (WebTest.test_waterfall): test it * buildbot/changes/dnotify.py (DNotify.__init__): remove debug msg Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- test_web.py 26 Apr 2005 20:25:30 -0000 1.12 +++ test_web.py 4 May 2005 07:04:17 -0000 1.13 @@ -13,6 +13,7 @@ from buildbot import master, interfaces from buildbot.status import html +from buildbot.changes.changes import Change class ConfiguredMaster(master.BuildMaster): """This BuildMaster variant has a static config file, provided as a @@ -178,6 +179,8 @@ m.startService() # hack to find out what randomly-assigned port it is listening on port = list(self.find_waterfall(m)[0])[0]._port.getHost().port + # insert an event + m.change_svc.addChange(Change("user", ["foo.c"], "comments")) d = client.getPage("http://localhost:%d/" % port) page = dr(d) @@ -187,6 +190,12 @@ TZ = time.tzname[time.daylight] self.failUnlessIn("time (%s)" % TZ, page) + # phase=0 is really for debugging the waterfall layout + d = client.getPage("http://localhost:%d/?phase=0" % port) + page = dr(d) + self.failUnless(page) + self.failUnlessIn("", page) + d = client.getPage("http://localhost:%d/favicon.ico" % port) icon = dr(d) expected = open(html.buildbot_icon,"rb").read() From warner at users.sourceforge.net Wed May 4 07:04:22 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 07:04:22 +0000 Subject: [Buildbot-commits] buildbot/buildbot/changes dnotify.py,1.2,1.3 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/changes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24566/buildbot/changes Modified Files: dnotify.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-133 Creator: Brian Warner fix phase=0 rendering, remove debug message * buildbot/status/html.py (WaterfallStatusResource.body): fix exception in phase=0 rendering * buildbot/test/test_web.py (WebTest.test_waterfall): test it * buildbot/changes/dnotify.py (DNotify.__init__): remove debug msg Index: dnotify.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/dnotify.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- dnotify.py 8 Dec 2003 19:06:40 -0000 1.2 +++ dnotify.py 4 May 2005 07:04:18 -0000 1.3 @@ -54,7 +54,6 @@ self.callback = self.fire self.dirname = dirname self.flags = reduce(lambda x, y: x | y, flags) | fcntl.DN_MULTISHOT - print "opening", dirname self.fd = os.open(dirname, os.O_RDONLY) # ideally we would move the notification to something like SIGRTMIN, # (to free up SIGIO) and use sigaction to have the signal handler From warner at users.sourceforge.net Wed May 4 07:04:18 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 07:04:18 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status html.py,1.59,1.60 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24566/buildbot/status Modified Files: html.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-133 Creator: Brian Warner fix phase=0 rendering, remove debug message * buildbot/status/html.py (WaterfallStatusResource.body): fix exception in phase=0 rendering * buildbot/test/test_web.py (WebTest.test_waterfall): test it * buildbot/changes/dnotify.py (DNotify.__init__): remove debug msg Index: html.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- html.py 3 May 2005 04:34:02 -0000 1.59 +++ html.py 4 May 2005 07:04:15 -0000 1.60 @@ -878,7 +878,8 @@ (changeNames, builderNames, timestamps, eventGrid, sourceEvents) = \ self.buildGrid(request, builders) if phase == 0: - return self.phase0(request, sourceNames, timestamps, eventGrid) + return self.phase0(request, (changeNames + builderNames), + timestamps, eventGrid) # start the table: top-header material data = "\n" #data = "
\n" @@ -1128,7 +1129,7 @@ data += "%s
\n" % sourceNames[c] for e in row[c]: log.msg("Event", r, c, sourceNames[c], e.getText()) - lognames = [log.getName() for log in e.getLogs()] + lognames = [loog.getName() for loog in e.getLogs()] data += "%s: %s: %s %s
" % (e.getText(), e.getTimes()[0], e.getColor(), From warner at users.sourceforge.net Wed May 4 07:04:19 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 07:04:19 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.413,1.414 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24566 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-133 Creator: Brian Warner fix phase=0 rendering, remove debug message * buildbot/status/html.py (WaterfallStatusResource.body): fix exception in phase=0 rendering * buildbot/test/test_web.py (WebTest.test_waterfall): test it * buildbot/changes/dnotify.py (DNotify.__init__): remove debug msg Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.413 retrieving revision 1.414 diff -u -d -r1.413 -r1.414 --- ChangeLog 4 May 2005 06:44:31 -0000 1.413 +++ ChangeLog 4 May 2005 07:04:16 -0000 1.414 @@ -1,5 +1,11 @@ 2005-05-04 Brian Warner + * buildbot/status/html.py (WaterfallStatusResource.body): fix + exception in phase=0 rendering + * buildbot/test/test_web.py (WebTest.test_waterfall): test it + + * buildbot/changes/dnotify.py (DNotify.__init__): remove debug msg + * buildbot/master.py (BuildMaster.loadConfig): finally remove deprecated config keys: webPortnum, webPathname, irc, manholePort, and configuring builders with tuples. From warner at users.sourceforge.net Wed May 4 07:37:29 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 07:37:29 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.414,1.415 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32364 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-135 Creator: Brian Warner sendchange: tear down the PB connection after sending the change * buildbot/clients/sendchange.py (Sender.send): tear down the PB connection after sending the change, so that unit tests don't complain about sockets being left around Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.414 retrieving revision 1.415 diff -u -d -r1.414 -r1.415 --- ChangeLog 4 May 2005 07:04:16 -0000 1.414 +++ ChangeLog 4 May 2005 07:37:26 -0000 1.415 @@ -1,5 +1,9 @@ 2005-05-04 Brian Warner + * buildbot/clients/sendchange.py (Sender.send): tear down the PB + connection after sending the change, so that unit tests don't + complain about sockets being left around + * buildbot/status/html.py (WaterfallStatusResource.body): fix exception in phase=0 rendering * buildbot/test/test_web.py (WebTest.test_waterfall): test it From warner at users.sourceforge.net Wed May 4 07:37:29 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 04 May 2005 07:37:29 +0000 Subject: [Buildbot-commits] buildbot/buildbot/clients sendchange.py,1.1,1.2 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/clients In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32364/buildbot/clients Modified Files: sendchange.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-135 Creator: Brian Warner sendchange: tear down the PB connection after sending the change * buildbot/clients/sendchange.py (Sender.send): tear down the PB connection after sending the change, so that unit tests don't complain about sockets being left around Index: sendchange.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/clients/sendchange.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sendchange.py 4 May 2005 02:09:39 -0000 1.1 +++ sendchange.py 4 May 2005 07:37:27 -0000 1.2 @@ -17,7 +17,12 @@ f = pb.PBClientFactory() d = f.login(credentials.UsernamePassword("change", "changepw")) reactor.connectTCP(self.host, self.port, f) - d.addCallback(lambda remote: remote.callRemote('addChange', change)) + d.addCallback(self.addChange, change) + return d + + def addChange(self, remote, change): + d = remote.callRemote('addChange', change) + d.addCallback(lambda res: remote.broker.transport.loseConnection()) return d def printSuccess(self, res): From warner at users.sourceforge.net Fri May 6 04:42:43 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 06 May 2005 04:42:43 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_mailparse.py,1.2,1.3 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21843/buildbot/test Modified Files: test_mailparse.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-137 Creator: Brian Warner Merged from org.apestaart at thomas--buildbot (patch 0-2), warner at monolith.lothar.com--2005 (patch 0-3) Merged in Change(tag=) enhancement from Thomas Vander Stichele. Patches applied: * org.apestaart at thomas--buildbot/buildbot--cvstag--0-dev--base-0 tag of org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-dev--patch-1 tag of org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--base-0 tag of org.apestaart at thomas--buildbot/buildbot--releases--0--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-1 merge in first patch on the old cvsbranch branch * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 merge in complete cvsbranch to this new branch * org.apestaart at thomas--buildbot/buildbot--releases--0--base-0 tag of arch at buildbot.sf.net--2004/buildbot--dev--0--patch-21 * org.apestaart at thomas--buildbot/buildbot--releases--0--patch-1 merge in 0.6.3 release * org.apestaart at thomas--buildbot/buildbot--releases--0--patch-2 merge in 0.6.4 release * org.apestaart at thomas/buildbot--cvsbranch--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--cvsbranch--0--patch-1 add "tag" concept to changes, and add isTagImportant to be overridden * org.apestaart at thomas/buildbot--cvsbranch--0--patch-2 and add the file to test with * org.apestaart at thomas/buildbot--cvsbranch--0--patch-3 clean up logging * org.apestaart at thomas/buildbot--cvsbranch--0--patch-4 unboundlocalerror fix * warner at monolith.lothar.com--2005/buildbot--dev--0--base-0 tag of arch at buildbot.sf.net--2004/buildbot--dev--0--patch-130 * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-1 Merged from arch at buildbot.sf.net--2004 (patch 131-136) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-2 Merged from org.apestaart at thomas--buildbot cvstag--0-dev (patch 0-2) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-3 add some docs, document Change(tag=) Index: test_mailparse.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_mailparse.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- test_mailparse.py 24 Apr 2005 21:30:25 -0000 1.2 +++ test_mailparse.py 6 May 2005 04:42:41 -0000 1.3 @@ -199,6 +199,10 @@ msg = util.sibpath(__file__, msg) return parseSyncmail(None, open(msg, "r"), prefix="buildbot") + def getNoPrefix(self, msg): + msg = util.sibpath(__file__, msg) + return parseSyncmail(None, open(msg, "r")) + def testMsgS1(self): c = self.get("mail/syncmail.1") self.failUnless(c is not None) @@ -228,4 +232,17 @@ ]) self.assertEqual(c.comments, "test cases for syncmail parser\n") self.assertEqual(c.isdir, 0) + self.assertEqual(c.tag, None) + # tests a tag + def testMsgS5(self): + c = self.getNoPrefix("mail/syncmail.5") + self.failUnless(c) + self.assertEqual(c.who, "thomas") + self.assertEqual(c.files, ['test1/MANIFEST', + 'test1/Makefile.am', + 'test1/autogen.sh', + 'test1/configure.in' + ]) + self.assertEqual(c.tag, "BRANCH-DEVEL") + self.assertEqual(c.isdir, 0) From warner at users.sourceforge.net Fri May 6 04:42:43 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 06 May 2005 04:42:43 +0000 Subject: [Buildbot-commits] buildbot/buildbot/changes changes.py,1.21,1.22 mail.py,1.16,1.17 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/changes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21843/buildbot/changes Modified Files: changes.py mail.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-137 Creator: Brian Warner Merged from org.apestaart at thomas--buildbot (patch 0-2), warner at monolith.lothar.com--2005 (patch 0-3) Merged in Change(tag=) enhancement from Thomas Vander Stichele. Patches applied: * org.apestaart at thomas--buildbot/buildbot--cvstag--0-dev--base-0 tag of org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-dev--patch-1 tag of org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--base-0 tag of org.apestaart at thomas--buildbot/buildbot--releases--0--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-1 merge in first patch on the old cvsbranch branch * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 merge in complete cvsbranch to this new branch * org.apestaart at thomas--buildbot/buildbot--releases--0--base-0 tag of arch at buildbot.sf.net--2004/buildbot--dev--0--patch-21 * org.apestaart at thomas--buildbot/buildbot--releases--0--patch-1 merge in 0.6.3 release * org.apestaart at thomas--buildbot/buildbot--releases--0--patch-2 merge in 0.6.4 release * org.apestaart at thomas/buildbot--cvsbranch--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--cvsbranch--0--patch-1 add "tag" concept to changes, and add isTagImportant to be overridden * org.apestaart at thomas/buildbot--cvsbranch--0--patch-2 and add the file to test with * org.apestaart at thomas/buildbot--cvsbranch--0--patch-3 clean up logging * org.apestaart at thomas/buildbot--cvsbranch--0--patch-4 unboundlocalerror fix * warner at monolith.lothar.com--2005/buildbot--dev--0--base-0 tag of arch at buildbot.sf.net--2004/buildbot--dev--0--patch-130 * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-1 Merged from arch at buildbot.sf.net--2004 (patch 131-136) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-2 Merged from org.apestaart at thomas--buildbot cvstag--0-dev (patch 0-2) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-3 add some docs, document Change(tag=) Index: changes.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/changes.py,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- changes.py 27 Apr 2005 20:35:27 -0000 1.21 +++ changes.py 6 May 2005 04:42:40 -0000 1.22 @@ -20,6 +20,7 @@

Changed by: %(who)s
Changed at: %(at)s
%(revision)s +%(tag)s
Changed files: @@ -56,7 +57,7 @@ revision = None # used to create a source-stamp def __init__(self, who, files, comments, isdir=0, links=[], - revision=None, when=None): + revision=None, when=None, tag=None): self.who = who self.files = files self.comments = comments @@ -66,6 +67,7 @@ if when is None: when = util.now() self.when = when + self.tag = tag def asText(self): data = "" @@ -87,11 +89,15 @@ revision = "" if self.revision: revision = "Revision: %s
\n" % self.revision + tag = "" + if self.tag: + tag = "Tag: %s
\n" % self.tag kwargs = { 'who' : html.escape(self.who), 'at' : self.getTime(), 'files' : html.UL(links) + '\n', 'revision': revision, + 'tag' : tag, 'comments': html.PRE(self.comments) } return html_tmpl % kwargs @@ -185,9 +191,10 @@ def addChange(self, change): """Deliver a file change event. The event should be a Change object. This method will timestamp the object as it is received.""" - log.msg("adding change, who %s, %d files, rev=%s, comments %s" % - (change.who, len(change.files), change.revision, - change.comments)) + log.msg("adding change, who %s, %d files, rev=%s, tag=%s, " + "comments %s" % (change.who, len(change.files), + change.revision, change.tag, + change.comments)) change.number = self.nextNumber self.nextNumber += 1 self.changes.append(change) Index: mail.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/mail.py,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- mail.py 24 Apr 2005 21:30:26 -0000 1.16 +++ mail.py 6 May 2005 04:42:41 -0000 1.17 @@ -126,13 +126,17 @@ files = [] comments = "" isdir = 0 + tag = None + lines = m.fp.readlines() while lines: line = lines.pop(0) + if (line == "Modified Files:\n" or line == "Added Files:\n" or line == "Removed Files:\n"): break + while lines: line = lines.pop(0) if line == "\n": @@ -147,6 +151,13 @@ # Unlike freshCVS, it makes no attempt to collect all related # commits into a single message. + # note: syncmail will report a Tag underneath the ... Files: line + # e.g.: Tag: BRANCH-DEVEL + + if line.startswith('Tag:'): + tag = line.split(' ')[-1].rstrip() + continue + # note: it doesn't actually make sense to use portable functions # like os.path.join and os.sep, because these filenames all use # separator conventions established by the remote CVS server (which @@ -185,7 +196,7 @@ comments += line comments = comments.rstrip() + "\n" - change = Change(who, files, comments, isdir, when=when) + change = Change(who, files, comments, isdir, when=when, tag=tag) return change From warner at users.sourceforge.net Fri May 6 04:42:42 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 06 May 2005 04:42:42 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test/mail syncmail.5,NONE,1.1 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21843/buildbot/test/mail Added Files: syncmail.5 Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-137 Creator: Brian Warner Merged from org.apestaart at thomas--buildbot (patch 0-2), warner at monolith.lothar.com--2005 (patch 0-3) Merged in Change(tag=) enhancement from Thomas Vander Stichele. Patches applied: * org.apestaart at thomas--buildbot/buildbot--cvstag--0-dev--base-0 tag of org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-dev--patch-1 tag of org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--base-0 tag of org.apestaart at thomas--buildbot/buildbot--releases--0--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-1 merge in first patch on the old cvsbranch branch * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 merge in complete cvsbranch to this new branch * org.apestaart at thomas--buildbot/buildbot--releases--0--base-0 tag of arch at buildbot.sf.net--2004/buildbot--dev--0--patch-21 * org.apestaart at thomas--buildbot/buildbot--releases--0--patch-1 merge in 0.6.3 release * org.apestaart at thomas--buildbot/buildbot--releases--0--patch-2 merge in 0.6.4 release * org.apestaart at thomas/buildbot--cvsbranch--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--cvsbranch--0--patch-1 add "tag" concept to changes, and add isTagImportant to be overridden * org.apestaart at thomas/buildbot--cvsbranch--0--patch-2 and add the file to test with * org.apestaart at thomas/buildbot--cvsbranch--0--patch-3 clean up logging * org.apestaart at thomas/buildbot--cvsbranch--0--patch-4 unboundlocalerror fix * warner at monolith.lothar.com--2005/buildbot--dev--0--base-0 tag of arch at buildbot.sf.net--2004/buildbot--dev--0--patch-130 * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-1 Merged from arch at buildbot.sf.net--2004 (patch 131-136) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-2 Merged from org.apestaart at thomas--buildbot cvstag--0-dev (patch 0-2) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-3 add some docs, document Change(tag=) --- NEW FILE: syncmail.5 --- >From thomas at otto.amantes Mon Feb 21 17:46:45 2005 Return-Path: Received: from otto.amantes (otto.amantes [127.0.0.1]) by otto.amantes (8.13.1/8.13.1) with ESMTP id j1LGkjr3011986 for ; Mon, 21 Feb 2005 17:46:45 +0100 Message-Id: <200502211646.j1LGkjr3011986 at otto.amantes> From: Thomas Vander Stichele To: thomas at otto.amantes Subject: test1 s Date: Mon, 21 Feb 2005 16:46:45 +0000 X-Mailer: Python syncmail $Revision: 1.1 $ Content-Transfer-Encoding: 8bit Mime-Version: 1.0 Update of /home/cvs/test/test1 In directory otto.amantes:/home/thomas/dev/tests/cvs/test1 Added Files: Tag: BRANCH-DEVEL MANIFEST Makefile.am autogen.sh configure.in Log Message: stuff on the branch --- NEW FILE: Makefile.am --- SUBDIRS = src # normally I wouldn't distribute autogen.sh and friends with a tarball # but this one is specifically distributed for demonstration purposes EXTRA_DIST = autogen.sh # target for making the "import this into svn" tarball test: mkdir test for a in `cat MANIFEST`; do \ cp -pr $$a test/$$a; done tar czf test.tar.gz test rm -rf test --- NEW FILE: MANIFEST --- MANIFEST autogen.sh configure.in Makefile.am src src/Makefile.am src/test.c --- NEW FILE: autogen.sh --- #!/bin/sh set -x aclocal && \ autoheader && \ autoconf && \ automake -a --foreign && \ ./configure $@ --- NEW FILE: configure.in --- dnl configure.ac for version macro AC_INIT AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(test, 0.0.0) AC_PROG_CC AC_OUTPUT(Makefile src/Makefile) From warner at users.sourceforge.net Fri May 6 04:42:42 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 06 May 2005 04:42:42 +0000 Subject: [Buildbot-commits] buildbot/docs steps.xhtml,1.6,1.7 source.xhtml,1.4,1.5 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21843/docs Modified Files: steps.xhtml source.xhtml Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-137 Creator: Brian Warner Merged from org.apestaart at thomas--buildbot (patch 0-2), warner at monolith.lothar.com--2005 (patch 0-3) Merged in Change(tag=) enhancement from Thomas Vander Stichele. Patches applied: * org.apestaart at thomas--buildbot/buildbot--cvstag--0-dev--base-0 tag of org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-dev--patch-1 tag of org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--base-0 tag of org.apestaart at thomas--buildbot/buildbot--releases--0--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-1 merge in first patch on the old cvsbranch branch * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 merge in complete cvsbranch to this new branch * org.apestaart at thomas--buildbot/buildbot--releases--0--base-0 tag of arch at buildbot.sf.net--2004/buildbot--dev--0--patch-21 * org.apestaart at thomas--buildbot/buildbot--releases--0--patch-1 merge in 0.6.3 release * org.apestaart at thomas--buildbot/buildbot--releases--0--patch-2 merge in 0.6.4 release * org.apestaart at thomas/buildbot--cvsbranch--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--cvsbranch--0--patch-1 add "tag" concept to changes, and add isTagImportant to be overridden * org.apestaart at thomas/buildbot--cvsbranch--0--patch-2 and add the file to test with * org.apestaart at thomas/buildbot--cvsbranch--0--patch-3 clean up logging * org.apestaart at thomas/buildbot--cvsbranch--0--patch-4 unboundlocalerror fix * warner at monolith.lothar.com--2005/buildbot--dev--0--base-0 tag of arch at buildbot.sf.net--2004/buildbot--dev--0--patch-130 * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-1 Merged from arch at buildbot.sf.net--2004 (patch 131-136) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-2 Merged from org.apestaart at thomas--buildbot cvstag--0-dev (patch 0-2) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-3 add some docs, document Change(tag=) Index: source.xhtml =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/source.xhtml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- source.xhtml 6 Dec 2004 01:23:12 -0000 1.4 +++ source.xhtml 6 May 2005 04:42:33 -0000 1.5 @@ -139,12 +139,12 @@ These parameters collectively specify a set of sources from which a build may be performed.

-

Subversion combines the repository, module, and branch into a single -Subversion URL parameter. Within that scope, source checkouts can be -specified by a numeric revision number (a repository-wide -monotonically-increasing marker, such that each transaction that changes the -repository is indexed by a different revision number), or a revision -timestamp.

+

Subversion combines the +repository, module, and branch into a single Subversion URL parameter. +Within that scope, source checkouts can be specified by a numeric revision +number (a repository-wide monotonically-increasing marker, such that each +transaction that changes the repository is indexed by a different revision +number), or a revision timestamp.

Arch specifies a repository by URL, as well as a version which is kind of like a branch name. Arch @@ -166,4 +166,45 @@ repository that you want to build from. The build slave will then pull the latest patches from that repository and build them.

+

Attributes of Changes

+ +

Each Change has a whoattribute, which specifies which +developer is responsible for the change. This is a string which comes from a +namespace controlled by the VC repository. Frequently this means it is a +username on the host which runs the repository, but not all VC systems +require this (Arch, for example, would use a fully-qualified Arch ID, +which looks like an email address). Each StatusNotifier will map the +who attribute into something appropriate for their particular +means of communication: an email address, an IRC handle, etc.

+ +

Each Change can have a revision attribute, which describes +how to get a tree with a specific state: a tree which includes this Change +(and all that came before it) but none that come after it. If this +information is unavailable, the .revision attribute will be +None. These revisions are provided by the ChangeSource, and +consumed by the computeSourceRevision method in the appropriate +step.Source class.

+ +
    +
  • CVS: revision is an int, seconds since the epoch
  • +
  • SVN: revision is an int, a transation number (r%d)
  • +
  • Darcs: does not yet use revision
  • +
  • Arch: revision is a string, ending in --patch-%d
  • +
  • Bazaar: same as Arch
  • +
  • P4: revision is an int, the transaction number
  • +
+ +

The Change might also have a tag attribute. This is primarily +intended to represent the CVS named branch (since CVS does not embed the +branch in the pathname like many of the other systems), however it +could be used for other purposes as well (e.g. some VC systems might allow +commits to be marked as cosmetic, or docs-only, or something). The +Build, in its isTagImportant method, gets to decide whether the +tag is important or not. This allows you to configure Builds which only fire +on changes to a specific branch. For a change to trigger a build, both the +tag must be important, and at least one of the files inside the +change must be considered important.

+ +

+ Index: steps.xhtml =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/steps.xhtml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- steps.xhtml 13 Oct 2004 00:11:30 -0000 1.6 +++ steps.xhtml 6 May 2005 04:42:33 -0000 1.7 @@ -269,8 +269,8 @@

Arch

The Arch build step performs an Arch checkout or update. It takes the -following arguments.

+href="http://gnuarch.org/">Arch checkout or update using the +tla client. It takes the following arguments.

  • url (required): this specifies the URL at which the Arch @@ -279,14 +279,24 @@
  • version (required): this specifies which development line (like a branch) should be used.
  • -
  • archive (optional): this can be used to override the - local name associated with the archive at url, which is - occasionally necessary in some weird situations. Using this option - prevents mode='update' or mode='copy' from - working, so avoid it if at all possible. It may be removed in a later - release.
  • +
  • archive (optional): Each repository knows its own archive + name. If this parameter is provided, it must match the repository's archive + name. The parameter is accepted for compatibility with the + Bazaar step, below.
+

Bazaar

+ +

Bazaar is an alternate implementation of the Arch VC system, +which uses a client named baz. The checkout semantics are just +different enough from tla that there is a separate BuildStep for +it.

+ +

It takes exactly the same arguments as Arch, except that the +archive= parameter is required. (baz does not emit the archive +name when you do baz register-archive, so we must provide it +ourselves).

+

P4Sync

From warner at users.sourceforge.net Fri May 6 04:42:44 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 06 May 2005 04:42:44 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.415,1.416 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21843 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-137 Creator: Brian Warner Merged from org.apestaart at thomas--buildbot (patch 0-2), warner at monolith.lothar.com--2005 (patch 0-3) Merged in Change(tag=) enhancement from Thomas Vander Stichele. Patches applied: * org.apestaart at thomas--buildbot/buildbot--cvstag--0-dev--base-0 tag of org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-dev--patch-1 tag of org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--base-0 tag of org.apestaart at thomas--buildbot/buildbot--releases--0--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-1 merge in first patch on the old cvsbranch branch * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 merge in complete cvsbranch to this new branch * org.apestaart at thomas--buildbot/buildbot--releases--0--base-0 tag of arch at buildbot.sf.net--2004/buildbot--dev--0--patch-21 * org.apestaart at thomas--buildbot/buildbot--releases--0--patch-1 merge in 0.6.3 release * org.apestaart at thomas--buildbot/buildbot--releases--0--patch-2 merge in 0.6.4 release * org.apestaart at thomas/buildbot--cvsbranch--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--cvsbranch--0--patch-1 add "tag" concept to changes, and add isTagImportant to be overridden * org.apestaart at thomas/buildbot--cvsbranch--0--patch-2 and add the file to test with * org.apestaart at thomas/buildbot--cvsbranch--0--patch-3 clean up logging * org.apestaart at thomas/buildbot--cvsbranch--0--patch-4 unboundlocalerror fix * warner at monolith.lothar.com--2005/buildbot--dev--0--base-0 tag of arch at buildbot.sf.net--2004/buildbot--dev--0--patch-130 * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-1 Merged from arch at buildbot.sf.net--2004 (patch 131-136) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-2 Merged from org.apestaart at thomas--buildbot cvstag--0-dev (patch 0-2) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-3 add some docs, document Change(tag=) Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.415 retrieving revision 1.416 diff -u -d -r1.415 -r1.416 --- ChangeLog 4 May 2005 07:37:26 -0000 1.415 +++ ChangeLog 6 May 2005 04:42:42 -0000 1.416 @@ -1,3 +1,20 @@ +2005-05-05 Brian Warner + + * docs/source.xhtml: document some of the attributes that Changes + might have + + * docs/steps.xhtml (Bazaar): document the Bazaar checkout step + + * general: merge in Change(tag=) patch from Thomas Vander Stichele. + [org.apestaart at thomas--buildbot/buildbot--cvstag--0-dev--patch-2] + * buildbot/changes/changes.py (Change) + * buildbot/changes/mail.py (parseSyncmail) + * buildbot/test/test_mailparse.py (Test3.getNoPrefix) + (Test3.testMsgS5) + * buildbot/process/base.py (Build.isTagImportant) + (Build.addChange) + + 2005-05-04 Brian Warner * buildbot/clients/sendchange.py (Sender.send): tear down the PB From warner at users.sourceforge.net Fri May 6 04:42:44 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 06 May 2005 04:42:44 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process base.py,1.50,1.51 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21843/buildbot/process Modified Files: base.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-137 Creator: Brian Warner Merged from org.apestaart at thomas--buildbot (patch 0-2), warner at monolith.lothar.com--2005 (patch 0-3) Merged in Change(tag=) enhancement from Thomas Vander Stichele. Patches applied: * org.apestaart at thomas--buildbot/buildbot--cvstag--0-dev--base-0 tag of org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-dev--patch-1 tag of org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--base-0 tag of org.apestaart at thomas--buildbot/buildbot--releases--0--patch-2 * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-1 merge in first patch on the old cvsbranch branch * org.apestaart at thomas--buildbot/buildbot--cvstag--0-rel--patch-2 merge in complete cvsbranch to this new branch * org.apestaart at thomas--buildbot/buildbot--releases--0--base-0 tag of arch at buildbot.sf.net--2004/buildbot--dev--0--patch-21 * org.apestaart at thomas--buildbot/buildbot--releases--0--patch-1 merge in 0.6.3 release * org.apestaart at thomas--buildbot/buildbot--releases--0--patch-2 merge in 0.6.4 release * org.apestaart at thomas/buildbot--cvsbranch--0--base-0 tag of org.apestaart at thomas/buildbot--releases--0.6.2--patch-2 * org.apestaart at thomas/buildbot--cvsbranch--0--patch-1 add "tag" concept to changes, and add isTagImportant to be overridden * org.apestaart at thomas/buildbot--cvsbranch--0--patch-2 and add the file to test with * org.apestaart at thomas/buildbot--cvsbranch--0--patch-3 clean up logging * org.apestaart at thomas/buildbot--cvsbranch--0--patch-4 unboundlocalerror fix * warner at monolith.lothar.com--2005/buildbot--dev--0--base-0 tag of arch at buildbot.sf.net--2004/buildbot--dev--0--patch-130 * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-1 Merged from arch at buildbot.sf.net--2004 (patch 131-136) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-2 Merged from org.apestaart at thomas--buildbot cvstag--0-dev (patch 0-2) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-3 add some docs, document Change(tag=) Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/base.py,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- base.py 3 May 2005 20:02:03 -0000 1.50 +++ base.py 6 May 2005 04:42:41 -0000 1.51 @@ -101,11 +101,19 @@ @param filename: name of a file to check, relative to the VC base @type filename: string - @rtype: 0 or 1 + @rtype: boolean @returns: whether the change to this file should trigger a rebuild """ - return 1 - + return True + + def isTagImportant(self, tag): + """I return True if the given tag is important enough to trigger a + rebuild, False if it should be ignored. Override me to ignore + unimporant tags. The timer is not restarted, so a checkout may occur + in the middle of a set of changes marked 'unimportant'. Also, the + checkout may or may not pick up the 'unimportant' changes.""" + return True + def bumpMaxChangeNumber(self, change): if not self.maxChangeNumber: self.maxChangeNumber = change.number @@ -119,17 +127,24 @@ @type change: L{buildbot.changes.changes.Change} """ + # for a change to be important, it needs to be with an important + # tag and it need to contain an important file + important = 0 - for filename in change.files: - if self.isFileImportant(filename): - important = 1 - break + + if self.isTagImportant(change.tag): + for filename in change.files: + if self.isFileImportant(filename): + important = 1 + break + if important: self.addImportantChange(change) else: self.addUnimportantChange(change) def addImportantChange(self, change): + log.msg("builder %s: change is important, adding" % self.builder.name) self.bumpMaxChangeNumber(change) self.changes.append(change) self.nextBuildTime = change.when + self.treeStableTimer From warner at users.sourceforge.net Fri May 6 04:58:01 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 06 May 2005 04:58:01 +0000 Subject: [Buildbot-commits] buildbot/buildbot master.py,1.69,1.70 plugins.tml,1.1,NONE bb_tap.py,1.4,NONE Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24357/buildbot Modified Files: master.py Removed Files: plugins.tml bb_tap.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-139 Creator: Brian Warner Merged from warner at monolith.lothar.com--2005 (patch 4-5) Stop using mktap, create buildbot.tac instead. Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-4 stop using mktap, create buildbot.tac instead * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-5 remove more old mktap-related code --- bb_tap.py DELETED --- Index: master.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- master.py 4 May 2005 06:44:30 -0000 1.69 +++ master.py 6 May 2005 04:57:58 -0000 1.70 @@ -524,11 +524,6 @@ def upgradeToVersion2(self): self.names = {} - def __getstate__(self): - state = styles.Versioned.__getstate__(self) - state['names'] = {} - return state - def register(self, name, afactory): self.names[name] = afactory def unregister(self, name): @@ -623,15 +618,6 @@ self.readConfig = False - def __getstate__(self): - state = service.MultiService.__getstate__(self) - state = styles.Versioned.__getstate__(self, state) - if state.has_key('change_svc'): - del state['change_svc'] - state['services'] = [] - state['namedServices'] = {} - return state - def upgradeToVersion1(self): self.dispatcher = self.slaveFactory.root.portal.realm @@ -1031,35 +1017,3 @@ # so anybody who can get a handle on the BuildMaster can force a build with: # IControl(master).getBuilder("full-2.3").forceBuild("me", "boredom") - -class Options(usage.Options): - synopsis = "Usage: mktap buildbot master --basedir " - - longdesc = """ - This command creates a buildmaster .tap file. The master will live in - and create various files there. - - At runtime, the master will read a configuration file (named - 'master.cfg' by default) in its basedir. This file should contain python - code which eventually defines a dictionary named 'BuildmasterConfig'. - The elements of this dictionary are used to configure the Buildmaster. - See doc/config.xhtml for details about what can be controlled through - this interface. """ - - optParameters = [ - ["basedir", "d", None, "Base directory for the buildmaster"], - ["config", "c", "master.cfg", "configuration file name"], - ] - - def abort(self): - print self - sys.exit(2) - - def postOptions(self): - if self['basedir'] == None: - print " Must specify basedir with '--basedir DIR'" - print - self.abort() - -def makeService(config): - return BuildMaster(config['basedir'], config['config']) --- plugins.tml DELETED --- From warner at users.sourceforge.net Fri May 6 04:58:01 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 06 May 2005 04:58:01 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_config.py,1.18,1.19 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24357/buildbot/test Modified Files: test_config.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-139 Creator: Brian Warner Merged from warner at monolith.lothar.com--2005 (patch 4-5) Stop using mktap, create buildbot.tac instead. Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-4 stop using mktap, create buildbot.tac instead * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-5 remove more old mktap-related code Index: test_config.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_config.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- test_config.py 4 May 2005 06:44:31 -0000 1.18 +++ test_config.py 6 May 2005 04:57:59 -0000 1.19 @@ -911,55 +911,3 @@ m = BuildMaster("test_cf", "alternate.cfg") m.loadTheConfigFile() self.failUnlessEqual(m.slavePortnum, 9000) - -saveCfg1 = \ -""" -from buildbot.changes import pb -from buildbot.status import html, client -c = {} -c['bots'] = [] -c['sources'] = [pb.PBChangeSource()] -c['builders'] = [] -c['slavePortnum'] = 0 -c['status'] = [html.Waterfall(http_port=0), client.PBListener(0)] -BuildmasterConfig = c -""" - -class Save(unittest.TestCase): - def setUp(self): - self.saved_argv = sys.argv - def tearDown(self): - sys.argv = self.saved_argv - - def testSave(self): - # the idea here is to create the same buildbot.tap file that 'mktap - # buildbot master --basedir test_save' would create. Then we load it, - # and make sure it looks ok. We copy some code from - # twisted.scripts.mktap to avoid spawning a mktap instance (who knows - # how to accomplish such a thing under windows). - - from twisted.scripts import mktap - os.mkdir("test_save") - f = open(os.path.join("test_save", "master.cfg"), "w") - f.write(saveCfg1) - f.close() - tapname = os.path.join("test_save", "buildbot.tap") - self.failIf(os.path.exists(tapname)) # shouldn't ever happen - sys.argv = ["mktap", "-a", tapname, - "buildbot", "master", "--basedir", "test_save"] - mktap.run() # creates test_save/buildbot.tap - - # now start the buildmaster from there - a = service.loadApplication(tapname, "pickle", None) - service.IService(a).startService() - - # the buildmaster ought to be running now - m = service.IService(a).getServiceNamed("buildmaster") - self.failUnless(m.running) - self.failUnlessEqual(len(list(m.change_svc)), 1) - - # now shut it down - d = defer.maybeDeferred(service.IService(a).stopService) - dr(d) - - # done From warner at users.sourceforge.net Fri May 6 04:58:00 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 06 May 2005 04:58:00 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave bot.py,1.12,1.13 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24357/buildbot/slave Modified Files: bot.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-139 Creator: Brian Warner Merged from warner at monolith.lothar.com--2005 (patch 4-5) Stop using mktap, create buildbot.tac instead. Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-4 stop using mktap, create buildbot.tac instead * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-5 remove more old mktap-related code Index: bot.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/bot.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- bot.py 25 Apr 2005 19:06:23 -0000 1.12 +++ bot.py 6 May 2005 04:57:58 -0000 1.13 @@ -447,76 +447,3 @@ service.MultiService.stopService(self) # now kill the TCP connection self.connection._connection.disconnect() - -class Options(usage.Options): - synopsis = "Usage: mktap buildbot slave --name --passwd [options]" - - longdesc = """ - This command creates a buildslave .tap file. The bot will use the - and arguments to authenticate itself when connecting to the - master. All commands are run in a build-specific subdirectory of - , which defaults to the working directory that mktap was run - from. is a string of the form 'hostname:port', and specifies - where the buildmaster can be reached. - - , , and will be provided by the buildmaster - administrator for your bot. - """ - - optParameters = [ - ["name", "n", None, "Name for this build slave"], - ["passwd", "p", None, "Password for this build slave"], - ["basedir", "d", ".", "Base directory to use"], - ["master", "m", "localhost:8007", - "Location of the buildmaster (host:port)"], - ["keepalive", "k", 0, - "Interval at which keepalives should be sent (in seconds)"], - ["usepty", None, 1, "child processes should be run in a pty"], - ] - - def abort(self): - print self.__str__() - sys.exit(2) - - def postOptions(self): - problems = 0 - if self['name'] == None: - print " Must specify buildslave name with '--name myslave'" - problems = 1 - if self['passwd'] == None: - print " Must specify slave password with '--passwd myslave'" - problems = 1 - self['usepty'] = int(self['usepty']) - self['keepalive'] = int(self['keepalive']) - if problems: - print - self.abort() - - -def makeService(config): - basedir = config['basedir'] - master = config['master'] - - if not os.path.isdir(basedir): - raise "bot homedir '%s' is not a directory" % basedir - basedir = os.path.abspath(basedir) - print " Using '%s' for slave base directory" % basedir - try: - host, port = re.search(r'(.+):(\d+)', master).groups() - port = int(port) - except: - print "unparseable master location '%s'" % master - print " expecting something more like localhost:8007" - raise - print " Will connect to buildmaster on host '%s' at port '%d'" % (host, - port) - if config['usepty']: - print " Will run child processes in PTYs" - else: - print " Will NOT run child processes in PTYs" - - s = BuildSlave(host, port, - config['name'], config['passwd'], basedir, - config['keepalive'], config['usepty']) - s.setName("buildslave") - return s From warner at users.sourceforge.net Fri May 6 04:58:00 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 06 May 2005 04:58:00 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.17,1.18 sample.mk,1.1,1.2 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24357/buildbot/scripts Modified Files: runner.py sample.mk Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-139 Creator: Brian Warner Merged from warner at monolith.lothar.com--2005 (patch 4-5) Stop using mktap, create buildbot.tac instead. Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-4 stop using mktap, create buildbot.tac instead * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-5 remove more old mktap-related code Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- runner.py 4 May 2005 04:14:31 -0000 1.17 +++ runner.py 6 May 2005 04:57:58 -0000 1.18 @@ -2,7 +2,7 @@ # N.B.: don't import anything that might pull in a reactor yet. Some of our # subcommands want to load modules that need the gtk reactor. -import os, os.path, sys, shutil, stat +import os, os.path, sys, shutil, stat, re from twisted.python import usage, util, runtime # this is mostly just a front-end for mktap, twistd, and kill(1), but in the @@ -12,9 +12,32 @@ # the create/start/stop commands should all be run as the same user, # preferably a separate 'buildbot' account. +class MakerBase(usage.Options): + optFlags = [ + ['help', 'h', "Display this message"], + ["quiet", "q", "Do not emit the commands being run"], + ] + + #["basedir", "d", None, "Base directory for the buildmaster"], + opt_h = usage.Options.opt_help + + def parseArgs(self, *args): + if len(args) > 0: + self['basedir'] = args[0] + else: + self['basedir'] = None + if len(args) > 1: + raise usage.UsageError("I wasn't expecting so many arguments") + + def postOptions(self): + if self['basedir'] is None: + raise usage.UsageError(" parameter is required") + self['basedir'] = os.path.abspath(self['basedir']) + class Maker: def __init__(self, config): - self.basedir = os.path.abspath(config['basedir']) + self.config = config + self.basedir = config['basedir'] self.force = config['force'] self.quiet = config['quiet'] @@ -49,31 +72,44 @@ if not self.quiet: print "chdir", self.basedir os.chdir(self.basedir) - def mktap(self, cmd): - if not self.quiet: print cmd - status = os.system(cmd) - if status != 0: - print "mktap failed, bailing.." - sys.exit(1) - if not os.path.exists("buildbot.tap"): - print "mktap failed to create buildbot.tap, bailing.." - sys.exit(1) - os.chmod("buildbot.tap", 0600) + def makeTAC(self, contents, secret=False): + tacfile = "buildbot.tac" + if os.path.exists(tacfile): + oldcontents = open(tacfile, "rt").read() + if oldcontents == contents: + print "buildbot.tac already exists and is correct" + return + print "not touching existing buildbot.tac" + print "creating buildbot.tac.new instead" + tacfile = "buildbot.tac.new" + f = open(tacfile, "wt") + f.write(contents) + f.close() + if secret: + os.chmod(tacfile, 0600) - def makefile(self, source, cmd): + def makeSlaveTAC(self): + + tacfile = "buildbot.tac" + if os.path.exists(tacfile): + oldcontents = open(tacfile, "rt").read() + if oldcontents == contents: + print "buildbot.tac already exists and is correct" + return + print "not touching existing buildbot.tac" + print "creating buildbot.tac.new instead" + tacfile = "buildbot.tac.new" + f = open(tacfile, "wt") + f.write(contents) + f.close() + + def makefile(self, source): target = "Makefile" if os.path.exists(target): print "not touching existing Makefile" print "installing sample in Makefile.sample instead" target = "Makefile.sample" shutil.copy(source, target) - os.chmod(target, 0600) - f = open(target, "a") - f.write("\n") - f.write("tap:\n") - f.write("\t" + cmd + "\n") - f.write("\n") - f.close() def sampleconfig(self, source): target = "master.cfg" @@ -84,31 +120,134 @@ shutil.copy(source, target) os.chmod(target, 0600) +class MasterOptions(MakerBase): + optFlags = [ + ["force", "f", + "Re-use an existing directory (will not overwrite master.cfg file)"], + ] + optParameters = [ + ["config", "c", "master.cfg", "name of the buildmaster config file"], + ] + def getSynopsis(self): + return "Usage: buildbot master [options] " + + longdesc = """ + This command creates a buildmaster working directory and buildbot.tac + file. The master will live in and create various files there. + + At runtime, the master will read a configuration file (named + 'master.cfg' by default) in its basedir. This file should contain python + code which eventually defines a dictionary named 'BuildmasterConfig'. + The elements of this dictionary are used to configure the Buildmaster. + See doc/config.xhtml for details about what can be controlled through + this interface.""" + +masterTAC = """ +from twisted.application import service +from buildbot.master import BuildMaster + +basedir = '%(basedir)s' +configfile = '%(config)s' + +application = service.Application('buildmaster') +BuildMaster(basedir, configfile).setServiceParent(application) + +""" + def createMaster(config): m = Maker(config) m.mkdir() m.chdir() - - cmd = "mktap buildbot master --basedir %s" % m.basedir - - m.mktap(cmd) + contents = masterTAC % config + m.makeTAC(contents) m.sampleconfig(util.sibpath(__file__, "sample.cfg")) - m.makefile(util.sibpath(__file__, "sample.mk"), cmd) + m.makefile(util.sibpath(__file__, "sample.mk")) if not m.quiet: print "buildmaster configured in %s" % m.basedir sys.exit(0) +class SlaveOptions(MakerBase): + optFlags = [ + ["force", "f", "Re-use an existing directory"], + ] + optParameters = [ +# ["name", "n", None, "Name for this build slave"], +# ["passwd", "p", None, "Password for this build slave"], +# ["basedir", "d", ".", "Base directory to use"], +# ["master", "m", "localhost:8007", +# "Location of the buildmaster (host:port)"], + + ["keepalive", "k", 0, + "Interval at which keepalives should be sent (in seconds)"], + ["usepty", None, 1, + "(1 or 0) child processes should be run in a pty"], + ] + + longdesc = """ + This command creates a buildslave working directory and buildbot.tac + file. The bot will use the and arguments to authenticate + itself when connecting to the master. All commands are run in a + build-specific subdirectory of , which defaults to the working + directory that mktap was run from. is a string of the form + 'hostname:port', and specifies where the buildmaster can be reached. + + , , and will be provided by the buildmaster + administrator for your bot. + """ + + def getSynopsis(self): + return "Usage: buildbot slave [options] " + + def parseArgs(self, *args): + if len(args) < 4: + raise usage.UsageError("command needs more arguments") + basedir, master, name, passwd = args + self['basedir'] = basedir + self['master'] = master + self['name'] = name + self['passwd'] = passwd + + def postOptions(self): + MakerBase.postOptions(self) + self['usepty'] = int(self['usepty']) + self['keepalive'] = int(self['keepalive']) + +slaveTAC = """ +from twisted.application import service +from buildbot.slave.bot import BuildSlave + +basedir = '%(basedir)s' +host = '%(host)s' +port = %(port)d +slavename = '%(name)s' +passwd = '%(passwd)s' +keepalive = %(keepalive)d +usepty = %(usepty)d + +application = service.Application('buildslave') +s = BuildSlave(host, port, slavename, passwd, basedir, keepalive, usepty) +s.setServiceParent(application) + +""" + def createSlave(config): m = Maker(config) m.mkdir() m.chdir() + try: + master = config['master'] + host, port = re.search(r'(.+):(\d+)', master).groups() + config['host'] = host + config['port'] = int(port) + except: + print "unparseable master location '%s'" % master + print " expecting something more like localhost:8007" + raise + contents = slaveTAC % config - cmd = ("mktap buildbot slave " + - "--basedir %s --master %s --name %s --passwd %s" \ - % (m.basedir, config['master'], config['name'], config['passwd'])) + m.makeTAC(contents, secret=True) - m.mktap(cmd) - m.makefile(util.sibpath(__file__, "sample.mk"), cmd) + m.makefile(util.sibpath(__file__, "sample.mk")) m.mkinfo() if not m.quiet: print "buildslave configured in %s" % m.basedir @@ -199,49 +338,11 @@ del localDict[k] return localDict -class Base(usage.Options): - optFlags = [ - ['help', 'h', "Display this message"], - ["quiet", "q", "Do not emit the commands being run"], - ] - opt_h = usage.Options.opt_help - - def parseArgs(self, basedir=None): - if basedir is None: - raise usage.UsageError(" parameter is required") - self['basedir'] = basedir - -class MasterOptions(Base): - optFlags = [ - ["force", "f", - "Re-use an existing directory (will not overwrite master.cfg file)"], - ] - def getSynopsis(self): - return "Usage: buildbot master [options] " - -class SlaveOptions(Base): - optFlags = [ - ["force", "f", "Re-use an existing directory"], -# ["nopty", None, "Do *not* run child commands under a PTY"], - ] - - def getSynopsis(self): - return "Usage: buildbot slave [options] " - - def parseArgs(self, *args): - if len(args) < 4: - raise usage.UsageError("command needs more arguments") - basedir, master, name, passwd = args - self['basedir'] = basedir - self['master'] = master - self['name'] = name - self['passwd'] = passwd - -class StartOptions(Base): +class StartOptions(MakerBase): def getSynopsis(self): return "Usage: buildbot start " -class StopOptions(Base): +class StopOptions(MakerBase): def getSynopsis(self): return "Usage: buildbot stop " Index: sample.mk =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/sample.mk,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sample.mk 12 Oct 2004 17:49:16 -0000 1.1 +++ sample.mk 6 May 2005 04:57:58 -0000 1.2 @@ -1,16 +1,19 @@ # -*- makefile -*- # This is a simple makefile which lives in a buildmaster/buildslave -# directory (next to the buildbot.tap file). It allows you to start/stop the -# master ot slave by doing 'make start' or 'make stop'. +# directory (next to the buildbot.tac file). It allows you to start/stop the +# master or slave by doing 'make start' or 'make stop'. # The 'reconfig' target will tell a buildmaster to reload its config file. start: - twistd --no_save -f buildbot.tap + twistd --no_save -y buildbot.tac stop: kill `cat twistd.pid` reconfig: kill -HUP `cat twistd.pid` + +log: + tail -f twistd.log From warner at users.sourceforge.net Fri May 6 04:58:00 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 06 May 2005 04:58:00 +0000 Subject: [Buildbot-commits] buildbot README,1.25,1.26 ChangeLog,1.416,1.417 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24357 Modified Files: README ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-139 Creator: Brian Warner Merged from warner at monolith.lothar.com--2005 (patch 4-5) Stop using mktap, create buildbot.tac instead. Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-4 stop using mktap, create buildbot.tac instead * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-5 remove more old mktap-related code Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.416 retrieving revision 1.417 diff -u -d -r1.416 -r1.417 --- ChangeLog 6 May 2005 04:42:42 -0000 1.416 +++ ChangeLog 6 May 2005 04:57:58 -0000 1.417 @@ -1,5 +1,22 @@ 2005-05-05 Brian Warner + * buildbot/master.py (Dispatcher.__getstate__): remove old + .tap-related methods + (BuildMaster.__getstate__): same + (makeService): same + * buildbot/slave/bot.py (makeService): same + (Options.longdesc): same + * buildbot/scripts/runner.py: copy over some old mktap option text + + * buildbot/scripts/runner.py (masterTAC): stop using mktap. + 'buildbot master' now creates a buildbot.tac file, so there is no + longer a create-instance/save/reload sequence. mktap is dead, long + live twistd -y. + * buildbot/scripts/sample.mk: use twistd -y, not -f + * buildbot/test/test_config.py: remove mktap-based test + * buildbot/bb_tap.py, buildbot/plugins.tml: delete old files + * README: don't reference mktap + * docs/source.xhtml: document some of the attributes that Changes might have Index: README =================================================================== RCS file: /cvsroot/buildbot/buildbot/README,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- README 26 Apr 2005 02:54:35 -0000 1.25 +++ README 6 May 2005 04:57:58 -0000 1.26 @@ -168,10 +168,10 @@ keepalive defaults to running once every 10 minutes. To manually turn on application-level keepalives, or to set them to use some -other interval, add "--keepalive NNN" to the mktap command line. NNN is the -number of seconds between keepalives. Use as large a value as your NAT box -allows to reduce the amount of unnecessary traffic on the wire. 600 seconds -(10 minutes) is a reasonable value. +other interval, add "--keepalive NNN" to the 'buildbot slave' command line. +NNN is the number of seconds between keepalives. Use as large a value as your +NAT box allows to reduce the amount of unnecessary traffic on the wire. 600 +seconds (10 minutes) is a reasonable value. SETTING UP A BUILD MASTER: From warner at users.sourceforge.net Fri May 6 05:01:13 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 06 May 2005 05:01:13 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.417,1.418 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25130 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-141 Creator: Brian Warner Merged from warner at monolith.lothar.com--2005 (patch 6) Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-6 don't spawn twistd or /bin/kill in 'buildbot start/stop' Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.417 retrieving revision 1.418 diff -u -d -r1.417 -r1.418 --- ChangeLog 6 May 2005 04:57:58 -0000 1.417 +++ ChangeLog 6 May 2005 05:01:11 -0000 1.418 @@ -1,5 +1,15 @@ 2005-05-05 Brian Warner + * buildbot/scripts/runner.py (start): if there is no Makefile, + launch the app by importing twistd's internals and calling run(), + rather than spawning a new twistd process. This stands a much + better chance of working under windows. + (stop): kill the process with os.kill instead of spawning + /bin/kill, again to reduce the number of external programs which + windows might not have in the PATH. Also wait up to 5 seconds for + the process to go away, allowing things like 'buildbot stop; + buildbot start' to be reliable in the face of slow shutdowns. + * buildbot/master.py (Dispatcher.__getstate__): remove old .tap-related methods (BuildMaster.__getstate__): same From warner at users.sourceforge.net Fri May 6 05:01:13 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 06 May 2005 05:01:13 +0000 Subject: [Buildbot-commits] buildbot/buildbot master.py,1.70,1.71 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25130/buildbot Modified Files: master.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-141 Creator: Brian Warner Merged from warner at monolith.lothar.com--2005 (patch 6) Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-6 don't spawn twistd or /bin/kill in 'buildbot start/stop' Index: master.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- master.py 6 May 2005 04:57:58 -0000 1.70 +++ master.py 6 May 2005 05:01:11 -0000 1.71 @@ -612,8 +612,8 @@ self.bots = [] # this ChangeMaster is a dummy, only used by tests. In the real - # buildmaster, where the BuildMaster instance is created by mktap, - # this attribute is not saved in the buildbot.tap file. + # buildmaster, where the BuildMaster instance is activated + # (startService is called) by twistd, this attribute is overwritten. self.useChanges(ChangeMaster()) self.readConfig = False From warner at users.sourceforge.net Fri May 6 05:01:13 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 06 May 2005 05:01:13 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.18,1.19 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25130/buildbot/scripts Modified Files: runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-141 Creator: Brian Warner Merged from warner at monolith.lothar.com--2005 (patch 6) Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-6 don't spawn twistd or /bin/kill in 'buildbot start/stop' Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- runner.py 6 May 2005 04:57:58 -0000 1.18 +++ runner.py 6 May 2005 05:01:11 -0000 1.19 @@ -2,7 +2,7 @@ # N.B.: don't import anything that might pull in a reactor yet. Some of our # subcommands want to load modules that need the gtk reactor. -import os, os.path, sys, shutil, stat, re +import os, os.path, sys, shutil, stat, re, time from twisted.python import usage, util, runtime # this is mostly just a front-end for mktap, twistd, and kill(1), but in the @@ -261,23 +261,47 @@ # yes, this is clunky. Preferring the Makefile lets slave admins do # useful things like set up environment variables for the buildslave. cmd = "make start" + if not quiet: print cmd + os.system(cmd) else: - reactor_arg = "" - if sys.platform == "win32": - reactor_arg = "--reactor=win32" - cmd = "twistd %s --no_save -f buildbot.tap" % reactor_arg - if not quiet: print cmd - os.system(cmd) + # see if we can launch the application without actually having to + # spawn twistd, since spawning processes correctly is a real hassle + # on windows. + from twisted.python.runtime import platformType + argv = ["twistd", "--no_save", "--python=buildbot.tac"] + if platformType == "win32": + argv.append("--reactor=win32") + sys.argv = argv + + # this is copied from bin/twistd + if platformType == "win32": + from twisted.scripts._twistw import run + else: + from twisted.scripts.twistd import run + run() + sys.exit(0) -def stop(config, signal=""): +def stop(config, signame="TERM"): + import signal basedir = config['basedir'] quiet = config['quiet'] os.chdir(basedir) - cmd = "kill %s `cat twistd.pid`" % signal - if not quiet: print cmd - os.system(cmd) - # TODO: poll once per second until twistd.pid goes away + f = open("twistd.pid", "rt") + pid = int(f.read().strip()) + signum = getattr(signal, "SIG"+signame) + timer = 0 + os.kill(pid, signum) + while timer < 5: + # poll once per second until twistd.pid goes away, up to 5 seconds + try: + os.kill(pid, signum) + except OSError: + print "buildbot process %d is dead" % pid + sys.exit(0) + timer += 1 + time.sleep(1) + print "never saw process go away" sys.exit(0) def loadOptions(filename="options", here=None, home=None): From warner at users.sourceforge.net Fri May 6 06:40:06 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 06 May 2005 06:40:06 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.418,1.419 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11379 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-143 Creator: Brian Warner Merged from warner at monolith.lothar.com--2005 (patch 7-8) Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-7 Merged from arch at buildbot.sf.net--2004 (patch 137-142) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-8 create OfflineLogFile to handle very large logs without lots of RAM Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.418 retrieving revision 1.419 diff -u -d -r1.418 -r1.419 --- ChangeLog 6 May 2005 05:01:11 -0000 1.418 +++ ChangeLog 6 May 2005 06:40:04 -0000 1.419 @@ -1,3 +1,20 @@ +2005-05-06 Brian Warner + + * buildbot/status/builder.py (OfflineLogFile): replace the default + LogFile with a form that appends its new contents to a disk file + as they arrive. The complete log data is never kept in RAM. This + is the first step towards handling very large (100MB+) logfiles + without choking quite so badly. (The other half is + producer/consumer on the HTML pages). + (BuildStepStatus.addLog): use OfflineLogFile by default + (BuildStatus.getLogfileName): helper code to give the + OfflineLogFile a filename to work with + + * buildbot/test/test_status.py (Results.testAddResults): update + tests to handle new asserts + * buildbot/test/test_vc.py (Patch.doPatch): same + * buildbot/test/test_steps.py (BuildStep.setUp): same + 2005-05-05 Brian Warner * buildbot/scripts/runner.py (start): if there is no Makefile, From warner at users.sourceforge.net Fri May 6 06:40:06 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 06 May 2005 06:40:06 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_steps.py,1.12,1.13 test_vc.py,1.27,1.28 test_status.py,1.15,1.16 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11379/buildbot/test Modified Files: test_steps.py test_vc.py test_status.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-143 Creator: Brian Warner Merged from warner at monolith.lothar.com--2005 (patch 7-8) Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-7 Merged from arch at buildbot.sf.net--2004 (patch 137-142) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-8 create OfflineLogFile to handle very large logs without lots of RAM Index: test_status.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_status.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- test_status.py 26 Apr 2005 09:08:29 -0000 1.15 +++ test_status.py 6 May 2005 06:40:04 -0000 1.16 @@ -289,7 +289,7 @@ class Results(unittest.TestCase): def testAddResults(self): - b = builder.BuildStatus(None, 12) + b = builder.BuildStatus(builder.BuilderStatus("test"), 12) testname = ("buildbot", "test", "test_status", "Results", "testAddResults") r1 = builder.TestResult(name=testname, Index: test_steps.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_steps.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- test_steps.py 24 Apr 2005 21:30:25 -0000 1.12 +++ test_steps.py 6 May 2005 06:40:04 -0000 1.13 @@ -14,7 +14,7 @@ # todo: test batched updates, by invoking remote_update(updates) instead of # statusUpdate(update). Also involves interrupted builds. -import sys, time +import os, sys, time from twisted.trial import unittest from twisted.internet import reactor @@ -28,7 +28,9 @@ #log.startLogging(sys.stdout) class MyShellCommand(ShellCommand): + started = False def runCommand(self, c): + self.started = True self.rc = c return ShellCommand.runCommand(self, c) @@ -36,6 +38,7 @@ pass class FakeBuilder: statusbag = None + name = "fakebuilder" def getSlaveCommandVersion(self, command, oldversion=None): return "1.10" @@ -60,8 +63,13 @@ class BuildStep(unittest.TestCase): def setUp(self): - self.build = base.Build() self.builder = FakeBuilder() + self.builder_status = builder.BuilderStatus("fakebuilder") + self.builder_status.basedir = "test_steps" + os.mkdir(self.builder_status.basedir) + self.build_status = self.builder_status.newBuild() + self.build = base.Build() + self.build.build_status = self.build_status # fake it self.build.builder = self.builder self.remote = FakeRemote() self.finished = 0 @@ -85,8 +93,9 @@ c = MyShellCommand(workdir=dir, command=cmd, build=self.build, timeout=10) self.assertEqual(self.remote.events, expectedEvents) - c.step_status = builder.BuildStepStatus(None) + self.build_status.addStep(c) d = c.startStep(self.remote) + self.failUnless(c.started) rc = c.rc d.addCallbacks(self.callback, self.errback) timeout = time.time() + 10 @@ -113,6 +122,7 @@ for log in logs: if log.getName() == "log": break + rc.remoteUpdate({'header': "command 'argle bargle' in dir 'murkle'\n\n"}) rc.remoteUpdate({'stdout': "foo\n"}) Index: test_vc.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- test_vc.py 3 May 2005 20:02:04 -0000 1.27 +++ test_vc.py 6 May 2005 06:40:04 -0000 1.28 @@ -450,8 +450,11 @@ remote = m.botmaster.builders["vc"].remote build = base.Build() build.builder = FakeBuilder() + builder_status = builder.BuilderStatus("test") + builder_status.basedir = "basedir" + build_status = builder.BuildStatus(builder_status, 12) c = vc(mode="clobber", workdir="build", build=build, **kwargs) - c.step_status = builder.BuildStepStatus(None) + build_status.addStep(c) build.setSourceStamp(revision, (0, p0_diff)) d = defer.maybeDeferred(c.startStep, remote) r = dr(d) @@ -468,7 +471,7 @@ # make sure that a rebuild does not use the leftover patched workdir build.setSourceStamp(None, None) c = vc(mode="update", workdir="build", build=build, **kwargs) - c.step_status = builder.BuildStepStatus(None) + build_status.addStep(c) d = defer.maybeDeferred(c.startStep, remote) r = dr(d) if r != SUCCESS: From warner at users.sourceforge.net Fri May 6 06:40:08 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 06 May 2005 06:40:08 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status builder.py,1.52,1.53 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11379/buildbot/status Modified Files: builder.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-143 Creator: Brian Warner Merged from warner at monolith.lothar.com--2005 (patch 7-8) Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-7 Merged from arch at buildbot.sf.net--2004 (patch 137-142) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-8 create OfflineLogFile to handle very large logs without lots of RAM Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- builder.py 26 Apr 2005 07:35:07 -0000 1.52 +++ builder.py 6 May 2005 06:40:05 -0000 1.53 @@ -4,8 +4,9 @@ from twisted.python import log, components from twisted.internet import reactor, defer +from twisted.protocols import basic -import time, os.path, shutil, sys +import time, os.path, shutil, sys, re try: import cPickle as pickle except ImportError: @@ -200,6 +201,111 @@ # self.step must be filled in by our parent self.finished = True +class OfflineLogFileScanner(basic.NetstringReceiver): + def __init__(self, line_cb, channels=[]): + self.line_cb = line_cb + self.channels = channels + def stringReceived(self, line): + channel = int(line[0]) + if not self.channels or (channel in self.channels): + self.line_cb(channel, line[1:]) + +class OfflineLogFile(LogFile): + """An OfflineLogFile keeps all of its contents on disk, in a non-pickle + format that can be appended easily. + + This behaves like LogFile for each individual entry. The difference is + that, when a run of entries are merged together, the merged chunk is + written out to disk instead of being stored in self.entries . + + """ + openfile = None + + def __init__(self, parent, logfilename): + self.step = parent + self.watchers = [] + self.finishedWatchers = [] + self.runEntries = [] + self.filename = logfilename + + def openForWriting(self): + assert not self.finished, "you can't add to a finished log" + if not self.openfile: + f = open(self.step.build.getLogfileNamed(self.filename), "a") + self.openfile = f + return self.openfile + + def scanEntries(self, cb, channels=[]): + if self.openfile: + # we must close it so we can read it properly. It will be opened + # again the next time we try to write to it. + self.openfile.close() + self.openfile = None + f = open(self.step.build.getLogfileNamed(self.filename), "r") + p = OfflineLogFileScanner(cb, channels) + data = f.read(2000) + while data: + p.dataReceived(data) + data = f.read(2000) + f.close() + for channel, text in self.runEntries: + if not channels or (channel in channels): + cb(channel, text) + + def getText(self): + # this produces one ginormous string + chunks = [] + self.scanEntries(lambda channel,chunk: chunks.append(chunk), + (STDOUT, STDERR)) + return "".join(chunks) + + def getTextWithHeaders(self): + chunks = [] + self.scanEntries(lambda channel,chunk: chunks.append(chunk)) + return "".join(chunks) + + def subscribe(self, receiver, catchup): + if self.finished: + return + self.watchers.append(receiver) + if catchup: + self.scanEntries(lambda channel,chunk: + receiver.logChunk(self.step.build, + self.step, self, + channel, chunk)) + + def merge(self): + # merge all .runEntries (which are all of the same type) into a + # single chunk for .entries + if not self.runEntries: + return + channel = self.runEntries[0][0] + text = "".join([c[1] for c in self.runEntries]) + assert channel < 10 + f = self.openForWriting() + f.write("%d:%d" % (1 + len(text), channel)) + f.write(text) + f.write(",") + self.runEntries = [] + self.runLength = 0 + + def finish(self): + self.merge() + if self.openfile: + self.openfile.close() + self.openfile = None + LogFile.finish(self) + + def __getstate__(self): + d = LogFile.__getstate__(self) + if d.has_key('openfile'): + del d['openfile'] + return d + + def stubify(self): + return self + + class HTMLLogFile: __implements__ = interfaces.IStatusLog, @@ -302,7 +408,7 @@ @cvar text: list of short texts that describe the command and its status @type text2: list of strings @cvar text2: list of short texts added to the overall build description - @type logs: dict of string -> L{buildbot.status.builder.LogFile} + @type logs: dict of string -> L{buildbot.status.builder.OfflineLogFile} @ivar logs: logs of steps """ # note that these are created when the Build is set up, before each @@ -321,6 +427,7 @@ finishedWatchers = [] def __init__(self, parent): + assert interfaces.IBuildStatus(parent) self.build = parent self.logs = [] self.watchers = [] @@ -449,7 +556,8 @@ def addLog(self, name): assert self.started # addLog before stepStarted won't notify watchers - log = LogFile(self) + logfilename = self.build.getLogfileName(self.name, name) + log = OfflineLogFile(self, logfilename) log.name = name self.logs.append(log) for w in self.watchers: @@ -558,6 +666,7 @@ @type parent: L{BuilderStatus} @type number: int """ + assert interfaces.IBuilderStatus(parent) self.builder = parent self.number = number self.watchers = [] @@ -783,6 +892,28 @@ # persistence stuff + def getLogfileName(self, stepname, logname): + """Return an relative path where this logfile's contents can be + stored.""" + starting_filename = stepname + logname + starting_filename = re.sub(r'[^\w\.]', '_', starting_filename) + # now make it unique + unique_counter = 0 + filename = starting_filename + while filename in [l.filename + for step in self.steps + for l in step.getLogs() + if l.filename]: + filename = "%s_%d" % (starting_filename, unique_counter) + unique_counter += 1 + return filename + + def getLogfileNamed(self, logname): + """Return the absolute path of the logfile with the given name""" + filename = os.path.join(self.builder.basedir, + "%d-%s" % (self.number, logname)) + return filename + def stubify(self): self.steps = [step.stubify() for step in self.steps] return self From warner at users.sourceforge.net Tue May 10 08:11:02 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 10 May 2005 08:11:02 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.28,1.29 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31385/buildbot/slave Modified Files: commands.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-145 Creator: Brian Warner added 'cogito' support, patch from Brandon Philips * buildbot/process/step.py (Git): added support for 'cogito' (aka 'git'), the new linux kernel VC system (http://kernel.org/git/). Thanks to Brandon Philips for the patch. * buildbot/slave/commands.py (Git): same Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- commands.py 3 May 2005 20:02:05 -0000 1.28 +++ commands.py 10 May 2005 08:10:53 -0000 1.29 @@ -811,6 +811,45 @@ registerSlaveCommand("darcs", Darcs, cvs_ver) +class Git(SourceBase): + """Git specific VC operation. In addition to the arguments + handled by SourceBase, this command reads the following keys: + + ['repourl'] (required): the Cogito repository string + """ + + header = "git operation" + + def setup(self, args): + SourceBase.setup(self, args) + self.repourl = args['repourl'] + + def sourcedirIsUpdateable(self): + if os.path.exists(os.path.join(self.builder.basedir, + self.srcdir, ".buildbot-patched")): + return False + return os.path.isdir(os.path.join(self.builder.basedir, + self.srcdir, ".git")) + + def doVCUpdate(self): + d = os.path.join(self.builder.basedir, self.srcdir) + command = ['cg-update'] + c = ShellCommand(self.builder, command, d, + sendRC=False, timeout=self.timeout) + self.command = c + return c.start() + + def doVCFull(self): + d = os.path.join(self.builder.basedir, self.srcdir) + os.mkdir(d) + command = ['cg-clone', self.repourl] + c = ShellCommand(self.builder, command, d, + sendRC=False, timeout=self.timeout) + self.command = c + return c.start() + +registerSlaveCommand("git", Git, cvs_ver) + class Arch(SourceBase): """Arch-specific (tla-specific) VC operation. In addition to the arguments handled by SourceBase, this command reads the following keys: From warner at users.sourceforge.net Tue May 10 08:10:55 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 10 May 2005 08:10:55 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.419,1.420 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31385 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-145 Creator: Brian Warner added 'cogito' support, patch from Brandon Philips * buildbot/process/step.py (Git): added support for 'cogito' (aka 'git'), the new linux kernel VC system (http://kernel.org/git/). Thanks to Brandon Philips for the patch. * buildbot/slave/commands.py (Git): same Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.419 retrieving revision 1.420 diff -u -d -r1.419 -r1.420 --- ChangeLog 6 May 2005 06:40:04 -0000 1.419 +++ ChangeLog 10 May 2005 08:10:52 -0000 1.420 @@ -1,3 +1,10 @@ +2005-05-10 Brian Warner + + * buildbot/process/step.py (Git): added support for 'cogito' (aka + 'git'), the new linux kernel VC system (http://kernel.org/git/). + Thanks to Brandon Philips for the patch. + * buildbot/slave/commands.py (Git): same + 2005-05-06 Brian Warner * buildbot/status/builder.py (OfflineLogFile): replace the default From warner at users.sourceforge.net Tue May 10 08:10:54 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 10 May 2005 08:10:54 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process step.py,1.64,1.65 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31385/buildbot/process Modified Files: step.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-145 Creator: Brian Warner added 'cogito' support, patch from Brandon Philips * buildbot/process/step.py (Git): added support for 'cogito' (aka 'git'), the new linux kernel VC system (http://kernel.org/git/). Thanks to Brandon Philips for the patch. * buildbot/slave/commands.py (Git): same Index: step.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step.py,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- step.py 3 May 2005 20:02:01 -0000 1.64 +++ step.py 10 May 2005 08:10:36 -0000 1.65 @@ -970,6 +970,7 @@ self.args['patch'] = patch self.startVC() + class CVS(Source): """I do CVS checkout/update operations. @@ -1104,7 +1105,6 @@ ShellCommand.start(self) - class SVN(Source): """I perform Subversion checkout/update operations.""" @@ -1162,6 +1162,7 @@ self.cmd = LoggedRemoteCommand("svn", self.args) ShellCommand.start(self, errorMessage) + class Darcs(Source): """Check out a source tree from a Darcs repository at 'repourl'. @@ -1190,6 +1191,27 @@ self.cmd = LoggedRemoteCommand("darcs", self.args) ShellCommand.start(self) + +class Git(Source): + """Check out a source tree from a git repository 'repourl'.""" + + name = "git" + + def __init__(self, repourl, **kwargs): + """ + @type repourl: string + @param repourl: the URL which points at the git repository + """ + Source.__init__(self, **kwargs) + self.args['repourl'] = repourl + + def startVC(self): + slavever = self.slaveVersion("git") + assert slavever, "slave is too old, does not know about git" + self.cmd = LoggedRemoteCommand("git", self.args) + ShellCommand.start(self) + + class Arch(Source): """Check out a source tree from an Arch repository named 'archive' available at 'url'. 'version' specifies which version number (development From warner at users.sourceforge.net Tue May 10 19:32:10 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 10 May 2005 19:32:10 +0000 Subject: [Buildbot-commits] buildbot setup.py,1.32,1.33 MANIFEST.in,1.17,1.18 ChangeLog,1.420,1.421 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1231 Modified Files: setup.py MANIFEST.in ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-147 Creator: Brian Warner don't reference the recently-deleted plugins.tml * MANIFEST.in: we deleted plugins.tml, so stop shipping it * setup.py: .. and stop trying to install it Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.420 retrieving revision 1.421 diff -u -d -r1.420 -r1.421 --- ChangeLog 10 May 2005 08:10:52 -0000 1.420 +++ ChangeLog 10 May 2005 19:32:07 -0000 1.421 @@ -1,5 +1,8 @@ 2005-05-10 Brian Warner + * MANIFEST.in: we deleted plugins.tml, so stop shipping it + * setup.py: .. and stop trying to install it + * buildbot/process/step.py (Git): added support for 'cogito' (aka 'git'), the new linux kernel VC system (http://kernel.org/git/). Thanks to Brandon Philips for the patch. Index: MANIFEST.in =================================================================== RCS file: /cvsroot/buildbot/buildbot/MANIFEST.in,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- MANIFEST.in 28 Apr 2005 07:57:28 -0000 1.17 +++ MANIFEST.in 10 May 2005 19:32:07 -0000 1.18 @@ -6,7 +6,6 @@ include docs/examples/*.cfg include docs/*.xhtml docs/*.css docs/*.tpl include docs/epyrun docs/gen-reference -include buildbot/plugins.tml include buildbot/test/mail/* buildbot/test/subdir/* include buildbot/scripts/sample.cfg buildbot/scripts/sample.mk include buildbot/status/classic.css Index: setup.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/setup.py,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- setup.py 26 Apr 2005 02:43:12 -0000 1.32 +++ setup.py 10 May 2005 19:32:04 -0000 1.33 @@ -52,8 +52,7 @@ "buildbot.slave", "buildbot.scripts", "buildbot.test"], - data_files=[("buildbot", ["buildbot/plugins.tml", - "buildbot/buildbot.png"]), + data_files=[("buildbot", ["buildbot/buildbot.png"]), ("buildbot/status", ["buildbot/status/classic.css"]), ("buildbot/scripts", ["buildbot/scripts/sample.cfg", "buildbot/scripts/sample.mk"]),], From warner at users.sourceforge.net Tue May 10 22:22:39 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 10 May 2005 22:22:39 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.19,1.20 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9505/buildbot/scripts Modified Files: runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-149 Creator: Brian Warner make 'buildbot start' handle twisted-1.3.0 on windows * buildbot/scripts/runner.py (start): Twisted-1.3.0 used a different name for the internal twistw module, handle it. Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- runner.py 6 May 2005 05:01:11 -0000 1.19 +++ runner.py 10 May 2005 22:22:33 -0000 1.20 @@ -273,9 +273,13 @@ argv.append("--reactor=win32") sys.argv = argv - # this is copied from bin/twistd + # this is copied from bin/twistd. twisted-1.3.0 uses twistw, while + # twisted-2.0.0 uses _twistw. if platformType == "win32": - from twisted.scripts._twistw import run + try: + from twisted.scripts._twistw import run + except ImportError: + from twisted.scripts.twistw import run else: from twisted.scripts.twistd import run run() From warner at users.sourceforge.net Tue May 10 22:22:40 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 10 May 2005 22:22:40 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.421,1.422 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9505 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-149 Creator: Brian Warner make 'buildbot start' handle twisted-1.3.0 on windows * buildbot/scripts/runner.py (start): Twisted-1.3.0 used a different name for the internal twistw module, handle it. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.421 retrieving revision 1.422 diff -u -d -r1.421 -r1.422 --- ChangeLog 10 May 2005 19:32:07 -0000 1.421 +++ ChangeLog 10 May 2005 22:22:37 -0000 1.422 @@ -1,5 +1,8 @@ 2005-05-10 Brian Warner + * buildbot/scripts/runner.py (start): Twisted-1.3.0 used a + different name for the internal twistw module, handle it. + * MANIFEST.in: we deleted plugins.tml, so stop shipping it * setup.py: .. and stop trying to install it From warner at users.sourceforge.net Wed May 11 23:25:28 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 11 May 2005 23:25:28 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts sample.cfg,1.4,1.5 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17958/buildbot/scripts Modified Files: sample.cfg Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-151 Creator: Brian Warner move all *.xhtml docs to buildbot.texinfo * docs/buildbot.texinfo: move all .xhtml docs into a new .texinfo-format document, adding a lot of material in the process. This is starting to look like a real user's manual. Removed all the Lore-related files: *.xhtml, *.css, template.tpl . * docs/Makefile: simple makefile to run 'makeinfo' * buildbot/scripts/sample.cfg: rearrange slightly * MANIFEST.in: include .info and .textinfo, don't include *.xhtml Index: sample.cfg =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/sample.cfg,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- sample.cfg 3 May 2005 04:59:47 -0000 1.4 +++ sample.cfg 11 May 2005 23:25:25 -0000 1.5 @@ -1,4 +1,3 @@ -#! /usr/bin/python # This is a sample buildmaster config file. It must be installed as # 'master.cfg' in your buildmaster's base directory (although the filename @@ -14,8 +13,9 @@ from buildbot.status import html s = factory.s -# to save typing, we create a dictionary named 'c' and rename it later -c = {} +# This is the dictionary that the buildmaster pays attention to. We also use +# a shorter alias to save typing. +c = BuildmasterConfig = {} # the 'bots' list defines the set of allowable buildslaves. Each element is a # tuple of bot-name and bot-password. These correspond to values given to the @@ -129,8 +129,3 @@ # without some help. c['buildbotURL'] = "http://localhost:8010/" - -# finally we define the name that the buildmaster has been waiting for. - -BuildmasterConfig = c - From warner at users.sourceforge.net Wed May 11 23:25:27 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 11 May 2005 23:25:27 +0000 Subject: [Buildbot-commits] buildbot MANIFEST.in,1.18,1.19 ChangeLog,1.422,1.423 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17958 Modified Files: MANIFEST.in ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-151 Creator: Brian Warner move all *.xhtml docs to buildbot.texinfo * docs/buildbot.texinfo: move all .xhtml docs into a new .texinfo-format document, adding a lot of material in the process. This is starting to look like a real user's manual. Removed all the Lore-related files: *.xhtml, *.css, template.tpl . * docs/Makefile: simple makefile to run 'makeinfo' * buildbot/scripts/sample.cfg: rearrange slightly * MANIFEST.in: include .info and .textinfo, don't include *.xhtml Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.422 retrieving revision 1.423 diff -u -d -r1.422 -r1.423 --- ChangeLog 10 May 2005 22:22:37 -0000 1.422 +++ ChangeLog 11 May 2005 23:25:25 -0000 1.423 @@ -1,3 +1,13 @@ +2005-05-11 Brian Warner + + * docs/buildbot.texinfo: move all .xhtml docs into a new + .texinfo-format document, adding a lot of material in the process. + This is starting to look like a real user's manual. Removed all + the Lore-related files: *.xhtml, *.css, template.tpl . + * docs/Makefile: simple makefile to run 'makeinfo' + * buildbot/scripts/sample.cfg: rearrange slightly + * MANIFEST.in: include .info and .textinfo, don't include *.xhtml + 2005-05-10 Brian Warner * buildbot/scripts/runner.py (start): Twisted-1.3.0 used a Index: MANIFEST.in =================================================================== RCS file: /cvsroot/buildbot/buildbot/MANIFEST.in,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- MANIFEST.in 10 May 2005 19:32:07 -0000 1.18 +++ MANIFEST.in 11 May 2005 23:25:25 -0000 1.19 @@ -4,7 +4,7 @@ include docs/PyCon-2003/overview.png docs/PyCon-2003/slave.png include docs/PyCon-2003/waterfall.png include docs/examples/*.cfg -include docs/*.xhtml docs/*.css docs/*.tpl +include docs/buildbot.texinfo docs/buildbot.info include docs/epyrun docs/gen-reference include buildbot/test/mail/* buildbot/test/subdir/* include buildbot/scripts/sample.cfg buildbot/scripts/sample.mk From warner at users.sourceforge.net Wed May 11 23:25:27 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 11 May 2005 23:25:27 +0000 Subject: [Buildbot-commits] buildbot/docs Makefile,NONE,1.1 buildbot.texinfo,NONE,1.1 .arch-inventory,1.1,1.2 steps.xhtml,1.7,NONE source.xhtml,1.5,NONE config.xhtml,1.8,NONE changes.xhtml,1.2,NONE template.tpl,1.1,NONE stylesheet.css,1.1,NONE factories.xhtml,1.6,NONE users.xhtml,1.2,NONE slave.xhtml,1.2,NONE stylesheet-unprocessed.css,1.1,NONE Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17958/docs Modified Files: .arch-inventory Added Files: Makefile buildbot.texinfo Removed Files: steps.xhtml source.xhtml config.xhtml changes.xhtml template.tpl stylesheet.css factories.xhtml users.xhtml slave.xhtml stylesheet-unprocessed.css Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-151 Creator: Brian Warner move all *.xhtml docs to buildbot.texinfo * docs/buildbot.texinfo: move all .xhtml docs into a new .texinfo-format document, adding a lot of material in the process. This is starting to look like a real user's manual. Removed all the Lore-related files: *.xhtml, *.css, template.tpl . * docs/Makefile: simple makefile to run 'makeinfo' * buildbot/scripts/sample.cfg: rearrange slightly * MANIFEST.in: include .info and .textinfo, don't include *.xhtml Index: .arch-inventory =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/.arch-inventory,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- .arch-inventory 22 Apr 2005 21:29:18 -0000 1.1 +++ .arch-inventory 11 May 2005 23:25:25 -0000 1.2 @@ -1 +1,2 @@ junk ^reference$ +precious \.info$ --- NEW FILE: Makefile --- buildbot.info: buildbot.texinfo makeinfo --fill-column=70 $< --- NEW FILE: buildbot.texinfo --- \input texinfo @c -*-texinfo-*- @c %**start of header @setfilename buildbot.info @settitle BuildBot Manual 1.0 @c %**end of header @copying This is the BuildBot manual. Copyright (C) 2005 Brian Warner Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. @end copying @titlepage @title BuildBot [...2699 lines suppressed...] @code{buildbot.status.client.PBListener(port=int, user=str, passwd=str)} This sets up a PB listener on the given TCP port, to which a PB-based status client can connect and retrieve status information. @code{buildbot statusgui} is an example of such a status client. @node Resources, Index, Status Delivery, Top @chapter Resources @node Index, , Resources, Top @unnumbered Index @printindex cp @bye --- changes.xhtml DELETED --- --- config.xhtml DELETED --- --- factories.xhtml DELETED --- --- slave.xhtml DELETED --- --- source.xhtml DELETED --- --- steps.xhtml DELETED --- --- stylesheet-unprocessed.css DELETED --- --- stylesheet.css DELETED --- --- template.tpl DELETED --- --- users.xhtml DELETED --- From warner at users.sourceforge.net Wed May 11 23:30:17 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 11 May 2005 23:30:17 +0000 Subject: [Buildbot-commits] buildbot setup.py,1.33,1.34 ChangeLog,1.423,1.424 Makefile,1.7,1.8 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18396 Modified Files: setup.py ChangeLog Makefile Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-154 Creator: Brian Warner make sure debug.glade gets installed properly * setup.py: oops, install debug.glade so 'buildbot debugclient' will actually work * Makefile: update the deb-snapshot version Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.423 retrieving revision 1.424 diff -u -d -r1.423 -r1.424 --- ChangeLog 11 May 2005 23:25:25 -0000 1.423 +++ ChangeLog 11 May 2005 23:30:15 -0000 1.424 @@ -1,5 +1,9 @@ 2005-05-11 Brian Warner + * setup.py: oops, install debug.glade so 'buildbot debugclient' + will actually work + * Makefile: update the deb-snapshot version + * docs/buildbot.texinfo: move all .xhtml docs into a new .texinfo-format document, adding a lot of material in the process. This is starting to look like a real user's manual. Removed all Index: Makefile =================================================================== RCS file: /cvsroot/buildbot/buildbot/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile 26 Apr 2005 18:36:53 -0000 1.7 +++ Makefile 11 May 2005 23:30:15 -0000 1.8 @@ -22,7 +22,7 @@ #debuild -uc -us deb-snapshot: - debchange --newversion 0.6.3.snapshot.`date +%Y.%m.%d.%H.%M.%S` \ + debchange --newversion 0.6.4.snapshot.`date +%Y.%m.%d.%H.%M.%S` \ "snapshot build" debuild binary Index: setup.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/setup.py,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- setup.py 10 May 2005 19:32:04 -0000 1.33 +++ setup.py 11 May 2005 23:30:15 -0000 1.34 @@ -53,6 +53,7 @@ "buildbot.scripts", "buildbot.test"], data_files=[("buildbot", ["buildbot/buildbot.png"]), + ("buildbot/clients", ["buildbot/clients/debug.glade"]), ("buildbot/status", ["buildbot/status/classic.css"]), ("buildbot/scripts", ["buildbot/scripts/sample.cfg", "buildbot/scripts/sample.mk"]),], From warner at users.sourceforge.net Thu May 12 07:26:26 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 12 May 2005 07:26:26 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.424,1.425 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19353 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-156 Creator: Brian Warner Update Git, improve ShellCommand log messages * buildbot/slave/commands.py (ShellCommand._startCommand): update log messages to include more useful copies of the command being run, the argv array, and the child command's environment. (Git.doVCFull): update cg-close usage, patch from Brandon Philips. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.424 retrieving revision 1.425 diff -u -d -r1.424 -r1.425 --- ChangeLog 11 May 2005 23:30:15 -0000 1.424 +++ ChangeLog 12 May 2005 07:26:23 -0000 1.425 @@ -1,3 +1,10 @@ +2005-05-12 Brian Warner + + * buildbot/slave/commands.py (ShellCommand._startCommand): update + log messages to include more useful copies of the command being + run, the argv array, and the child command's environment. + (Git.doVCFull): update cg-close usage, patch from Brandon Philips. + 2005-05-11 Brian Warner * setup.py: oops, install debug.glade so 'buildbot debugclient' From warner at users.sourceforge.net Thu May 12 07:26:26 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 12 May 2005 07:26:26 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.29,1.30 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19353/buildbot/slave Modified Files: commands.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-156 Creator: Brian Warner Update Git, improve ShellCommand log messages * buildbot/slave/commands.py (ShellCommand._startCommand): update log messages to include more useful copies of the command being run, the argv array, and the child command's environment. (Git.doVCFull): update cg-close usage, patch from Brandon Philips. Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- commands.py 10 May 2005 08:10:53 -0000 1.29 +++ commands.py 12 May 2005 07:26:24 -0000 1.30 @@ -143,13 +143,10 @@ return self.deferred def _startCommand(self): - msg = "command '%s' in dir %s" % (self.command, self.workdir) - if self.timeout: - msg += " (timeout %d secs)" % self.timeout - log.msg(" " + msg) - self.sendStatus({'header': msg+"\n"}) - log.msg(" env is: %s" % self.environ) + log.msg("ShellCommand._startCommand") if self.notreally: + self.sendStatus({'header': "command '%s' in dir %s" % \ + (self.command, self.workdir)}) self.sendStatus({'header': "(not really)\n"}) self.finished(None, 0) return @@ -171,6 +168,31 @@ # self.stdin is handled in ShellCommandPP.connectionMade + # first header line is the command in plain text, argv joined with + # spaces. You should be able to cut-and-paste this into a shell to + # obtain the same results. If there are spaces in the arguments, too + # bad. + msg = " ".join(argv) + log.msg(" " + msg) + self.sendStatus({'header': msg+"\n"}) + + # then comes the secondary information + msg = "in dir %s" % (self.workdir,) + if self.timeout: + msg += " (timeout %d secs)" % (self.timeout,) + log.msg(" " + msg) + self.sendStatus({'header': msg+"\n"}) + + # then the argv array for resolving unambiguity + msg = "argv: %s" % (argv,) + log.msg(" " + msg) + self.sendStatus({'header': msg+"\n"}) + + # then the environment, since it sometimes causes problems + msg = "environment: %s" % (self.environ,) + log.msg(" " + msg) + self.sendStatus({'header': msg+"\n"}) + self.process = reactor.spawnProcess(self.pp, argv[0], argv, self.environ, self.workdir, @@ -842,7 +864,7 @@ def doVCFull(self): d = os.path.join(self.builder.basedir, self.srcdir) os.mkdir(d) - command = ['cg-clone', self.repourl] + command = ['cg-clone', '-s', self.repourl] c = ShellCommand(self.builder, command, d, sendRC=False, timeout=self.timeout) self.command = c From warner at users.sourceforge.net Thu May 12 20:09:35 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 12 May 2005 20:09:35 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_slavecommand.py,1.12,1.13 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25954/buildbot/test Modified Files: test_slavecommand.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-158 Creator: Brian Warner improve error message in test_slavecommand.Shell.testShellZ * buildbot/test/test_slavecommand.py (Shell.testShellZ): log a better message on failure so I can figure out the win32 problem Index: test_slavecommand.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_slavecommand.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- test_slavecommand.py 26 Apr 2005 18:45:53 -0000 1.12 +++ test_slavecommand.py 12 May 2005 20:09:26 -0000 1.13 @@ -181,7 +181,9 @@ got = self.getfile('stdout') + self.getfile('stderr') self.failUnless(re.search(r'no such file', got, re.I) # unix or re.search(r'cannot find the path specified', - got, re.I) # win32 + got, re.I), # win32 + "bogus command didn't create the expected error " + "message, got '%s'" % got ) # todo: interrupt(), kill process From warner at users.sourceforge.net Thu May 12 20:10:13 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 12 May 2005 20:10:13 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status html.py,1.60,1.61 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26118/buildbot/status Modified Files: html.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-159 Creator: Brian Warner buildbot.texinfo updates Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-15 Merged from arch at buildbot.sf.net--2004 (patch 147-151) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-16 Merged from arch at buildbot.sf.net--2004 (patch 152-155) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-17 Merged from arch at buildbot.sf.net--2004 (patch 156-158) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-18 more doc updates Index: html.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- html.py 4 May 2005 07:04:15 -0000 1.60 +++ html.py 12 May 2005 20:10:11 -0000 1.61 @@ -1421,9 +1421,7 @@ def __init__(self, http_port=None, distrib_port=None, allowForce=True, categories=None, css=buildbot_css, favicon=buildbot_icon): - """ - - xxxTo have the buildbot run its own web server, pass a port number to + """To have the buildbot run its own web server, pass a port number to C{http_port}. To have it run a web.distrib server @type http_port: int From warner at users.sourceforge.net Thu May 12 20:10:13 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 12 May 2005 20:10:13 +0000 Subject: [Buildbot-commits] buildbot/docs buildbot.texinfo,1.1,1.2 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26118/docs Modified Files: buildbot.texinfo Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-159 Creator: Brian Warner buildbot.texinfo updates Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-15 Merged from arch at buildbot.sf.net--2004 (patch 147-151) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-16 Merged from arch at buildbot.sf.net--2004 (patch 152-155) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-17 Merged from arch at buildbot.sf.net--2004 (patch 156-158) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-18 more doc updates Index: buildbot.texinfo =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/buildbot.texinfo,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- buildbot.texinfo 11 May 2005 23:25:25 -0000 1.1 +++ buildbot.texinfo 12 May 2005 20:10:11 -0000 1.2 @@ -2041,6 +2041,8 @@ @node CVS, SVN, Source Checkout, Source Checkout @subsubsection CVS + at cindex CVS Checkout + The @code{CVS} build step performs a CVS checkout or update. It takes the following arguments: @@ -2074,6 +2076,8 @@ @node SVN, Darcs, CVS, Source Checkout @subsubsection SVN + at cindex SVN Checkout + The @code{SVN} build step performs a Subversion checkout or update. It takes the following arguments. @@ -2095,6 +2099,8 @@ @node Darcs, Arch, SVN, Source Checkout @subsubsection Darcs + at cindex Darcs Checkout + The @code{Darcs} build step performs a @uref{http://abridgegame.org/darcs/, Darcs} checkout or update. It takes the following arguments: @@ -2108,6 +2114,8 @@ @node Arch, Bazaar, Darcs, Source Checkout @subsubsection Arch + at cindex Arch Checkout + The @code{Arch} build step performs an @uref{http://gnuarch.org/, Arch} checkout or update using the @code{tla} client. It takes the following arguments: @@ -2132,6 +2140,8 @@ @node Bazaar, P4Sync, Arch, Source Checkout @subsubsection Bazaar + at cindex Bazaar Checkout + @code{Bazaar} is an alternate implementation of the Arch VC system, which uses a client named @code{baz}. The checkout semantics are just different enough from @code{tla} that there is a separate BuildStep for @@ -2146,6 +2156,8 @@ @node P4Sync, , Bazaar, Source Checkout @subsubsection P4Sync + at cindex Perforce Update + The @code{P4Sync} build step performs a @uref{http://www.perforce.com/, Perforce} update. It is a temporary facility: a more complete P4 checkout step (named @code{P4}) will @@ -2685,38 +2697,110 @@ @node HTML Waterfall, IRC Bot, Status Delivery, Status Delivery @subsection HTML Waterfall -This creates an HTML ``waterfall display'', which shows a time-based -chart of events. This display provides detailed information about all -steps of all recent builds, and provides hyperlinks to look at -individual build logs and source changes. If the @code{http_port} -argument is provided, it represents the TCP port number on which the -web server should listen. If instead @code{distrib_port} is provided, -a twisted.web distributed server will be started either on a TCP port -(if @code{distrib_port} is an int) or more likely on a UNIX socket (if + at cindex Waterfall + + at example +from buildbot.status import html +w = html.Waterfall(http_port=8080) +c['status'].append(w) + at end example + +The @code{buildbot.status.html.Waterfall} status target creates an +HTML ``waterfall display'', which shows a time-based chart of events. +This display provides detailed information about all steps of all +recent builds, and provides hyperlinks to look at individual build +logs and source changes. If the @code{http_port} argument is provided, +it represents the TCP port number on which the web server should +listen. If instead @code{distrib_port} is provided, a twisted.web +distributed server will be started either on a TCP port (if + at code{distrib_port} is an int) or more likely on a UNIX socket (if @code{distrib_port} is a string). The HTML page can have a favicon and custom CSS: see the docstring for details. -The @code{webPathname} option means that, on a host with a +The @code{distrib_port} option means that, on a host with a suitably-configured twisted-web server, you do not need to consume a separate TCP port for the buildmaster's status web page. When the web server is constructed with @code{mktap web --user}, URLs that point to @code{http://host/~username/} are dispatched to a sub-server that is listening on a UNIX socket at @code{~username/.twisted-web-pb}. On such a system, it is convenient to create a dedicated @code{buildbot} -user, then set @code{webPathname} to +user, then set @code{distrib_port} to @code{os.path.expanduser("~/.twistd-web-pb")}. This configuration will make the HTML status page available at @code{http://host/~buildbot/}. +Suitable URL remapping can make it appear at + at code{http://host/buildbot/}, and the right virtual host setup can +even place it at @code{http://buildbot.host/}. @node IRC Bot, PBListener, HTML Waterfall, Status Delivery @subsection IRC Bot -This creates an IRC bot which will attach to the given channel(s) and be -available for status queries. It can also be asked to announce builds as -they occur, or be told to shut up. + at cindex IRC + +The @code{buildbot.status.words.IRC} status target creates an IRC bot +which will attach to certain channels and be available for status +queries. It can also be asked to announce builds as they occur, or be +told to shut up. + + at example +from twisted.status import words +irc = words.IRC("irc.example.org", "botnickname", + channels=["channel1", "channel2"]) +c['status'].append(irc) + at end example + +Take a look at the docstring for @code{words.IRC} for more details on +configuring this service. + +To use the service, you address messages at the buildbot, either +normally (@code{botnickname: status}) or with private messages +(@code{/msg botnickname status}). The buildbot will respond in kind. + +Some of the commands currently available: + + at table @code + + at item list builders +Emit a list of all configured builders + at item status BUILDER +Announce the status of a specific Builder: what it is doing right now. + at item status all +Announce the status of all Builders + at item watch BUILDER +If the given Builder is currently running, wait until the Build is +finished and then announce the results. + at item last BUILDER +Return the results of the last build to run on the given Builder. + + at item help COMMAND +Describe a command. Use @code{help commands} to get a list of known +commands. + at item source +Announce the URL of the Buildbot's home page. + at item version +Announce the version of this Buildbot. + at end table + +If the @code{allowForce=True} option was used, some addtional commands +will be available: + + at table @code + at item force build BUILDER REASON +Tell the given Builder to start a build of the latest code. The user +requesting the build and REASON are recorded in the Build status. The +buildbot will announce the build's status when it finishes. + + at item stop build BUILDER REASON +Terminate any running build in the given Builder. REASON will be added +to the build status to explain why it was stopped. You might use this +if you committed a bug, corrected it right away, and don't want to +wait for the first build (which is destined to fail) to complete +before starting the second (hopefully fixed) build. + at end table @node PBListener, , IRC Bot, Status Delivery @subsection PBListener + at cindex PBListener @code{buildbot.status.client.PBListener(port=int, user=str, passwd=str)} @@ -2728,6 +2812,13 @@ @node Resources, Index, Status Delivery, Top @chapter Resources +The Buildbot's home page is at @uref{http://buildbot.sourceforge.net/} + +For configuration questions and general discussion, please use the + at code{buildbot-devel} mailing list. The subscription instructions and +archives are available at + at uref{http://lists.sourceforge.net/lists/listinfo/buildbot-devel} + @node Index, , Resources, Top @unnumbered Index From warner at users.sourceforge.net Thu May 12 20:09:28 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 12 May 2005 20:09:28 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.425,1.426 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25954 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-158 Creator: Brian Warner improve error message in test_slavecommand.Shell.testShellZ * buildbot/test/test_slavecommand.py (Shell.testShellZ): log a better message on failure so I can figure out the win32 problem Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.425 retrieving revision 1.426 diff -u -d -r1.425 -r1.426 --- ChangeLog 12 May 2005 07:26:23 -0000 1.425 +++ ChangeLog 12 May 2005 20:09:22 -0000 1.426 @@ -1,5 +1,8 @@ 2005-05-12 Brian Warner + * buildbot/test/test_slavecommand.py (Shell.testShellZ): log a + better message on failure so I can figure out the win32 problem + * buildbot/slave/commands.py (ShellCommand._startCommand): update log messages to include more useful copies of the command being run, the argv array, and the child command's environment. From warner at users.sourceforge.net Thu May 12 20:55:17 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 12 May 2005 20:55:17 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.20,1.21 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3719/buildbot/scripts Modified Files: runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-161 Creator: Brian Warner add --logfile=twistd.log to 'buildbot start', for windows Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- runner.py 10 May 2005 22:22:33 -0000 1.20 +++ runner.py 12 May 2005 20:55:14 -0000 1.21 @@ -268,7 +268,10 @@ # spawn twistd, since spawning processes correctly is a real hassle # on windows. from twisted.python.runtime import platformType - argv = ["twistd", "--no_save", "--python=buildbot.tac"] + argv = ["twistd", + "--no_save", + "--logfile=twistd.log", # windows doesn't use the same default + "--python=buildbot.tac"] if platformType == "win32": argv.append("--reactor=win32") sys.argv = argv From warner at users.sourceforge.net Thu May 12 20:55:17 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 12 May 2005 20:55:17 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.426,1.427 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3719 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-161 Creator: Brian Warner add --logfile=twistd.log to 'buildbot start', for windows Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.426 retrieving revision 1.427 diff -u -d -r1.426 -r1.427 --- ChangeLog 12 May 2005 20:09:22 -0000 1.426 +++ ChangeLog 12 May 2005 20:55:15 -0000 1.427 @@ -1,5 +1,8 @@ 2005-05-12 Brian Warner + * buildbot/scripts/runner.py (start): add --logfile=twistd.log, since + apparently windows defaults to using stdout + * buildbot/test/test_slavecommand.py (Shell.testShellZ): log a better message on failure so I can figure out the win32 problem From warner at users.sourceforge.net Thu May 12 21:16:51 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 12 May 2005 21:16:51 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_web.py,1.13,1.14 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7726/buildbot/test Modified Files: test_web.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-163 Creator: Brian Warner add (failing) test: html.Waterfall hates OfflineLogFile * buildbot/test/test_web.py (WebTest.test_logfile): Add a test to point out that OfflineLogFile does not currently work with html.Waterfall . Fixing this is high-priority. Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- test_web.py 4 May 2005 07:04:17 -0000 1.13 +++ test_web.py 12 May 2005 21:16:49 -0000 1.14 @@ -12,8 +12,9 @@ from twisted.web import client from buildbot import master, interfaces -from buildbot.status import html +from buildbot.status import html, builder from buildbot.changes.changes import Change +from buildbot.process import step, base class ConfiguredMaster(master.BuildMaster): """This BuildMaster variant has a static config file, provided as a @@ -207,3 +208,50 @@ "my-maildir", changes) dr(m.stopService()) + + def test_logfile(self): + config = """ +from buildbot.status import html +from buildbot.process.factory import BasicBuildFactory +f1 = BasicBuildFactory('cvsroot', 'cvsmodule') +BuildmasterConfig = { + 'bots': [('bot1', 'passwd1')], + 'sources': [], + 'builders': [{'name': 'builder1', 'slavename': 'bot1', + 'builddir':'workdir', 'factory':f1}], + 'slavePortnum': 0, + 'status': [html.Waterfall(http_port=0)], + } +""" + os.mkdir("test_web5") + m = ConfiguredMaster("test_web5", config) + m.startService() + # hack to find out what randomly-assigned port it is listening on + port = list(self.find_waterfall(m)[0])[0]._port.getHost().port + # insert an event + + s = m.status.getBuilder("builder1") + bs = s.newBuild() + build1 = base.Build() + step1 = step.BuildStep(build=build1) + step1.name = "setup" + bs.addStep(step1) + bs.buildStarted(build1) + step1.step_status.stepStarted() + loog = step1.addLog("output") + loog.addStdout("some stdout\n") + loog.finish() + step1.step_status.stepFinished(builder.SUCCESS) + bs.buildFinished() + + d = client.getPage("http://localhost:%d/" % port) + page = dr(d) + self.failUnless(page) + + logurl = "http://localhost:%d/builder1/builds/0/setup/0" % port + d = client.getPage(logurl) + logbody = dr(d) + self.failUnless(logbody) + d = client.getPage(logurl + "/text") + logtext = dr(d) + self.failUnlessEqual(logtext, "some stdout\n") From warner at users.sourceforge.net Thu May 12 21:16:51 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 12 May 2005 21:16:51 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.427,1.428 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7726 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-163 Creator: Brian Warner add (failing) test: html.Waterfall hates OfflineLogFile * buildbot/test/test_web.py (WebTest.test_logfile): Add a test to point out that OfflineLogFile does not currently work with html.Waterfall . Fixing this is high-priority. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.427 retrieving revision 1.428 diff -u -d -r1.427 -r1.428 --- ChangeLog 12 May 2005 20:55:15 -0000 1.427 +++ ChangeLog 12 May 2005 21:16:49 -0000 1.428 @@ -1,5 +1,9 @@ 2005-05-12 Brian Warner + * buildbot/test/test_web.py (WebTest.test_logfile): Add a test to + point out that OfflineLogFile does not currently work with + html.Waterfall . Fixing this is high-priority. + * buildbot/scripts/runner.py (start): add --logfile=twistd.log, since apparently windows defaults to using stdout From warner at users.sourceforge.net Thu May 12 21:55:59 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 12 May 2005 21:55:59 +0000 Subject: [Buildbot-commits] buildbot/buildbot interfaces.py,1.24,1.25 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15619/buildbot Modified Files: interfaces.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-165 Creator: Brian Warner fix OfflineLogFile to work with html.Waterfall * buildbot/status/builder.py (OfflineLogFile.getChunks): have this method generate chunks instead of returning a big list. This allows the same method to be used for both old LogFile and new OfflineLogFile. (OfflineLogFile.getText): use the generator (OfflineLogFile.subscribe): same * buildbot/status/html.py (TextLog.resumeProducing): same * buildbot/interfaces.py (IStatusLog.getChunks): document it Index: interfaces.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/interfaces.py,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- interfaces.py 24 Apr 2005 21:30:23 -0000 1.24 +++ interfaces.py 12 May 2005 21:55:57 -0000 1.25 @@ -493,8 +493,8 @@ all chunks (including headers) together.""" def getChunks(): - """Return a list of (channel, text) tuples. 'channel' is a number, 0 - for stdout, 1 for stderr, 2 for header. (note that stderr is merged + """Generate a list of (channel, text) tuples. 'channel' is a number, + 0 for stdout, 1 for stderr, 2 for header. (note that stderr is merged into stdout if PTYs are in use).""" From warner at users.sourceforge.net Thu May 12 21:56:00 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 12 May 2005 21:56:00 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status html.py,1.61,1.62 builder.py,1.53,1.54 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15619/buildbot/status Modified Files: html.py builder.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-165 Creator: Brian Warner fix OfflineLogFile to work with html.Waterfall * buildbot/status/builder.py (OfflineLogFile.getChunks): have this method generate chunks instead of returning a big list. This allows the same method to be used for both old LogFile and new OfflineLogFile. (OfflineLogFile.getText): use the generator (OfflineLogFile.subscribe): same * buildbot/status/html.py (TextLog.resumeProducing): same * buildbot/interfaces.py (IStatusLog.getChunks): document it Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- builder.py 6 May 2005 06:40:05 -0000 1.53 +++ builder.py 12 May 2005 21:55:57 -0000 1.54 @@ -118,7 +118,7 @@ return self.watchers.append(receiver) if catchup: - for channel, text in self.entries + self.runEntries: + for channel, text in self.getChunks(): # TODO: add logChunks(), to send over everything at once? receiver.logChunk(self.step.build, self.step, self, channel, text) @@ -202,13 +202,13 @@ self.finished = True class OfflineLogFileScanner(basic.NetstringReceiver): - def __init__(self, line_cb, channels=[]): - self.line_cb = line_cb + def __init__(self, chunk_cb, channels=[]): + self.chunk_cb = chunk_cb self.channels = channels def stringReceived(self, line): channel = int(line[0]) if not self.channels or (channel in self.channels): - self.line_cb(channel, line[1:]) + self.chunk_cb((channel, line[1:])) class OfflineLogFile(LogFile): """An OfflineLogFile keeps all of its contents on disk, in a non-pickle @@ -235,44 +235,51 @@ self.openfile = f return self.openfile - def scanEntries(self, cb, channels=[]): + def getChunks(self, channels=[], onlyText=False): if self.openfile: # we must close it so we can read it properly. It will be opened # again the next time we try to write to it. self.openfile.close() self.openfile = None f = open(self.step.build.getLogfileNamed(self.filename), "r") - p = OfflineLogFileScanner(cb, channels) + chunks = [] + p = OfflineLogFileScanner(chunks.append, channels) + # TODO: if merge() is called while we're paused, we might miss some + # data. data = f.read(2000) while data: p.dataReceived(data) + for c in chunks: + if onlyText: + yield c[1] + else: + yield c + chunks = [] data = f.read(2000) f.close() + # TODO: if merge() is called while we're paused, we'll lose some data for channel, text in self.runEntries: if not channels or (channel in channels): - cb(channel, text) + if onlyText: + yield text + else: + yield (channel, text) def getText(self): # this produces one ginormous string - chunks = [] - self.scanEntries(lambda channel,chunk: chunks.append(chunk), - (STDOUT, STDERR)) - return "".join(chunks) + return "".join(self.getChunks([STDOUT, STDERR], onlyText=True)) def getTextWithHeaders(self): - chunks = [] - self.scanEntries(lambda channel,chunk: chunks.append(chunk)) - return "".join(chunks) + return "".join(self.getChunks(onlyText=True)) def subscribe(self, receiver, catchup): if self.finished: return self.watchers.append(receiver) if catchup: - self.scanEntries(lambda channel,chunk: - receiver.logChunk(self.step.build, - self.step, self, - channel, chunk)) + for channel,chunk in self.getChunks(): + receiver.logChunk(self.step.build, self.step, self, + channel, chunk) def merge(self): # merge all .runEntries (which are all of the same type) into a Index: html.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- html.py 12 May 2005 20:10:11 -0000 1.61 +++ html.py 12 May 2005 21:55:57 -0000 1.62 @@ -533,6 +533,7 @@ # it, so we can afford to track the request in the Resource. __implements__ = IHTMLLog, asText = False + subscribed = False def __init__(self, original): Resource.__init__(self) @@ -583,20 +584,16 @@ return '' def resumeProducing(self): - while self.chunkNumber < len(self.original.entries): - chunk = self.original.entries[self.chunkNumber] - self.chunkNumber += 1 + try: + chunk = self.chunkGenerator.next() data = self.content([chunk]) if data: self.req.write(data) - return - # TODO: I've seen this double-print a line - # now send all of .runEntries in a batch - data = self.content(self.original.runEntries) - if data: - self.req.write(data) + return + except StopIteration: + pass self.req.unregisterProducer() - # then see if there is more to come + # now subscribe to anything that might happen later self.original.subscribe(self, False) self.subscribed = True d = self.original.waitUntilFinished() @@ -622,8 +619,7 @@ if not self.asText: req.write(self.htmlHeader(req)) - self.chunkNumber = 0 - self.subscribed = False + self.chunkGenerator = self.original.getChunks() req.registerProducer(self, False) d = req.notifyFinish() d.addErrback(self.stop) From warner at users.sourceforge.net Thu May 12 21:56:00 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 12 May 2005 21:56:00 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.428,1.429 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15619 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-165 Creator: Brian Warner fix OfflineLogFile to work with html.Waterfall * buildbot/status/builder.py (OfflineLogFile.getChunks): have this method generate chunks instead of returning a big list. This allows the same method to be used for both old LogFile and new OfflineLogFile. (OfflineLogFile.getText): use the generator (OfflineLogFile.subscribe): same * buildbot/status/html.py (TextLog.resumeProducing): same * buildbot/interfaces.py (IStatusLog.getChunks): document it Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.428 retrieving revision 1.429 diff -u -d -r1.428 -r1.429 --- ChangeLog 12 May 2005 21:16:49 -0000 1.428 +++ ChangeLog 12 May 2005 21:55:58 -0000 1.429 @@ -1,5 +1,14 @@ 2005-05-12 Brian Warner + * buildbot/status/builder.py (OfflineLogFile.getChunks): have this + method generate chunks instead of returning a big list. This + allows the same method to be used for both old LogFile and new + OfflineLogFile. + (OfflineLogFile.getText): use the generator + (OfflineLogFile.subscribe): same + * buildbot/status/html.py (TextLog.resumeProducing): same + * buildbot/interfaces.py (IStatusLog.getChunks): document it + * buildbot/test/test_web.py (WebTest.test_logfile): Add a test to point out that OfflineLogFile does not currently work with html.Waterfall . Fixing this is high-priority. From warner at users.sourceforge.net Fri May 13 20:28:13 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 13 May 2005 20:28:13 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.30,1.31 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31279/buildbot/slave Modified Files: commands.py Log Message: (rmdirRecursive): replacement for shutil.rmtree which behaves correctly on windows in the face of files that you have to chmod before deleting. Thanks to Bear at the OSAF for the routine. (SourceBase.doClobber): use rmdirRecursive Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- commands.py 12 May 2005 07:26:24 -0000 1.30 +++ commands.py 13 May 2005 20:28:11 -0000 1.31 @@ -29,6 +29,27 @@ def __repr__(self): return "" % self.args[0] +def rmdirRecursive(dir): + """This is a replacement for shutil.rmtree that works better under + windows. Thanks to Bear at the OSAF for the code.""" + if os.path.islink(dir): + os.remove(dir) + return + + for name in os.listdir(dir): + full_name = os.path.join(dir, name) + # on Windows, if we don't have write permission we can't remove + # the file/directory either, so turn that on + if os.name == 'nt': + if not os.access(full_name, os.W_OK): + os.chmod(full_name, 0600) + if os.path.isdir(full_name): + rmdirRecursive(full_name) + else: + # print "removing file", full_name + os.remove(full_name) + os.rmdir(dir) + class ShellCommandPP(ProcessProtocol): debug = False @@ -616,7 +637,7 @@ if runtime.platformType != "posix": # if we're running on w32, use rmtree instead. It will block, # but hopefully it won't take too long. - shutil.rmtree(d, ignore_errors=1) + rmdirRecursive(d) return defer.succeed(0) command = ["rm", "-rf", d] c = ShellCommand(self.builder, command, self.builder.basedir, From warner at users.sourceforge.net Fri May 13 20:28:13 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 13 May 2005 20:28:13 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.429,1.430 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31279 Modified Files: ChangeLog Log Message: (rmdirRecursive): replacement for shutil.rmtree which behaves correctly on windows in the face of files that you have to chmod before deleting. Thanks to Bear at the OSAF for the routine. (SourceBase.doClobber): use rmdirRecursive Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.429 retrieving revision 1.430 diff -u -d -r1.429 -r1.430 --- ChangeLog 12 May 2005 21:55:58 -0000 1.429 +++ ChangeLog 13 May 2005 20:27:56 -0000 1.430 @@ -1,3 +1,11 @@ +2005-05-13 Brian Warner + + * buildbot/slave/commands.py (rmdirRecursive): replacement for + shutil.rmtree which behaves correctly on windows in the face of + files that you have to chmod before deleting. Thanks to Bear at + the OSAF for the routine. + (SourceBase.doClobber): use rmdirRecursive + 2005-05-12 Brian Warner * buildbot/status/builder.py (OfflineLogFile.getChunks): have this From code-bear at users.sourceforge.net Fri May 13 23:15:36 2005 From: code-bear at users.sourceforge.net (Mike Taylor) Date: Fri, 13 May 2005 23:15:36 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.31,1.32 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31538/buildbot/slave Modified Files: commands.py Log Message: buildbot/slave/commands.py (rmdirRecursive): added a check to ensure the path passed into rmdirRecursive actually exists. On win32 a non-existant path would generate an exception. Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- commands.py 13 May 2005 20:28:11 -0000 1.31 +++ commands.py 13 May 2005 23:15:34 -0000 1.32 @@ -32,6 +32,9 @@ def rmdirRecursive(dir): """This is a replacement for shutil.rmtree that works better under windows. Thanks to Bear at the OSAF for the code.""" + if not os.path.exists(dir): + return + if os.path.islink(dir): os.remove(dir) return From code-bear at users.sourceforge.net Fri May 13 23:15:36 2005 From: code-bear at users.sourceforge.net (Mike Taylor) Date: Fri, 13 May 2005 23:15:36 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.430,1.431 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31538 Modified Files: ChangeLog Log Message: buildbot/slave/commands.py (rmdirRecursive): added a check to ensure the path passed into rmdirRecursive actually exists. On win32 a non-existant path would generate an exception. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.430 retrieving revision 1.431 diff -u -d -r1.430 -r1.431 --- ChangeLog 13 May 2005 20:27:56 -0000 1.430 +++ ChangeLog 13 May 2005 23:15:33 -0000 1.431 @@ -1,3 +1,9 @@ +2005-05-13 Mike Taylor + + * buildbot/slave/commands.py (rmdirRecursive): added a check + to ensure the path passed into rmdirRecursive actually exists. + On win32 a non-existant path would generate an exception. + 2005-05-13 Brian Warner * buildbot/slave/commands.py (rmdirRecursive): replacement for From warner at users.sourceforge.net Sat May 14 05:31:32 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 14 May 2005 05:31:32 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_web.py,1.14,1.15 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19906/buildbot/test Modified Files: test_web.py Log Message: (WebTest.test_logfile): add 5-second timeouts to try and make the windows metabuildslave not hang Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- test_web.py 12 May 2005 21:16:49 -0000 1.14 +++ test_web.py 14 May 2005 05:31:30 -0000 1.15 @@ -245,13 +245,13 @@ bs.buildFinished() d = client.getPage("http://localhost:%d/" % port) - page = dr(d) + page = dr(d, 5) self.failUnless(page) logurl = "http://localhost:%d/builder1/builds/0/setup/0" % port d = client.getPage(logurl) - logbody = dr(d) + logbody = dr(d, 5) self.failUnless(logbody) d = client.getPage(logurl + "/text") - logtext = dr(d) + logtext = dr(d, 5) self.failUnlessEqual(logtext, "some stdout\n") From warner at users.sourceforge.net Sat May 14 05:31:33 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 14 May 2005 05:31:33 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.431,1.432 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19906 Modified Files: ChangeLog Log Message: (WebTest.test_logfile): add 5-second timeouts to try and make the windows metabuildslave not hang Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.431 retrieving revision 1.432 diff -u -d -r1.431 -r1.432 --- ChangeLog 13 May 2005 23:15:33 -0000 1.431 +++ ChangeLog 14 May 2005 05:31:30 -0000 1.432 @@ -1,3 +1,8 @@ +2005-05-14 Brian Warner + + * buildbot/test/test_web.py (WebTest.test_logfile): add 5-second + timeouts to try and make the windows metabuildslave not hang + 2005-05-13 Mike Taylor * buildbot/slave/commands.py (rmdirRecursive): added a check From warner at users.sourceforge.net Sun May 15 23:43:59 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 15 May 2005 23:43:59 +0000 Subject: [Buildbot-commits] buildbot/buildbot interfaces.py,1.25,1.26 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv688/buildbot Modified Files: interfaces.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-171 Creator: Brian Warner handle large logfiles without consuming lots of memory Merged from warner at monolith.lothar.com--2005 (patch 19-25) Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-19 Merged from arch at buildbot.sf.net--2004 (patch 159-160) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-20 Merged from arch at buildbot.sf.net--2004 (patch 161-166) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-21 Merged from arch at buildbot.sf.net--2004 (patch 167) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-22 Merged from arch at buildbot.sf.net--2004 (patch 168) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-23 Merged from arch at buildbot.sf.net--2004 (patch 169) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-24 Merged from arch at buildbot.sf.net--2004 (patch 170) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-25 handle large log files without using lots of memory Index: interfaces.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/interfaces.py,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- interfaces.py 12 May 2005 21:55:57 -0000 1.25 +++ interfaces.py 15 May 2005 23:43:56 -0000 1.26 @@ -411,41 +411,25 @@ """Returns a single string with the color that should be used to display this event. 'red' and 'yellow' are the most likely ones.""" -class IStatusLogStub(Interface): - """I represent a single finished Log. The body of the log may live in a - file on disk, but the metadata should all be available. To obtain the - log contents, use IStatusLog(log).getText() and friends. - """ - - def getName(): - """Returns a short string with the name of this log, probably 'log'. - """ - - def getStep(): - """Returns the IBuildStepStatus which owns this log.""" - # TODO: can there be non-Step logs? - - def isFinished(): - """Return a boolean. True means the log has finished and is closed, - False means it is still open and new chunks may be added to it.""" - class IStatusLog(Interface): """I represent a single Log, which is a growing list of text items that - contains some kind of output for a single BuildStep. + contains some kind of output for a single BuildStep. I might be finished, + in which case this list has stopped growing. Each Log has a name, usually something boring like 'log' or 'output'. These names are not guaranteed to be unique, however they are usually chosen to be useful within the scope of a single step (i.e. the Compile step might produce both 'log' and 'warnings'). The name may also have - spaces. If you want something more globally meaningful, try:: + spaces. If you want something more globally meaningful, at least within a + given Build, try:: '%s.%s' % (log.getStep.getName(), log.getName()) - The Log can be represented as plain text, or it can be accessed as a - list of items, each of which has a channel indicator (header, stdout, - stderr) and a text chunk. An HTML display might represent the - interleaved channels with different styles, while a straight - download-the-text interface would just want to retrieve a big string. + The Log can be presented as plain text, or it can be accessed as a list + of items, each of which has a channel indicator (header, stdout, stderr) + and a text chunk. An HTML display might represent the interleaved + channels with different styles, while a straight download-the-text + interface would just want to retrieve a big string. The 'header' channel is used by ShellCommands to prepend a note about which command is about to be run ('running command FOO in directory @@ -461,6 +445,18 @@ Such synthetic Logs are usually finished as soon as they are created.""" + def getName(): + """Returns a short string with the name of this log, probably 'log'. + """ + + def getStep(): + """Returns the IBuildStepStatus which owns this log.""" + # TODO: can there be non-Step logs? + + def isFinished(): + """Return a boolean. True means the log has finished and is closed, + False means it is still open and new chunks may be added to it.""" + def waitUntilFinished(): """Return a Deferred that will fire when the log is closed. If the log has already finished, this deferred will fire right away. The @@ -475,14 +471,45 @@ If 'catchup' is True, the receiver will immediately be sent a series of logChunk messages to bring it up to date with the partially-filled log. This allows a status client to join a Log already in progress - without missing any data.""" + without missing any data. If the Log has already finished, it is too + late to catch up: just do getText() instead. + + If the Log is very large, the receiver will be called many times with + a lot of data. There is no way to throttle this data. If the receiver + is planning on sending the data on to somewhere else, over a narrow + connection, you can get a throttleable subscription by using + C{subscribeConsumer} instead.""" def unsubscribe(receiver): - """Remove a receiver previously registered with subscribe().""" + """Remove a receiver previously registered with subscribe(). Attempts + to remove a receiver which was not previously registered is a no-op. + """ + + def subscribeConsumer(consumer): + """Register an L{IStatusLogConsumer} to receive all chunks of the + logfile, including all the old entries and any that will arrive in + the future. The consumer will first have their C{registerProducer} + method invoked with a reference to an object that can be told + C{pauseProducing}, C{resumeProducing}, and C{stopProducing}. Then the + consumer's C{writeChunk} method will be called repeatedly with each + (channel, text) tuple in the log, starting with the very first. The + consumer will be notified with C{finish} when the log has been + exhausted (which can only happen when the log is finished). Note that + a small amount of data could be written via C{writeChunk} even after + C{pauseProducing} has been called. + + To unsubscribe the consumer, use C{producer.stopProducing}.""" # once the log has finished, the following methods make sense. They can - # be called earlier, but the results they return might not be finished - # yet. + # be called earlier, but they will only return the contents of the log up + # to the point at which they were called. You will lose items that are + # added later. Use C{subscribe} or C{subscribeConsumer} to avoid missing + # anything. + + def hasContents(): + """Returns True if the LogFile still has contents available. Returns + False for logs that have been pruned. Clients should test this before + offering to show the contents of any log.""" def getText(): """Return one big string with the contents of the Log. This merges @@ -497,6 +524,35 @@ 0 for stdout, 1 for stderr, 2 for header. (note that stderr is merged into stdout if PTYs are in use).""" +class IStatusLogConsumer(Interface): + """I am an object which can be passed to IStatusLog.subscribeConsumer(). + I represent a target for writing the contents of an IStatusLog. This + differs from a regular IStatusReceiver in that it can pause the producer. + This makes it more suitable for use in streaming data over network + sockets, such as an HTTP request. Note that the consumer can only pause + the producer until it has caught up with all the old data. After that + point, C{pauseProducing} is ignored and all new output from the log is + sent directoy to the consumer.""" + + def registerProducer(producer, streaming): + """A producer is being hooked up to this consumer. The consumer only + has to handle a single producer. It should send .pauseProducing and + .resumeProducing messages to the producer when it wants to stop or + resume the flow of data. 'streaming' will be set to True because the + producer is always a PushProducer. + """ + + def unregisterProducer(): + """The previously-registered producer has been removed. No further + pauseProducing or resumeProducing calls should be made. The consumer + should delete its reference to the Producer so it can be released.""" + + def writeChunk(chunk): + """A chunk (i.e. a tuple of (channel, text)) is being written to the + consumer.""" + + def finish(): + """The log has finished sending chunks to the consumer.""" class IStatusReceiver(Interface): """I am an object which can receive build status updates. I may be From warner at users.sourceforge.net Sun May 15 23:43:59 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 15 May 2005 23:43:59 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.432,1.433 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv688 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-171 Creator: Brian Warner handle large logfiles without consuming lots of memory Merged from warner at monolith.lothar.com--2005 (patch 19-25) Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-19 Merged from arch at buildbot.sf.net--2004 (patch 159-160) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-20 Merged from arch at buildbot.sf.net--2004 (patch 161-166) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-21 Merged from arch at buildbot.sf.net--2004 (patch 167) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-22 Merged from arch at buildbot.sf.net--2004 (patch 168) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-23 Merged from arch at buildbot.sf.net--2004 (patch 169) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-24 Merged from arch at buildbot.sf.net--2004 (patch 170) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-25 handle large log files without using lots of memory Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.432 retrieving revision 1.433 diff -u -d -r1.432 -r1.433 --- ChangeLog 14 May 2005 05:31:30 -0000 1.432 +++ ChangeLog 15 May 2005 23:43:57 -0000 1.433 @@ -1,3 +1,58 @@ +2005-05-15 Brian Warner + + * buildbot/status/builder.py (LogFile): revamp LogFiles. Got rid + of the old non-offline LogFile, added code to upgrade these to + new-style contents-live-on-disk instances at load time (in a way + that doesn't invalidate the old Build pickles, so upgrading to + 0.6.5 is not a one-way operation). Got rid of everything related + to 'stub' builds. + (LogFile.__init__): create LogFiles with the parent step status, + the log's name, and a builder-relative filename where it can keep + the contents on disk. + (LogFile.hasContents): new method, clients are advised to call it + before getText or getChunks and friends. If it returns False, the + log's contents have been deleted and getText() will raise an + error. + (LogFile.getChunks): made it a generator + (LogFile.subscribeConsumer): new method, takes a Twisted-style + Consumer (except one that takes chunks instead of strings). This + enables streaming of very large logfiles without storing the whole + thing in memory. + (BuildStatus.generateLogfileName): create names like + 12-log-compile-output, with a _0 suffix if required to be unique + (BuildStatus.upgradeLogfiles): transform any old-style (from 0.6.4 + or earlier) logfiles into new-style ones + (BuilderStatus): remove everything related to 'stub' builds. There + is now only one build cache, and we don't strip logs from old + builds anymore. + (BuilderStatus.getBuildByNumber): check self.currentBuild too, + since we no longer fight to keep it in the cache + + * buildbot/status/html.py (TextLog.render_GET): use a + ChunkConsumer to stream the log entries efficiently. + (ChunkConsumer): wrapper which consumes chunks and writes + formatted HTML. + + * buildbot/test/test_twisted.py (Parse.testParse): use a + LogFile-like object instead of a real one + + * buildbot/test/test_status.py (MyLog): handle new LogFile code + (Log.testMerge3): validate more merge behavior + (Log.testChunks): validate LogFile.getChunks + (Log.testUpgrade): validate old-style LogFile upgrading + (Log.testSubscribe): validate LogFile.subscribe + (Log.testConsumer): validate LogFile.subscribeConsumer + + * buildbot/interfaces.py (IStatusLogStub): remove + (IStatusLog.subscribeConsumer): new method + (IStatusLog.hasContents): new method + (IStatusLogConsumer): describes things passed to subscribeConsumer + + * buildbot/status/html.py (StepBox.getBox): Don't offer an href to + the log contents if it does not have any contents. + (StatusResourceBuildStep.body): same + (StatusResourceBuildStep.getChild): give a 404 for empty logs + 2005-05-14 Brian Warner * buildbot/test/test_web.py (WebTest.test_logfile): add 5-second From warner at users.sourceforge.net Sun May 15 23:43:59 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 15 May 2005 23:43:59 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status html.py,1.62,1.63 builder.py,1.54,1.55 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv688/buildbot/status Modified Files: html.py builder.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-171 Creator: Brian Warner handle large logfiles without consuming lots of memory Merged from warner at monolith.lothar.com--2005 (patch 19-25) Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-19 Merged from arch at buildbot.sf.net--2004 (patch 159-160) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-20 Merged from arch at buildbot.sf.net--2004 (patch 161-166) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-21 Merged from arch at buildbot.sf.net--2004 (patch 167) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-22 Merged from arch at buildbot.sf.net--2004 (patch 168) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-23 Merged from arch at buildbot.sf.net--2004 (patch 169) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-24 Merged from arch at buildbot.sf.net--2004 (patch 170) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-25 handle large log files without using lots of memory Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- builder.py 12 May 2005 21:55:57 -0000 1.54 +++ builder.py 15 May 2005 23:43:57 -0000 1.55 @@ -3,10 +3,11 @@ from __future__ import generators from twisted.python import log, components +from twisted.persisted import styles from twisted.internet import reactor, defer from twisted.protocols import basic -import time, os.path, shutil, sys, re +import time, os, os.path, shutil, sys, re try: import cPickle as pickle except ImportError: @@ -42,55 +43,185 @@ HEADER = 2 ChunkTypes = ["stdout", "stderr", "header"] -class LogFileStub: - __implements__ = interfaces.IStatusLogStub, +class LogFileScanner(basic.NetstringReceiver): + def __init__(self, chunk_cb, channels=[]): + self.chunk_cb = chunk_cb + self.channels = channels - def __init__(self, logfile): - # stubs are created from a real LogFile - self.step = logfile.getStep() - self.name = logfile.getName() + def stringReceived(self, line): + channel = int(line[0]) + if not self.channels or (channel in self.channels): + self.chunk_cb((channel, line[1:])) - def getName(self): - return self.name # set in BuildStepStatus.addLog +class LogFileProducer: + """What's the plan? - def getStep(self): - return self.step + the LogFile has just one FD, used for both reading and writing. + Each time you add an entry, fd.seek to the end and then write. - def isFinished(self): - return True + Each reader (i.e. Producer) keeps track of their own offset. The reader + starts by seeking to the start of the logfile, and reading forwards. + Between each hunk of file they yield chunks, so they must remember their + offset before yielding and re-seek back to that offset before reading + more data. When their read() returns EOF, they're finished with the first + phase of the reading (everything that's already been written to disk). -def getFullLog(stubLog): - logNumber = stubLog.step.getLogs().index(stubLog) - stubBuild = stubLog.step.build - stepNumber = stubBuild.getSteps().index(stubLog.step) - buildNumber = stubBuild.number + After EOF, the remaining data is entirely in the current entries list. + These entries are all of the same channel, so we can do one "".join and + obtain a single chunk to be sent to the listener. But since that involves + a yield, and more data might arrive after we give up control, we have to + subscribe them before yielding. We can't subscribe them any earlier, + otherwise they'd get data out of order. - fullBuild = stubBuild.builder.getFullBuildByNumber(buildNumber) - fullStep = fullBuild.getSteps()[stepNumber] - fullLog = fullStep.getLogs()[logNumber] + We're using a generator in the first place so that the listener can + throttle us, which means they're pulling. But the subscription means + we're pushing. Really we're a Producer. In the first phase we can be + either a PullProducer or a PushProducer. In the second phase we're only a + PushProducer. - return fullLog + So the client gives a LogFileConsumer to File.subscribeConsumer . This + Consumer must have registerProducer(), unregisterProducer(), and + writeChunk(), and is just like a regular twisted.interfaces.IConsumer, + except that writeChunk() takes chunks (tuples of (channel,text)) instead + of the normal write() which takes just text. The LogFileConsumer is + allowed to call stopProducing, pauseProducing, and resumeProducing on the + producer instance it is given. """ -components.registerAdapter(getFullLog, LogFileStub, interfaces.IStatusLog) + subscribed = False + BUFFERSIZE = 2048 + + def __init__(self, logfile, consumer): + self.logfile = logfile + self.consumer = consumer + self.chunkGenerator = self.getChunks() + consumer.registerProducer(self, True) + + def getChunks(self): + f = self.logfile.getFile() + offset = 0 + chunks = [] + p = LogFileScanner(chunks.append) + f.seek(offset) + data = f.read(self.BUFFERSIZE) + offset = f.tell() + while data: + p.dataReceived(data) + while chunks: + c = chunks.pop(0) + yield c + f.seek(offset) + data = f.read(self.BUFFERSIZE) + offset = f.tell() + del f + + # now subscribe them to receive new entries + self.subscribed = True + self.logfile.watchers.append(self) + d = self.logfile.waitUntilFinished() + + # then give them the not-yet-merged data + if self.logfile.runEntries: + channel = self.logfile.runEntries[0][0] + text = "".join([c[1] for c in self.logfile.runEntries]) + yield (channel, text) + + # now we've caught up to the present. Anything further will come from + # the logfile subscription. We add the callback *after* yielding the + # data from runEntries, because the logfile might have finished + # during the yield. + d.addCallback(self.logfileFinished) + + def stopProducing(self): + # TODO: should we still call consumer.finish? probably not. + self.paused = True + self.consumer = None + self.done() + + def done(self): + if self.chunkGenerator: + self.chunkGenerator = None # stop making chunks + if self.subscribed: + self.logfile.watchers.remove(self) + self.subscribed = False + + def pauseProducing(self): + self.paused = True + + def resumeProducing(self): + self.paused = False + try: + while not self.paused: + chunk = self.chunkGenerator.next() + self.consumer.writeChunk(chunk) + # we exit this when the consumer says to stop, or we run out + # of chunks + except StopIteration: + # if the generator finished, it will have done releaseFile + self.chunkGenerator = None + # now everything goes through the subscription, and they don't get to + # pause anymore + + def logChunk(self, build, step, logfile, channel, chunk): + if self.consumer: + self.consumer.writeChunk((channel, chunk)) + + def logfileFinished(self, logfile): + self.done() + if self.consumer: + self.consumer.unregisterProducer() + self.consumer.finish() + self.consumer = None class LogFile: - __implements__ = interfaces.IStatusLog, interfaces.IStatusLogStub + """A LogFile keeps all of its contents on disk, in a non-pickle format to + which new entries can easily be appended. The file on disk has a name + like 12-log-compile-output, under the Builder's directory. The actual + filename is generated (before the LogFile is created) by + L{Builder.generateLogfileName}. + + @type parent: L{BuildStepStatus} + @param parent: the Step that this log is a part of + @type name: string + @param name: the name of this log, typically 'output' + @type logfilename: string + @param logfilename: the Builder-relative pathname for the saved entries + + Old LogFile pickles (which kept their contents in .entries) must be + upgraded. The L{BuilderStatus} is responsible for doing this, when it + loads the L{BuildStatus} into memory. The Build pickle is not modified, + so users who go from 0.6.5 back to 0.6.4 don't have to lose their + logs.""" + + __implements__ = interfaces.IStatusLog, finished = False length = 0 progress = None chunkSize = 10*1000 runLength = 0 runEntries = [] # provided so old pickled builds will getChunks() ok + entries = None + BUFFERSIZE = 2048 + filename = None # relative to the Builder's basedir + openfile = None - def __init__(self, parent): + def __init__(self, parent, name, logfilename): self.step = parent + self.name = name + self.filename = logfilename + assert not os.path.exists(self.getFilename()) + self.openfile = open(self.getFilename(), "wt+") + self.runEntries = [] self.watchers = [] self.finishedWatchers = [] - self.entries = [] - self.runEntries = [] + + def getFilename(self): + return os.path.join(self.step.build.builder.basedir, self.filename) + + def hasContents(self): + return os.path.exists(self.getFilename()) def getName(self): - return self.name # set in BuildStepStatus.addLog + return self.name def getStep(self): return self.step @@ -105,13 +236,77 @@ self.finishedWatchers.append(d) return d + def getFile(self): + if self.openfile: + # this is the filehandle we're using to write to the log, so + # don't close it! + return self.openfile + # otherwise they get their own read-only handle + return open(self.getFilename(), "rt") + def getText(self): - return "".join([e[1] for e in self.entries + self.runEntries - if e[0] in (STDOUT,STDERR)]) + # this produces one ginormous string + return "".join(self.getChunks([STDOUT, STDERR], onlyText=True)) + def getTextWithHeaders(self): - return "".join([e[1] for e in self.entries + self.runEntries]) - def getChunks(self): - return self.entries + self.runEntries + return "".join(self.getChunks(onlyText=True)) + + def getChunks(self, channels=[], onlyText=False): + # generate chunks for everything that was logged at the time we were + # first called, so remember how long the file was when we started. + # Don't read beyond that point. The current contents of + # self.runEntries will follow. + + # this returns an iterator, which means arbitrary things could happen + # while we're yielding. This will faithfully deliver the log as it + # existed when it was started, and not return anything after that + # point. To use this in subscribe(catchup=True) without missing any + # data, you must insure that nothing will be added to the log during + # yield() calls. + + f = self.getFile() + offset = 0 + f.seek(0, 2) + remaining = f.tell() + + leftover = None + if self.runEntries and (not channels or + (self.runEntries[0][0] in channels)): + leftover = (self.runEntries[0][0], + "".join([c[1] for c in self.runEntries])) + + # freeze the state of the LogFile by passing a lot of parameters into + # a generator + return self._generateChunks(f, offset, remaining, leftover, + channels, onlyText) + + def _generateChunks(self, f, offset, remaining, leftover, + channels, onlyText): + chunks = [] + p = LogFileScanner(chunks.append, channels) + f.seek(offset) + data = f.read(min(remaining, self.BUFFERSIZE)) + remaining -= len(data) + offset = f.tell() + while data: + p.dataReceived(data) + while chunks: + channel, text = chunks.pop(0) + if onlyText: + yield text + else: + yield (channel, text) + f.seek(offset) + data = f.read(min(remaining, self.BUFFERSIZE)) + remaining -= len(data) + offset = f.tell() + del f + + if leftover: + if onlyText: + yield leftover[1] + else: + yield leftover def subscribe(self, receiver, catchup): if self.finished: @@ -124,7 +319,12 @@ channel, text) def unsubscribe(self, receiver): - self.watchers.remove(receiver) + if receiver in self.watchers: + self.watchers.remove(receiver) + + def subscribeConsumer(self, consumer): + p = LogFileProducer(self, consumer) + p.resumeProducing() # interface used by the build steps to add things to the log def logProgressTo(self, progress, name): @@ -138,7 +338,12 @@ return channel = self.runEntries[0][0] text = "".join([c[1] for c in self.runEntries]) - self.entries.append((channel, text)) + assert channel < 10 + f = self.openfile + f.seek(0, 2) + f.write("%d:%d" % (1 + len(text), channel)) + f.write(text) + f.write(",") self.runEntries = [] self.runLength = 0 @@ -168,6 +373,14 @@ def finish(self): self.merge() + if self.openfile: + # we don't do an explicit close, because there might be readers + # shareing the filehandle. As soon as they stop reading, the + # filehandle will be released and automatically closed. We will + # do a sync, however, to make sure the log gets saved in case of + # a crash. + os.fsync(self.openfile.fileno()) + del self.openfile self.finished = True watchers = self.finishedWatchers self.finishedWatchers = [] @@ -179,19 +392,19 @@ del self.progressName # persistence stuff - def stubify(self): - return LogFileStub(self) - def __getstate__(self): d = self.__dict__.copy() del d['step'] # filled in upon unpickling del d['watchers'] del d['finishedWatchers'] + d['entries'] = [] # let 0.6.4 tolerate the saved log. TODO: really? if d.has_key('finished'): del d['finished'] if d.has_key('progress'): del d['progress'] del d['progressName'] + if d.has_key('openfile'): + del d['openfile'] return d def __setstate__(self, d): @@ -201,116 +414,18 @@ # self.step must be filled in by our parent self.finished = True -class OfflineLogFileScanner(basic.NetstringReceiver): - def __init__(self, chunk_cb, channels=[]): - self.chunk_cb = chunk_cb - self.channels = channels - def stringReceived(self, line): - channel = int(line[0]) - if not self.channels or (channel in self.channels): - self.chunk_cb((channel, line[1:])) - -class OfflineLogFile(LogFile): - """An OfflineLogFile keeps all of its contents on disk, in a non-pickle - format that can be appended easily. - - This behaves like LogFile for each individual entry. The difference is - that, when a run of entries are merged together, the merged chunk is - written out to disk instead of being stored in self.entries . - - """ - openfile = None - - def __init__(self, parent, logfilename): - self.step = parent - self.watchers = [] - self.finishedWatchers = [] - self.runEntries = [] + def upgrade(self, logfilename): + """Save our .entries to a new-style offline log file (if necessary), + and modify our in-memory representation to use it. The original + pickled LogFile (inside the pickled Build) won't be modified.""" self.filename = logfilename - - def openForWriting(self): - assert not self.finished, "you can't add to a finished log" - if not self.openfile: - f = open(self.step.build.getLogfileNamed(self.filename), "a") - self.openfile = f - return self.openfile - - def getChunks(self, channels=[], onlyText=False): - if self.openfile: - # we must close it so we can read it properly. It will be opened - # again the next time we try to write to it. - self.openfile.close() - self.openfile = None - f = open(self.step.build.getLogfileNamed(self.filename), "r") - chunks = [] - p = OfflineLogFileScanner(chunks.append, channels) - # TODO: if merge() is called while we're paused, we might miss some - # data. - data = f.read(2000) - while data: - p.dataReceived(data) - for c in chunks: - if onlyText: - yield c[1] - else: - yield c - chunks = [] - data = f.read(2000) - f.close() - # TODO: if merge() is called while we're paused, we'll lose some data - for channel, text in self.runEntries: - if not channels or (channel in channels): - if onlyText: - yield text - else: - yield (channel, text) - - def getText(self): - # this produces one ginormous string - return "".join(self.getChunks([STDOUT, STDERR], onlyText=True)) - - def getTextWithHeaders(self): - return "".join(self.getChunks(onlyText=True)) - - def subscribe(self, receiver, catchup): - if self.finished: - return - self.watchers.append(receiver) - if catchup: - for channel,chunk in self.getChunks(): - receiver.logChunk(self.step.build, self.step, self, - channel, chunk) - - def merge(self): - # merge all .runEntries (which are all of the same type) into a - # single chunk for .entries - if not self.runEntries: - return - channel = self.runEntries[0][0] - text = "".join([c[1] for c in self.runEntries]) - assert channel < 10 - f = self.openForWriting() - f.write("%d:%d" % (1 + len(text), channel)) - f.write(text) - f.write(",") - self.runEntries = [] - self.runLength = 0 - - def finish(self): - self.merge() - if self.openfile: - self.openfile.close() - self.openfile = None - LogFile.finish(self) - - def __getstate__(self): - d = LogFile.__getstate__(self) - if d.has_key('openfile'): - del d['openfile'] - return d - - def stubify(self): - return self + if not os.path.exists(self.getFilename()): + self.openfile = open(self.getFilename(), "wt") + self.finished = False + for channel,text in self.entries: + self.addEntry(channel, text) + self.finish() # releases self.openfile, which will be closed + del self.entries class HTMLLogFile: @@ -345,10 +460,6 @@ def finish(self): pass - # persistence - def stubify(self): - return self - def __getstate__(self): d = self.__dict__.copy() del d['step'] @@ -415,7 +526,7 @@ @cvar text: list of short texts that describe the command and its status @type text2: list of strings @cvar text2: list of short texts added to the overall build description - @type logs: dict of string -> L{buildbot.status.builder.OfflineLogFile} + @type logs: dict of string -> L{buildbot.status.builder.LogFile} @ivar logs: logs of steps """ # note that these are created when the Build is set up, before each @@ -563,9 +674,8 @@ def addLog(self, name): assert self.started # addLog before stepStarted won't notify watchers - logfilename = self.build.getLogfileName(self.name, name) - log = OfflineLogFile(self, logfilename) - log.name = name + logfilename = self.build.generateLogfileName(self.name, name) + log = LogFile(self, name, logfilename) self.logs.append(log) for w in self.watchers: receiver = w.logStarted(self.build, self, log) @@ -604,7 +714,6 @@ self.results = results for loog in self.logs: if not loog.isFinished(): - log.msg("log '%s' not closed" % loog.getName()) loog.finish() for r in self.updates.keys(): @@ -617,17 +726,8 @@ for w in watchers: w.callback(self) - # methods to be invoked by our parent IBuildStatus - - def pruneLogs(self): - self.logs = [] - # persistence - def stubify(self): - self.logs = [loog.stubify() for loog in self.logs] - return self - def __getstate__(self): d = self.__dict__.copy() del d['build'] # filled in when loading @@ -899,11 +999,22 @@ # persistence stuff - def getLogfileName(self, stepname, logname): - """Return an relative path where this logfile's contents can be - stored.""" - starting_filename = stepname + logname - starting_filename = re.sub(r'[^\w\.]', '_', starting_filename) + def generateLogfileName(self, stepname, logname): + """Return a filename (relative to the Builder's base directory) where + the logfile's contents can be stored uniquely. + + The base filename is made by combining our build number, the Step's + name, and the log's name, then removing unsuitable characters. The + filename is then made unique by appending _0, _1, etc, until it does + not collide with any other logfile. + + These files are kept in the Builder's basedir (rather than a + per-Build subdirectory) because that makes cleanup easier: cron and + find will help get rid of the old logs, but the empty directories are + more of a hassle to remove.""" + + starting_filename = "%d-log-%s-%s" % (self.number, stepname, logname) + starting_filename = re.sub(r'[^\w\.\-]', '_', starting_filename) # now make it unique unique_counter = 0 filename = starting_filename @@ -915,16 +1026,6 @@ unique_counter += 1 return filename - def getLogfileNamed(self, logname): - """Return the absolute path of the logfile with the given name""" - filename = os.path.join(self.builder.basedir, - "%d-%s" % (self.number, logname)) - return filename - - def stubify(self): - self.steps = [step.stubify() for step in self.steps] - return self - def __getstate__(self): d = self.__dict__.copy() # for now, a serialized Build is always "finished". We will never @@ -950,6 +1051,21 @@ self.updates = {} self.finishedWatchers = [] + def upgradeLogfiles(self): + # upgrade any LogFiles that need it. This must occur after we've been + # attached to our Builder, and after we know about all LogFiles of + # all Steps (to get the filenames right). + assert self.builder + for s in self.steps: + for l in s.getLogs(): + if l.filename: + pass # new-style, log contents are on disk + else: + logfilename = self.generateLogfileName(s.name, l.name) + # let the logfile update its .filename pointer, + # transferring its contents onto disk if necessary + l.upgrade(logfilename) + def saveYourself(self): filename = os.path.join(self.builder.basedir, "%d" % self.number) if os.path.isdir(filename): @@ -994,11 +1110,13 @@ __implements__ = interfaces.IBuilderStatus, - buildHorizon = 100 # prune builds beyond this - stubBuildCacheSize = 30 - fullBuildCacheSize = 2 - stepHorizon = 50 # prune steps in builds beyond this - logHorizon = 20 # prune logs in builds beyond this + # these limit the amount of memory we consume, as well as the size of the + # main Builder pickle. The Build and LogFile pickles on disk must be + # handled separately. + buildCacheSize = 30 + buildHorizon = 100 # forget builds beyond this + stepHorizon = 50 # forget steps in builds beyond this + slavename = None category = None currentBuild = None @@ -1020,16 +1138,14 @@ self.nextBuild = None self.eta = None self.watchers = [] - self.fullBuildCache = [] # TODO: age builds out of the cache - self.stubBuildCache = [] + self.buildCache = [] # TODO: age builds out of the cache # persistence def __getstate__(self): d = self.__dict__.copy() d['watchers'] = [] - del d['fullBuildCache'] - del d['stubBuildCache'] + del d['buildCache'] if self.currentBuild: self.currentBuild.saveYourself() # TODO: push a 'hey, build was interrupted' event @@ -1041,14 +1157,13 @@ def __setstate__(self, d): self.__dict__ = d - self.fullBuildCache = [] - self.stubBuildCache = [] + self.buildCache = [] self.watchers = [] # self.basedir must be filled in by our parent # self.status must be filled in by our parent def saveYourself(self): - for b in self.fullBuildCache: + for b in self.buildCache: if not b.isFinished: # interrupted build, need to save it anyway. # BuildStatus.saveYourself will mark it as interrupted. @@ -1069,71 +1184,26 @@ # build cache management - def addFullBuildToCache(self, build): - if build in self.fullBuildCache: - return - self.fullBuildCache.append(build) - # there might be a stripped version of this one in the stub cache - for b in self.stubBuildCache: - if b.number == build.number: - self.stubBuildCache.remove(b) - break - while len(self.fullBuildCache) > self.fullBuildCacheSize: - old = self.fullBuildCache.pop(0) - if not old.finished: - log.msg("BuilderStatus.addFullBuildToCache: " - "weird, old build %d isn't finished" % old.number) - # this can happen if a lot of people hit logfiles of - # different builds at the same time: all the corresponding - # builds must be pulled fully into memory, and a - # currently-active one could be pushed out. We need to keep - # it from being stripped until it finishes changing its logs - self.fullBuildCache.append(old) - break - else: - old = old.stubify() - self.addStubBuildToCache(old) - - def addStubBuildToCache(self, build): - if build in self.stubBuildCache: + def addBuildToCache(self, build): + if build in self.buildCache: return - self.stubBuildCache.append(build) - if len(self.stubBuildCache) > self.stubBuildCacheSize: - self.stubBuildCache.pop(0) - - def getStubBuildByNumber(self, number): - for build in self.fullBuildCache: - if build.number == number: - # full builds are ok too - return build - for build in self.stubBuildCache: - if build.number == number: - return build - # need to load it from disk - filename = os.path.join(self.basedir, "%d" % number) - # TODO: consider using "%d.stub" to avoid loading in all the build's - # logs when we're going to throw them out in a moment. requires two - # separate files on disk, though. - try: - build = pickle.load(open(filename, "r")) - build.builder = self - build = build.stubify() - self.addStubBuildToCache(build) - return build - except IOError: - raise IndexError("no such build %d" % number) - except EOFError: - raise IndexError("corrupted build pickle %d" % number) + self.buildCache.append(build) + while len(self.buildCache) > self.buildCacheSize: + self.buildCache.pop(0) - def getFullBuildByNumber(self, number): - for build in self.fullBuildCache: + def getBuildByNumber(self, number): + if self.currentBuild and self.currentBuild.number == number: + return self.currentBuild + for build in self.buildCache: if build.number == number: return build filename = os.path.join(self.basedir, "%d" % number) try: build = pickle.load(open(filename, "r")) build.builder = self - self.addFullBuildToCache(build) + # handle LogFiles from after 0.5.0 and before 0.6.5 + build.upgradeLogfiles() + self.addBuildToCache(build) return build except IOError: raise IndexError("no such build %d" % number) @@ -1147,9 +1217,6 @@ # then prune steps in builds past the step horizon for b in self.builds[0:-self.stepHorizon]: b.pruneSteps() - # then prune logs in steps in builds past the log horizon - for b in self.builds[0:-self.logHorizon]: - b.pruneLogs() def getETA(self): eta = self.ETA # absolute time, set by currentlyWaiting @@ -1186,7 +1253,7 @@ return None try: - return self.getStubBuildByNumber(number) + return self.getBuildByNumber(number) except IndexError: return None @@ -1336,7 +1403,7 @@ assert s.number == self.nextBuildNumber - 1 self.currentBuild = s self.currentBigState = "building" - self.addFullBuildToCache(self.currentBuild) + self.addBuildToCache(self.currentBuild) self.publishState() # now that the BuildStatus is prepared to answer queries, we can Index: html.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- html.py 12 May 2005 21:55:57 -0000 1.62 +++ html.py 15 May 2005 23:43:57 -0000 1.63 @@ -204,9 +204,13 @@ data += ("

Logs

\n" "
    \n") for num in range(len(logs)): - data += '
  • %s
  • \n' % \ - (urllib.quote(request.childLink("%d" % num)), - html.escape(logs[num].getName())) + if logs[num].hasContents(): + data += '
  • %s
  • \n' % \ + (urllib.quote(request.childLink("%d" % num)), + html.escape(logs[num].getName())) + else: + data += ('
  • %s
  • \n' % + html.escape(logs[num].getName())) data += "
\n" return data @@ -215,7 +219,9 @@ logname = path try: log = self.step.getLogs()[int(logname)] - return IHTMLLog(interfaces.IStatusLog(log)) + if log.hasContents(): + return IHTMLLog(interfaces.IStatusLog(log)) + return NoResource("Empty Log '%s'" % logname) except (IndexError, ValueError): return NoResource("No such Log '%s'" % logname) @@ -528,6 +534,25 @@ """ +class ChunkConsumer: + __implements__ = interfaces.IStatusLogConsumer, + def __init__(self, original, textlog): + self.original = original + self.textlog = textlog + def registerProducer(self, producer, streaming): + self.producer = producer + self.original.registerProducer(producer, streaming) + def unregisterProducer(self): + self.original.unregisterProducer() + def writeChunk(self, chunk): + formatted = self.textlog.content([chunk]) + try: + self.original.write(formatted) + except pb.DeadReferenceError: + self.producing.stopProducing() + def finish(self): + self.textlog.finished() + class TextLog(Resource): # a new instance of this Resource is created for each client who views # it, so we can afford to track the request in the Resource. @@ -583,31 +608,6 @@ request.setHeader("content-length", self.original.length) return '' - def resumeProducing(self): - try: - chunk = self.chunkGenerator.next() - data = self.content([chunk]) - if data: - self.req.write(data) - return - except StopIteration: - pass - self.req.unregisterProducer() - # now subscribe to anything that might happen later - self.original.subscribe(self, False) - self.subscribed = True - d = self.original.waitUntilFinished() - d.addCallback(self.finished) - - # TODO: under heavy load (a rogue web crawler hammering all the build log - # pages), this method gets called, and we don't implement it, which is - # bad. - #def pauseProducing(self): - # pass - - def stopProducing(self): - pass - def render_GET(self, req): self.req = req @@ -619,28 +619,10 @@ if not self.asText: req.write(self.htmlHeader(req)) - self.chunkGenerator = self.original.getChunks() - req.registerProducer(self, False) - d = req.notifyFinish() - d.addErrback(self.stop) + self.original.subscribeConsumer(ChunkConsumer(req, self)) return server.NOT_DONE_YET - def stop(self, why): - if self.subscribed: - self.original.unsubscribe(self) - self.subscribed = False - self.req.unregisterProducer() - # our .finished callback may still be fired - self.req = None - - def logChunk(self, build, step, log, channel, text): - output = self.content([(channel, text)]) - try: - self.req.write(output) - except pb.DeadReferenceError: - log.unsubscribe(self) - - def finished(self, log): + def finished(self): if not self.req: return try: @@ -745,8 +727,11 @@ logs = self.original.getLogs() for num in range(len(logs)): name = logs[num].getName() - url = urllib.quote("%s/%d" % (urlbase, num)) - text.append("%s" % (url, html.escape(name))) + if logs[num].hasContents(): + url = urllib.quote("%s/%d" % (urlbase, num)) + text.append("%s" % (url, html.escape(name))) + else: + text.append(html.escape(name)) color = self.original.getColor() class_ = "BuildStep " + build_get_class(self.original) return Box(text, color, class_=class_) From warner at users.sourceforge.net Sun May 15 23:43:59 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 15 May 2005 23:43:59 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_status.py,1.16,1.17 test_twisted.py,1.5,1.6 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv688/buildbot/test Modified Files: test_status.py test_twisted.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-171 Creator: Brian Warner handle large logfiles without consuming lots of memory Merged from warner at monolith.lothar.com--2005 (patch 19-25) Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-19 Merged from arch at buildbot.sf.net--2004 (patch 159-160) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-20 Merged from arch at buildbot.sf.net--2004 (patch 161-166) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-21 Merged from arch at buildbot.sf.net--2004 (patch 167) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-22 Merged from arch at buildbot.sf.net--2004 (patch 168) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-23 Merged from arch at buildbot.sf.net--2004 (patch 169) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-24 Merged from arch at buildbot.sf.net--2004 (patch 170) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-25 handle large log files without using lots of memory Index: test_status.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_status.py,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- test_status.py 6 May 2005 06:40:04 -0000 1.16 +++ test_status.py 15 May 2005 23:43:57 -0000 1.17 @@ -12,16 +12,46 @@ from buildbot.status import progress, client # NEEDS COVERAGE class MyStep: + build = None def getName(self): return "step" class MyLog(builder.LogFile): - def __init__(self, name, text): - builder.LogFile.__init__(self, None) - self.name = name - self.addStdout(text) - self.finish() - self.step = MyStep() + def __init__(self, basedir, name, text=None, step=None): + self.fakeBuilderBasedir = basedir + if not step: + step = MyStep() + builder.LogFile.__init__(self, step, name, name) + if text: + self.addStdout(text) + self.finish() + def getFilename(self): + return os.path.join(self.fakeBuilderBasedir, self.name) + +class MyLogSubscriber: + def __init__(self): + self.chunks = [] + def logChunk(self, build, step, log, channel, text): + self.chunks.append((channel, text)) + +class MyLogConsumer: + def __init__(self, limit=None): + self.chunks = [] + self.finished = False + self.limit = limit + def registerProducer(self, producer, streaming): + self.producer = producer + self.streaming = streaming + def unregisterProducer(self): + self.producer = None + def writeChunk(self, chunk): + self.chunks.append(chunk) + if self.limit: + self.limit -= 1 + if self.limit == 0: + self.producer.pauseProducing() + def finish(self): + self.finished = True class MyMailer(mail.MailNotifier): def sendMessage(self, m, recipients): @@ -223,6 +253,8 @@ "recip2 at example.com", "recip at example.com"]) def testLogs(self): + basedir = "test_status_logs" + os.mkdir(basedir) mailer = MyMailer(fromaddr="buildbot at example.com", addLogs=True, extraRecipients=["recip at example.com", "recip2 at example.com"]) @@ -231,8 +263,9 @@ self.messages = [] b1 = self.makeBuild(3, builder.WARNINGS) - b1.testlogs = [MyLog('compile', "Compile log here\n"), - MyLog('test', "Test log here\nTest 4 failed\n"), + b1.testlogs = [MyLog(basedir, 'compile', "Compile log here\n"), + MyLog(basedir, + 'test', "Test log here\nTest 4 failed\n"), ] b1.text = ["unusual", "gnarzzler", "output"] mailer.buildFinished("builder1", b1, b1.results) @@ -254,6 +287,8 @@ self.failUnlessIn("Test log here\n", p[2].get_payload()) def testMail(self): + basedir = "test_status_mail" + os.mkdir(basedir) dest = os.environ.get("BUILDBOT_TEST_MAIL") if not dest: raise unittest.SkipTest("define BUILDBOT_TEST_MAIL=dest to run this") @@ -265,8 +300,9 @@ mailer.status = s b1 = self.makeBuild(3, builder.SUCCESS) - b1.testlogs = [MyLog('compile', "Compile log here\n"), - MyLog('test', "Test log here\nTest 4 failed\n"), + b1.testlogs = [MyLog(basedir, 'compile', "Compile log here\n"), + MyLog(basedir, + 'test', "Test log here\nTest 4 failed\n"), ] print "sending mail to", dest @@ -309,10 +345,12 @@ self.failUnlessEqual(t.getLogs(), {'output': ""}) class Log(unittest.TestCase): + def setUpClass(self): + self.basedir = "status_log_add" + os.mkdir(self.basedir) + def testAdd(self): - l = builder.LogFile(None) - l.name = "compile" - l.step = 13 + l = MyLog(self.basedir, "compile", step=13) self.failUnlessEqual(l.getName(), "compile") self.failUnlessEqual(l.getStep(), 13) l.addHeader("HEADER\n") @@ -327,10 +365,10 @@ self.failUnlessEqual(l.getTextWithHeaders(), "HEADER\n" + "Some text\nSome error\nSome more text\n") - self.failUnlessEqual(len(l.getChunks()), 4) + self.failUnlessEqual(len(list(l.getChunks())), 4) - def testMerge(self): - l = builder.LogFile(None) + def testMerge1(self): + l = MyLog(self.basedir, "merge1") l.addHeader("HEADER\n") l.addStdout("Some text\n") l.addStdout("Some more text\n") @@ -341,10 +379,10 @@ self.failUnlessEqual(l.getTextWithHeaders(), "HEADER\n" + "Some text\nSome more text\nmore\n") - self.failUnlessEqual(len(l.getChunks()), 2) + self.failUnlessEqual(len(list(l.getChunks())), 2) def testMerge2(self): - l = builder.LogFile(None) + l = MyLog(self.basedir, "merge2") l.addHeader("HEADER\n") for i in xrange(1000): l.addStdout("aaaa") @@ -352,26 +390,191 @@ l.addStderr("bbbb") for i in xrange(10): l.addStdout("cc") - self.failUnlessEqual(l.getText(), - 1000*"aaaa" + 30 * "bbbb" + 10 * "cc") + target = 1000*"aaaa" + 30 * "bbbb" + 10 * "cc" + self.failUnlessEqual(len(l.getText()), len(target)) + self.failUnlessEqual(l.getText(), target) + l.finish() + self.failUnlessEqual(len(l.getText()), len(target)) + self.failUnlessEqual(l.getText(), target) + self.failUnlessEqual(len(list(l.getChunks())), 4) + + def testMerge3(self): + l = MyLog(self.basedir, "merge3") + l.chunkSize = 100 + l.addHeader("HEADER\n") + for i in xrange(8): + l.addStdout(10*"a") + for i in xrange(8): + l.addStdout(10*"a") + self.failUnlessEqual(list(l.getChunks()), + [(builder.HEADER, "HEADER\n"), + (builder.STDOUT, 110*"a"), + (builder.STDOUT, 50*"a")]) + l.finish() + self.failUnlessEqual(l.getText(), 160*"a") + + def testChunks(self): + l = MyLog(self.basedir, "chunks") + c1 = l.getChunks() + l.addHeader("HEADER\n") + l.addStdout("Some text\n") + self.failUnlessEqual("".join(l.getChunks(onlyText=True)), + "HEADER\nSome text\n") + c2 = l.getChunks() + + l.addStdout("Some more text\n") + self.failUnlessEqual("".join(l.getChunks(onlyText=True)), + "HEADER\nSome text\nSome more text\n") + c3 = l.getChunks() + + l.addStdout("more\n") l.finish() + + self.failUnlessEqual(list(c1), []) + self.failUnlessEqual(list(c2), [(builder.HEADER, "HEADER\n"), + (builder.STDOUT, "Some text\n")]) + self.failUnlessEqual(list(c3), [(builder.HEADER, "HEADER\n"), + (builder.STDOUT, + "Some text\nSome more text\n")]) + self.failUnlessEqual(l.getText(), - 1000*"aaaa" + 30 * "bbbb" + 10 * "cc") - self.failUnlessEqual(len(l.getChunks()), 4) + "Some text\nSome more text\nmore\n") + self.failUnlessEqual(l.getTextWithHeaders(), + "HEADER\n" + + "Some text\nSome more text\nmore\n") + self.failUnlessEqual(len(list(l.getChunks())), 2) - def testStubify(self): - l = builder.LogFile(None) - l.name = "compile" - l.step = 13 + def testUpgrade(self): + l = MyLog(self.basedir, "upgrade") l.addHeader("HEADER\n") l.addStdout("Some text\n") l.addStdout("Some more text\n") l.addStdout("more\n") - stub = l.stubify() - self.failUnless(components.implements(stub, - interfaces.IStatusLogStub)) - self.failUnlessEqual(stub.getName(), l.getName()) - self.failUnlessEqual(stub.getStep(), l.getStep()) + l.finish() + # now doctor it to look like a 0.6.4-era non-upgraded logfile + l.entries = list(l.getChunks()) + del l.filename + os.unlink(l.getFilename()) + # now make sure we can upgrade it + l.upgrade("upgrade") + self.failUnlessEqual(l.getText(), + "Some text\nSome more text\nmore\n") + self.failUnlessEqual(len(list(l.getChunks())), 2) + self.failIf(l.entries) + + # now, do it again, but make it look like an upgraded 0.6.4 logfile + # (i.e. l.filename is missing, but the contents are there on disk) + l.entries = list(l.getChunks()) + del l.filename + l.upgrade("upgrade") + self.failUnlessEqual(l.getText(), + "Some text\nSome more text\nmore\n") + self.failUnlessEqual(len(list(l.getChunks())), 2) + self.failIf(l.entries) + + def testSubscribe(self): + l1 = MyLog(self.basedir, "subscribe1") + l1.finish() + self.failUnless(l1.isFinished()) + + s = MyLogSubscriber() + l1.subscribe(s, True) + l1.unsubscribe(s) + self.failIf(s.chunks) + + s = MyLogSubscriber() + l1.subscribe(s, False) + l1.unsubscribe(s) + self.failIf(s.chunks) + + finished = [] + l2 = MyLog(self.basedir, "subscribe2") + l2.waitUntilFinished().addCallback(finished.append) + l2.addHeader("HEADER\n") + s1 = MyLogSubscriber() + l2.subscribe(s1, True) + s2 = MyLogSubscriber() + l2.subscribe(s2, False) + self.failUnlessEqual(s1.chunks, [(builder.HEADER, "HEADER\n")]) + self.failUnlessEqual(s2.chunks, []) + + l2.addStdout("Some text\n") + self.failUnlessEqual(s1.chunks, [(builder.HEADER, "HEADER\n"), + (builder.STDOUT, "Some text\n")]) + self.failUnlessEqual(s2.chunks, [(builder.STDOUT, "Some text\n")]) + l2.unsubscribe(s1) + + l2.addStdout("Some more text\n") + self.failUnlessEqual(s1.chunks, [(builder.HEADER, "HEADER\n"), + (builder.STDOUT, "Some text\n")]) + self.failUnlessEqual(s2.chunks, [(builder.STDOUT, "Some text\n"), + (builder.STDOUT, "Some more text\n"), + ]) + self.failIf(finished) + l2.finish() + self.failUnlessEqual(finished, [l2]) + + def testConsumer(self): + l1 = MyLog(self.basedir, "consumer1") + l1.finish() + self.failUnless(l1.isFinished()) + + s = MyLogConsumer() + l1.subscribeConsumer(s) + self.failIf(s.chunks) + self.failUnless(s.finished) + self.failIf(s.producer) # producer should be registered and removed + + l2 = MyLog(self.basedir, "consumer2") + l2.addHeader("HEADER\n") + l2.finish() + self.failUnless(l2.isFinished()) + + s = MyLogConsumer() + l2.subscribeConsumer(s) + self.failUnlessEqual(s.chunks, [(builder.HEADER, "HEADER\n")]) + self.failUnless(s.finished) + self.failIf(s.producer) # producer should be registered and removed + + + l2 = MyLog(self.basedir, "consumer3") + l2.chunkSize = 1000 + l2.addHeader("HEADER\n") + l2.addStdout(800*"a") + l2.addStdout(800*"a") # should now have two chunks on disk + l2.addStdout(800*"b") # HEADER,1600*a on disk, 800*a in memory + l2.addStdout(800*"b") # HEADER,1600*a,1600*b on disk + l2.addStdout(200*"c") # HEADER,1600*a,1600*b on disk,200*c in memory + + s = MyLogConsumer(limit=1) + l2.subscribeConsumer(s) + self.failUnless(s.streaming) + self.failUnlessEqual(s.chunks, [(builder.HEADER, "HEADER\n")]) + s.limit = 1 + s.producer.resumeProducing() + self.failUnlessEqual(s.chunks, [(builder.HEADER, "HEADER\n"), + (builder.STDOUT, 1600*"a")]) + s.limit = None + s.producer.resumeProducing() + self.failUnlessEqual(s.chunks, [(builder.HEADER, "HEADER\n"), + (builder.STDOUT, 1600*"a"), + (builder.STDOUT, 1600*"b"), + (builder.STDOUT, 200*"c")]) + l2.addStdout(1000*"c") # HEADER,1600*a,1600*b,1200*c on disk + self.failUnlessEqual(s.chunks, [(builder.HEADER, "HEADER\n"), + (builder.STDOUT, 1600*"a"), + (builder.STDOUT, 1600*"b"), + (builder.STDOUT, 200*"c"), + (builder.STDOUT, 1000*"c")]) + l2.finish() + self.failUnlessEqual(s.chunks, [(builder.HEADER, "HEADER\n"), + (builder.STDOUT, 1600*"a"), + (builder.STDOUT, 1600*"b"), + (builder.STDOUT, 200*"c"), + (builder.STDOUT, 1000*"c")]) + self.failIf(s.producer) + self.failUnless(s.finished) + class Client(unittest.TestCase): def testAdaptation(self): Index: test_twisted.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_twisted.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- test_twisted.py 26 Apr 2005 09:43:19 -0000 1.5 +++ test_twisted.py 15 May 2005 23:43:57 -0000 1.6 @@ -98,6 +98,12 @@ def addCompleteLog(self, name, log): pass +class MyLogFile: + def __init__(self, text): + self.text = text + def getText(self): + return self.text + class Count(unittest.TestCase): @@ -132,8 +138,7 @@ def testParse(self): t = MyTrial(build=None, workdir=".", testpath=None, testChanges=True) t.results = [] - log = builder.LogFile(None) - log.addStdout(out6) + log = MyLogFile(out6) t.createSummary(log) self.failUnlessEqual(len(t.results), 4) From warner at users.sourceforge.net Sun May 15 23:51:21 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 15 May 2005 23:51:21 +0000 Subject: [Buildbot-commits] buildbot/docs buildbot.texinfo,1.2,1.3 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2192/docs Modified Files: buildbot.texinfo Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-173 Creator: Brian Warner describe how to delete old Builds and logs with a cron job Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-26 Merged from arch at buildbot.sf.net--2004 (patch 171-172) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-27 describe how to delete old Builds and logs with a cron job Index: buildbot.texinfo =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/buildbot.texinfo,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- buildbot.texinfo 12 May 2005 20:10:11 -0000 1.2 +++ buildbot.texinfo 15 May 2005 23:51:18 -0000 1.3 @@ -778,6 +778,22 @@ let the project admins know, so they can put out a call for a replacement. +The Buildbot records status and logs output continually, each time a +build is performed. The status tends to be small, but the build logs +can become quite large. Each build and log are recorded in a separate +file, arranged hierarchically under the buildmaster's base directory. +To prevent these files from growing without bound, you should +periodically delete old build logs. A simple cron job to delete +anything older than, say, two weeks should do the job. The only trick +is to leave the @file{buildbot.tac} and other support files alone, for +which find's @code{-mindepth} argument helps skip everything in the +top directory. You can use something like the following: + + at example +@@weekly cd BASEDIR && find . -mindepth 2 -type f -mtime +14 -exec rm @{@} \; +@@weekly cd BASEDIR && find twistd.log* -mtime +14 -exec rm @{@} \; + at end example + @node Troubleshooting, , Maintenance, Installation @section Troubleshooting From warner at users.sourceforge.net Sun May 15 23:51:21 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 15 May 2005 23:51:21 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.433,1.434 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2192 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-173 Creator: Brian Warner describe how to delete old Builds and logs with a cron job Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-26 Merged from arch at buildbot.sf.net--2004 (patch 171-172) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-27 describe how to delete old Builds and logs with a cron job Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.433 retrieving revision 1.434 diff -u -d -r1.433 -r1.434 --- ChangeLog 15 May 2005 23:43:57 -0000 1.433 +++ ChangeLog 15 May 2005 23:51:19 -0000 1.434 @@ -1,5 +1,8 @@ 2005-05-15 Brian Warner + * docs/buildbot.texinfo (Maintenance): describe how to delete old + Builds and logs with a cron job. + * buildbot/status/builder.py (LogFile): revamp LogFiles. Got rid of the old non-offline LogFile, added code to upgrade these to new-style contents-live-on-disk instances at load time (in a way From warner at users.sourceforge.net Mon May 16 00:16:30 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 16 May 2005 00:16:30 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.434,1.435 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6343 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-175 Creator: Brian Warner fix HTMLLog to match new LogFile behavior * buildbot/status/builder.py (HTMLLogFile): make this behave like the new LogFile class, so upgrading works properly * buildbot/test/test_web.py (WebTest.test_logfile): validate HTML logs too * buildbot/test/test_status.py (Log.testAdd): validate hasContents (Log.testUpgrade): same Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.434 retrieving revision 1.435 diff -u -d -r1.434 -r1.435 --- ChangeLog 15 May 2005 23:51:19 -0000 1.434 +++ ChangeLog 16 May 2005 00:16:28 -0000 1.435 @@ -1,5 +1,12 @@ 2005-05-15 Brian Warner + * buildbot/status/builder.py (HTMLLogFile): make this behave like + the new LogFile class, so upgrading works properly + * buildbot/test/test_web.py (WebTest.test_logfile): validate HTML + logs too + * buildbot/test/test_status.py (Log.testAdd): validate hasContents + (Log.testUpgrade): same + * docs/buildbot.texinfo (Maintenance): describe how to delete old Builds and logs with a cron job. From warner at users.sourceforge.net Mon May 16 00:16:31 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 16 May 2005 00:16:31 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_web.py,1.15,1.16 test_status.py,1.17,1.18 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6343/buildbot/test Modified Files: test_web.py test_status.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-175 Creator: Brian Warner fix HTMLLog to match new LogFile behavior * buildbot/status/builder.py (HTMLLogFile): make this behave like the new LogFile class, so upgrading works properly * buildbot/test/test_web.py (WebTest.test_logfile): validate HTML logs too * buildbot/test/test_status.py (Log.testAdd): validate hasContents (Log.testUpgrade): same Index: test_status.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_status.py,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- test_status.py 15 May 2005 23:43:57 -0000 1.17 +++ test_status.py 16 May 2005 00:16:28 -0000 1.18 @@ -367,6 +367,10 @@ "Some text\nSome error\nSome more text\n") self.failUnlessEqual(len(list(l.getChunks())), 4) + self.failUnless(l.hasContents()) + os.unlink(l.getFilename()) + self.failIf(l.hasContents()) + def testMerge1(self): l = MyLog(self.basedir, "merge1") l.addHeader("HEADER\n") @@ -451,6 +455,7 @@ l.addStdout("Some more text\n") l.addStdout("more\n") l.finish() + self.failUnless(l.hasContents()) # now doctor it to look like a 0.6.4-era non-upgraded logfile l.entries = list(l.getChunks()) del l.filename @@ -471,6 +476,7 @@ "Some text\nSome more text\nmore\n") self.failUnlessEqual(len(list(l.getChunks())), 2) self.failIf(l.entries) + self.failUnless(l.hasContents()) def testSubscribe(self): l1 = MyLog(self.basedir, "subscribe1") Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- test_web.py 14 May 2005 05:31:30 -0000 1.15 +++ test_web.py 16 May 2005 00:16:28 -0000 1.16 @@ -238,9 +238,13 @@ bs.addStep(step1) bs.buildStarted(build1) step1.step_status.stepStarted() - loog = step1.addLog("output") - loog.addStdout("some stdout\n") - loog.finish() + + log1 = step1.addLog("output") + log1.addStdout("some stdout\n") + log1.finish() + + log2 = step1.addHTMLLog("error", "ouch") + step1.step_status.stepFinished(builder.SUCCESS) bs.buildFinished() @@ -255,3 +259,9 @@ d = client.getPage(logurl + "/text") logtext = dr(d, 5) self.failUnlessEqual(logtext, "some stdout\n") + + logurl = "http://localhost:%d/builder1/builds/0/setup/1" % port + d = client.getPage(logurl) + logbody = dr(d, 5) + self.failUnlessEqual(logbody, "ouch") + From warner at users.sourceforge.net Mon May 16 00:16:31 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 16 May 2005 00:16:31 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status builder.py,1.55,1.56 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6343/buildbot/status Modified Files: builder.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-175 Creator: Brian Warner fix HTMLLog to match new LogFile behavior * buildbot/status/builder.py (HTMLLogFile): make this behave like the new LogFile class, so upgrading works properly * buildbot/test/test_web.py (WebTest.test_logfile): validate HTML logs too * buildbot/test/test_status.py (Log.testAdd): validate hasContents (Log.testUpgrade): same Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- builder.py 15 May 2005 23:43:57 -0000 1.55 +++ builder.py 16 May 2005 00:16:29 -0000 1.56 @@ -430,9 +430,12 @@ class HTMLLogFile: __implements__ = interfaces.IStatusLog, + filename = None - def __init__(self, parent, html): + def __init__(self, parent, name, logfilename, html): self.step = parent + self.name = name + self.filename = logfilename self.html = html def getName(self): @@ -445,6 +448,8 @@ def waitUntilFinished(self): return defer.succeed(self) + def hasContents(self): + return True def getText(self): return self.html # looks kinda like text def getTextWithHeaders(self): @@ -687,8 +692,8 @@ def addHTMLLog(self, name, html): assert self.started # addLog before stepStarted won't notify watchers - log = HTMLLogFile(self, html) - log.name = name + logfilename = self.build.generateLogfileName(self.name, name) + log = HTMLLogFile(self, name, logfilename, html) self.logs.append(log) for w in self.watchers: receiver = w.logStarted(self.build, self, log) From warner at users.sourceforge.net Mon May 16 00:31:55 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 16 May 2005 00:31:55 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.435,1.436 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9105 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-177 Creator: Brian Warner survive resumeProducing after we've exhausted the chunkGenerator Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.435 retrieving revision 1.436 diff -u -d -r1.435 -r1.436 --- ChangeLog 16 May 2005 00:16:28 -0000 1.435 +++ ChangeLog 16 May 2005 00:31:53 -0000 1.436 @@ -2,6 +2,9 @@ * buildbot/status/builder.py (HTMLLogFile): make this behave like the new LogFile class, so upgrading works properly + (LogFileProducer.resumeProducing): survive resumeProducing after + we've exhausted the chunkGenerator + * buildbot/test/test_web.py (WebTest.test_logfile): validate HTML logs too * buildbot/test/test_status.py (Log.testAdd): validate hasContents From warner at users.sourceforge.net Mon May 16 00:31:56 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 16 May 2005 00:31:56 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status builder.py,1.56,1.57 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9105/buildbot/status Modified Files: builder.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-177 Creator: Brian Warner survive resumeProducing after we've exhausted the chunkGenerator Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- builder.py 16 May 2005 00:16:29 -0000 1.56 +++ builder.py 16 May 2005 00:31:53 -0000 1.57 @@ -149,6 +149,8 @@ def resumeProducing(self): self.paused = False + if not self.chunkGenerator: + return try: while not self.paused: chunk = self.chunkGenerator.next() From warner at users.sourceforge.net Mon May 16 08:50:25 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 16 May 2005 08:50:25 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.437,1.438 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21467 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-181 Creator: Brian Warner try to make test_slavecommand.Shell.testShellZ not fail on win32 * buildbot/test/test_slavecommand.py (Shell.testShellZ): add a second win32 error message Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.437 retrieving revision 1.438 diff -u -d -r1.437 -r1.438 --- ChangeLog 16 May 2005 08:42:11 -0000 1.437 +++ ChangeLog 16 May 2005 08:50:23 -0000 1.438 @@ -1,5 +1,8 @@ 2005-05-16 Brian Warner + * buildbot/test/test_slavecommand.py (Shell.testShellZ): add a + second win32 error message + * buildbot/test/test_run.py (Status.testSlave): be smarter about validating the ETA, so the tests don't fail on slow systems From warner at users.sourceforge.net Mon May 16 08:42:13 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 16 May 2005 08:42:13 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.436,1.437 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20152 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-179 Creator: Brian Warner reduce timing-sensitivity of test_run.Status.testSlave * buildbot/test/test_run.py (Status.testSlave): be smarter about validating the ETA, so the tests don't fail on slow systems Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.436 retrieving revision 1.437 diff -u -d -r1.436 -r1.437 --- ChangeLog 16 May 2005 00:31:53 -0000 1.436 +++ ChangeLog 16 May 2005 08:42:11 -0000 1.437 @@ -1,3 +1,8 @@ +2005-05-16 Brian Warner + + * buildbot/test/test_run.py (Status.testSlave): be smarter about + validating the ETA, so the tests don't fail on slow systems + 2005-05-15 Brian Warner * buildbot/status/builder.py (HTMLLogFile): make this behave like From warner at users.sourceforge.net Mon May 16 08:42:13 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 16 May 2005 08:42:13 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_run.py,1.30,1.31 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20152/buildbot/test Modified Files: test_run.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-179 Creator: Brian Warner reduce timing-sensitivity of test_run.Status.testSlave * buildbot/test/test_run.py (Status.testSlave): be smarter about validating the ETA, so the tests don't fail on slow systems Index: test_run.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_run.py,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- test_run.py 4 May 2005 06:44:31 -0000 1.30 +++ test_run.py 16 May 2005 08:42:10 -0000 1.31 @@ -466,6 +466,7 @@ steps = b.getSteps() self.failUnlessEqual(len(steps), 2) + eta = 0 st1 = steps[0] self.failUnlessEqual(st1.getName(), "dummy") self.failUnless(st1.isFinished()) @@ -474,6 +475,7 @@ self.failUnless(0.5 < (finish-start) < 10) self.failUnlessEqual(st1.getExpectations(), []) self.failUnlessEqual(st1.getLogs(), []) + eta += finish-start st2 = steps[1] self.failUnlessEqual(st2.getName(), "remote dummy") @@ -482,6 +484,7 @@ ["remote", "delay", "2 secs"]) start,finish = st2.getTimes() self.failUnless(1.5 < (finish-start) < 10) + eta += finish-start self.failUnlessEqual(st2.getExpectations(), [('output', 38, None)]) logs = st2.getLogs() self.failUnlessEqual(len(logs), 1) @@ -498,7 +501,9 @@ d = bc.getStatus().waitUntilFinished() res = dr(d) - self.failUnless(3.0 < t4.eta_build < 5.0) # should be 4 seconds + self.failUnless(eta-1 < t4.eta_build < eta+1, # should be 3 seconds + "t4.eta_build was %g, not in (%g,%g)" + % (t4.eta_build, eta-1, eta+1)) class BuilderNames(unittest.TestCase): From warner at users.sourceforge.net Mon May 16 08:50:26 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 16 May 2005 08:50:26 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_slavecommand.py,1.13,1.14 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21467/buildbot/test Modified Files: test_slavecommand.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-181 Creator: Brian Warner try to make test_slavecommand.Shell.testShellZ not fail on win32 * buildbot/test/test_slavecommand.py (Shell.testShellZ): add a second win32 error message Index: test_slavecommand.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_slavecommand.py,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- test_slavecommand.py 12 May 2005 20:09:26 -0000 1.13 +++ test_slavecommand.py 16 May 2005 08:50:23 -0000 1.14 @@ -181,7 +181,9 @@ got = self.getfile('stdout') + self.getfile('stderr') self.failUnless(re.search(r'no such file', got, re.I) # unix or re.search(r'cannot find the path specified', - got, re.I), # win32 + got, re.I) # win32 + or re.search(r'is not recognized as', + got, re.I), # other win32 "bogus command didn't create the expected error " "message, got '%s'" % got ) From warner at users.sourceforge.net Tue May 17 03:36:56 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 03:36:56 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.21,1.22 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1572/buildbot/scripts Modified Files: runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-183 Creator: Brian Warner fix some minor test problems * buildbot/test/test_web.py (WebTest.tearDown): factor out master shutdown (WebTest.test_logfile): make sure master gets shut down, silences some "unclean reactor" test errors * buildbot/test/test_changes.py (Sender.tearDown): spin the reactor once after shutdown, something in certain versions of Twisted trigger a test failure. 1.3.0 is ok, 2.0.0 fails, 2.0.1pre fails, svn-trunk is ok. Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- runner.py 12 May 2005 20:55:14 -0000 1.21 +++ runner.py 17 May 2005 03:36:54 -0000 1.22 @@ -473,6 +473,8 @@ def sendchange(config, runReactor=False): + """Send a single change to the buildmaster's PBChangeSource. The + connection will be drpoped as soon as the Change has been sent.""" from buildbot.clients.sendchange import Sender opts = loadOptions() From warner at users.sourceforge.net Tue May 17 03:36:57 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 03:36:57 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_changes.py,1.3,1.4 test_web.py,1.16,1.17 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1572/buildbot/test Modified Files: test_changes.py test_web.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-183 Creator: Brian Warner fix some minor test problems * buildbot/test/test_web.py (WebTest.tearDown): factor out master shutdown (WebTest.test_logfile): make sure master gets shut down, silences some "unclean reactor" test errors * buildbot/test/test_changes.py (Sender.tearDown): spin the reactor once after shutdown, something in certain versions of Twisted trigger a test failure. 1.3.0 is ok, 2.0.0 fails, 2.0.1pre fails, svn-trunk is ok. Index: test_changes.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_changes.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- test_changes.py 4 May 2005 02:09:38 -0000 1.3 +++ test_changes.py 17 May 2005 03:36:54 -0000 1.4 @@ -2,7 +2,7 @@ from twisted.trial import unittest dr = unittest.deferredResult -from twisted.internet import defer +from twisted.internet import defer, reactor from twisted.python import log from buildbot import master @@ -58,6 +58,16 @@ self.failUnlessEqual(c3.comments, "mixed changes") self.failUnlessEqual(c3.who, "alice") +config_empty = """ +from buildbot.changes import pb +c = {} +c['bots'] = [] +c['builders'] = [] +c['sources'] = [] +c['slavePortnum'] = 0 +BuildmasterConfig = c +""" + config_sender = """ from buildbot.changes import pb c = {} @@ -74,9 +84,15 @@ def tearDown(self): d = defer.maybeDeferred(self.master.stopService) dr(d) + # TODO: something in Twisted-2.0.0 (and probably 2.0.1) doesn't shut + # down the Broker listening socket when it's supposed to. + # Twisted-1.3.0, and current SVN (which will be post-2.0.1) are ok. + # This iterate() is a quick hack to deal with the problem. I need to + # investigate more thoroughly and find a better solution. + reactor.iterate() def testSender(self): - d = self.master.loadConfig(config_sender) + d = self.master.loadConfig(config_empty) dr(d) self.master.startService() # TODO: BuildMaster.loadChanges replaces the change_svc object, so we Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- test_web.py 16 May 2005 00:16:28 -0000 1.16 +++ test_web.py 17 May 2005 03:36:54 -0000 1.17 @@ -72,6 +72,8 @@ class WebTest(unittest.TestCase): + master = None + def failUnlessIn(self, substr, string): self.failUnless(string.find(substr) != -1) @@ -79,6 +81,9 @@ # grr. from twisted.protocols import http http._logDateTimeStop() + if self.master: + d = self.master.stopService() + dr(d) def find_waterfall(self, master): return filter(lambda child: isinstance(child, html.Waterfall), @@ -97,7 +102,7 @@ } """ os.mkdir("test_web1") - m = ConfiguredMaster("test_web1", config) + self.master = m = ConfiguredMaster("test_web1", config) m.startService() # hack to find out what randomly-assigned port it is listening on port = list(self.find_waterfall(m)[0])[0]._port.getHost().port @@ -106,7 +111,6 @@ page = dr(d, 10) #print page self.failUnless(page) - dr(m.stopService()) def test_webPathname(self): # running a t.web.distrib server over a UNIX socket @@ -123,7 +127,7 @@ } """ os.mkdir("test_web2") - m = ConfiguredMaster("test_web2", config) + self.master = m = ConfiguredMaster("test_web2", config) m.startService() p = DistribUNIX("test_web2/.web-pb") @@ -133,7 +137,6 @@ #print page self.failUnless(page) dr(p.shutdown()) - dr(m.stopService()) def test_webPathname_port(self): @@ -149,7 +152,7 @@ } """ os.mkdir("test_web3") - m = ConfiguredMaster("test_web3", config) + self.master = m = ConfiguredMaster("test_web3", config) m.startService() dport = list(self.find_waterfall(m)[0])[0]._port.getHost().port @@ -159,7 +162,6 @@ page = dr(d, 10) self.failUnlessIn("BuildBot", page) dr(p.shutdown()) - dr(m.stopService()) def test_waterfall(self): # this is the right way to configure the Waterfall status @@ -176,7 +178,7 @@ """ os.mkdir("test_web4") os.mkdir("my-maildir"); os.mkdir("my-maildir/new") - m = ConfiguredMaster("test_web4", config1) + self.master = m = ConfiguredMaster("test_web4", config1) m.startService() # hack to find out what randomly-assigned port it is listening on port = list(self.find_waterfall(m)[0])[0]._port.getHost().port @@ -207,8 +209,6 @@ self.failUnlessIn("
  • Syncmail mailing list in maildir " + "my-maildir
  • ", changes) - dr(m.stopService()) - def test_logfile(self): config = """ from buildbot.status import html @@ -224,7 +224,7 @@ } """ os.mkdir("test_web5") - m = ConfiguredMaster("test_web5", config) + self.master = m = ConfiguredMaster("test_web5", config) m.startService() # hack to find out what randomly-assigned port it is listening on port = list(self.find_waterfall(m)[0])[0]._port.getHost().port From warner at users.sourceforge.net Tue May 17 03:36:57 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 03:36:57 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.438,1.439 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1572 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-183 Creator: Brian Warner fix some minor test problems * buildbot/test/test_web.py (WebTest.tearDown): factor out master shutdown (WebTest.test_logfile): make sure master gets shut down, silences some "unclean reactor" test errors * buildbot/test/test_changes.py (Sender.tearDown): spin the reactor once after shutdown, something in certain versions of Twisted trigger a test failure. 1.3.0 is ok, 2.0.0 fails, 2.0.1pre fails, svn-trunk is ok. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.438 retrieving revision 1.439 diff -u -d -r1.438 -r1.439 --- ChangeLog 16 May 2005 08:50:23 -0000 1.438 +++ ChangeLog 17 May 2005 03:36:55 -0000 1.439 @@ -1,5 +1,15 @@ 2005-05-16 Brian Warner + * buildbot/test/test_web.py (WebTest.tearDown): factor out master + shutdown + (WebTest.test_logfile): make sure master gets shut down, silences + some "unclean reactor" test errors + + * buildbot/test/test_changes.py (Sender.tearDown): spin the + reactor once after shutdown, something in certain versions of + Twisted trigger a test failure. 1.3.0 is ok, 2.0.0 fails, 2.0.1pre + fails, svn-trunk is ok. + * buildbot/test/test_slavecommand.py (Shell.testShellZ): add a second win32 error message From warner at users.sourceforge.net Tue May 17 04:41:00 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 04:41:00 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.439,1.440 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10352 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-185 Creator: Brian Warner add retry-VC-checkout control (SF#1200395) Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-29 Merged from arch at buildbot.sf.net--2004 (patch 175-184) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-30 add retry-VC-checkout control (SF#1200395) Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.439 retrieving revision 1.440 diff -u -d -r1.439 -r1.440 --- ChangeLog 17 May 2005 03:36:55 -0000 1.439 +++ ChangeLog 17 May 2005 04:40:58 -0000 1.440 @@ -1,5 +1,15 @@ 2005-05-16 Brian Warner + * buildbot/process/step.py (Source): add 'retry' argument. It is a + tuple of (delay, repeats). + * buildbot/test/test_vc.py (Retry): test it + * docs/buildbot.texinfo (Source Checkout): document it + * buildbot/slave/commands.py (SourceBase): add 'retry' parameter. + (SourceBase.maybeDoVCRetry): If 'retry' is set, failures in + doVCFull() are handled by re-trying the checkout (after a delay) + some number of times. + (ShellCommand._startCommand): make header lines easier to read + * buildbot/test/test_web.py (WebTest.tearDown): factor out master shutdown (WebTest.test_logfile): make sure master gets shut down, silences From warner at users.sourceforge.net Tue May 17 04:41:01 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 04:41:01 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_vc.py,1.28,1.29 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10352/buildbot/test Modified Files: test_vc.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-185 Creator: Brian Warner add retry-VC-checkout control (SF#1200395) Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-29 Merged from arch at buildbot.sf.net--2004 (patch 175-184) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-30 add retry-VC-checkout control (SF#1200395) Index: test_vc.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- test_vc.py 6 May 2005 06:40:04 -0000 1.28 +++ test_vc.py 17 May 2005 04:40:58 -0000 1.29 @@ -227,13 +227,13 @@ from twisted.protocols import http http._logDateTimeStop() # shut down the internal timer. DUMB! - def doBuild(self): + def doBuild(self, shouldSucceed=True): c = interfaces.IControl(self.master) bc = c.getBuilder("vc").forceBuild(None, "test_vc forced build") b = dr(bc.getStatus().waitUntilFinished()) r = b.getResults() - if r != SUCCESS: + if r != SUCCESS and shouldSucceed: assert b.isFinished() print print @@ -246,6 +246,7 @@ print "--- STOP ---" print self.fail("build did not succeed") + return b def touch(self, d, f): open(os.path.join(d,f),"w").close() @@ -261,7 +262,7 @@ # woo double-substitution s = "s(%s, timeout=200, workdir='build', mode='%%s'" % (vctype,) for k,v in args.items(): - s += ", %s='%s'" % (k, v) + s += ", %s=%s" % (k, repr(v)) s += ")" config = config_vc % s @@ -428,7 +429,7 @@ def testBazaarHTTP(self): if not VCS.have['baz']: - raise unittest.SkipTest("Arch (tla) is not installed") + raise unittest.SkipTest("Arch (baz) is not installed") self.do_vc("step.Bazaar", { 'url': VCS.Repository_HTTP % self.httpPort + "/Arch-Repository", 'archive': "test at buildbot.sf.net--testvc", @@ -436,10 +437,108 @@ }, testRetry=False) os.system("baz register-archive -d test at buildbot.sf.net--testvc") -class Patch(SetupMixin, unittest.TestCase): - def failUnlessIn(self, substr, string): - self.failUnless(string.find(substr) != -1) +class Retry(SetupMixin, unittest.TestCase): + fixtimer = None + def serveHTTP(self): + # launch an HTTP server to serve the repository files + from twisted.web import static, server + from twisted.internet import reactor + self.root = static.File(VCS.RepositoryPath) + self.site = server.Site(self.root) + self.httpServer = reactor.listenTCP(0, self.site) + self.httpPort = self.httpServer.getHost().port + + def fixRepository(self): + self.fixtimer = None + self.site.resource = self.root + + def testRetry_BazaarHTTP(self): + # we want to verify that step.Source(retry=) works, and the easiest + # way to make VC updates break (temporarily) is to break the HTTP + # server that's providing the repository. Anything else pretty much + # requires mutating the (read-only) BUILDBOT_TEST_VC repository, or + # modifying the buildslave's checkout command while it's running. + if not VCS.have['baz']: + raise unittest.SkipTest("Arch (baz) is not installed") + + # break the repository server + from twisted.web import static + self.site.resource = static.Data("Sorry, repository is offline", + "text/plain") + # and arrange to fix it again in 5 seconds, while the test is + # running. + self.fixtimer = reactor.callLater(5, self.fixRepository) + + b = self.do_vc_once("step.Bazaar", { + 'url': VCS.Repository_HTTP % self.httpPort + "/Arch-Repository", + 'archive': "test at buildbot.sf.net--testvc", + 'version': "testvc--mainline--1", + 'retry': (5.0, 4), + }, shouldSucceed=True) + + workdir = os.path.join(self.slavebase, "vc-dir", "build") + self.shouldExist(workdir, "Makefile") + + # make sure there was mention of the retry attempt in the logs + l = b.getLogs()[0] + self.failUnlessIn("unable to access URL", l.getText(), + "funny, VC operation didn't fail at least once") + self.failUnlessIn("update failed, trying 4 more times after 5 seconds", + l.getTextWithHeaders(), + "funny, VC operation wasn't reattempted") + + os.system("baz register-archive -d test at buildbot.sf.net--testvc") + + def testFails_BazaarHTTP(self): + # make sure that the build eventually gives up on a repository which + # is completely unavailable + + if not VCS.have['baz']: + raise unittest.SkipTest("Arch (baz) is not installed") + + # break the repository server, and leave it broken + from twisted.web import static + self.site.resource = static.Data("Sorry, repository is offline", + "text/plain") + + b = self.do_vc_once("step.Bazaar", { + 'url': VCS.Repository_HTTP % self.httpPort + "/Arch-Repository", + 'archive': "test at buildbot.sf.net--testvc", + 'version': "testvc--mainline--1", + 'retry': (0.5, 3), + }, shouldSucceed=False) + os.system("baz register-archive -d test at buildbot.sf.net--testvc " + "2>/dev/null") + + self.failUnlessEqual(b.getResults(), builder.FAILURE) + + + def do_vc_once(self, vctype, args, shouldSucceed): + m = self.master + vcdir = os.path.join(self.slavebase, "vc-dir", "source") + workdir = os.path.join(self.slavebase, "vc-dir", "build") + # woo double-substitution + s = "s(%s, timeout=200, workdir='build', mode='clobber'" % (vctype,) + for k,v in args.items(): + s += ", %s=%s" % (k, repr(v)) + s += ")" + config = config_vc % s + + m.loadConfig(config) + m.readConfig = True + m.startService() + + self.connectSlave() + b = self.doBuild(shouldSucceed) # initial checkout + return b + + def tearDown(self): + if self.fixtimer: + self.fixtimer.cancel() + SetupMixin.tearDown(self) + +class Patch(SetupMixin, unittest.TestCase): def doPatch(self, vc, revision, **kwargs): m = self.master config = config_vc % "(step.Dummy)" From warner at users.sourceforge.net Tue May 17 04:40:59 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 04:40:59 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process step.py,1.65,1.66 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10352/buildbot/process Modified Files: step.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-185 Creator: Brian Warner add retry-VC-checkout control (SF#1200395) Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-29 Merged from arch at buildbot.sf.net--2004 (patch 175-184) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-30 add retry-VC-checkout control (SF#1200395) Index: step.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step.py,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- step.py 10 May 2005 08:10:36 -0000 1.65 +++ step.py 17 May 2005 04:40:55 -0000 1.66 @@ -850,7 +850,7 @@ notReally = False def __init__(self, workdir, mode='update', alwaysUseLatest=False, - timeout=20*60, **kwargs): + timeout=20*60, retry=None, **kwargs): """ @type workdir: string @param workdir: local directory (relative to the Builder's root) @@ -918,13 +918,29 @@ buildmaster thinks it has (possibly resulting in the wrong person taking the blame for any problems that result), at worst is can result in an incoherent set of sources (splitting a - non-atomic commit) which may not build at all. """ + non-atomic commit) which may not build at all. + + @type retry: tuple of ints (delay, repeats) (or None) + @param retry: if provided, VC update failures are re-attempted up + to REPEATS times, with DELAY seconds between each + attempt. Some users have slaves with poor connectivity + to their VC repository, and they say that up to 80% of + their build failures are due to transient network + failures that could be handled by simply retrying a + couple times. + + """ BuildStep.__init__(self, **kwargs) assert mode in ("update", "copy", "clobber", "export") + if retry: + delay, repeats = retry + assert type(repeats) is int + assert repeats > 0 self.args = {'mode': mode, 'workdir': workdir, 'timeout': timeout, + 'retry': retry, 'patch': None, # set during .start } self.alwaysUseLatest = alwaysUseLatest From warner at users.sourceforge.net Tue May 17 04:41:01 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 04:41:01 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.32,1.33 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10352/buildbot/slave Modified Files: commands.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-185 Creator: Brian Warner add retry-VC-checkout control (SF#1200395) Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-29 Merged from arch at buildbot.sf.net--2004 (patch 175-184) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-30 add retry-VC-checkout control (SF#1200395) Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- commands.py 13 May 2005 23:15:34 -0000 1.32 +++ commands.py 17 May 2005 04:40:59 -0000 1.33 @@ -14,6 +14,7 @@ # version history: # >=1.17: commands are interruptable # >=1.28: Arch understands 'revision', added Bazaar +# >=1.33: Source classes understand 'retry' class CommandInterrupted(Exception): pass @@ -197,24 +198,24 @@ # obtain the same results. If there are spaces in the arguments, too # bad. msg = " ".join(argv) - log.msg(" " + msg) + log.msg(" " + msg) self.sendStatus({'header': msg+"\n"}) # then comes the secondary information - msg = "in dir %s" % (self.workdir,) + msg = " in dir %s" % (self.workdir,) if self.timeout: msg += " (timeout %d secs)" % (self.timeout,) - log.msg(" " + msg) + log.msg(" " + msg) self.sendStatus({'header': msg+"\n"}) # then the argv array for resolving unambiguity - msg = "argv: %s" % (argv,) - log.msg(" " + msg) + msg = " argv: %s" % (argv,) + log.msg(" " + msg) self.sendStatus({'header': msg+"\n"}) # then the environment, since it sometimes causes problems - msg = "environment: %s" % (self.environ,) - log.msg(" " + msg) + msg = " environment: %s" % (self.environ,) + log.msg(" " + msg) self.sendStatus({'header': msg+"\n"}) self.process = reactor.spawnProcess(self.pp, argv[0], argv, @@ -535,8 +536,14 @@ STRIPLEVEL substituted as %d. The command will fail if the patch process fails (rejected hunks). - - ['timeout']: seconds of silence tolerated before we kill of the + - ['timeout']: seconds of silence tolerated before we kill off the command + + - ['retry']: If not None, this is a tuple of (delay, repeats) + which means that any failed VC updates should be + reattempted, up to REPEATS times, after a delay of + DELAY seconds. This is intended to deal with slaves + that experience transient network failures. """ def setup(self, args): @@ -545,6 +552,7 @@ self.revision = args.get('revision') self.patch = args.get('patch') self.timeout = args.get('timeout', 120) + self.retry = args.get('retry') # VC-specific subclasses should override this to extract more args. # Make sure to upcall! @@ -583,11 +591,14 @@ self.command.kill("command interrupted") def doVC(self, res): + if self.interrupted: + raise AbandonChain(1) if self.sourcedirIsUpdateable(): d = self.doVCUpdate() d.addCallback(self.maybeDoVCFallback) else: d = self.doVCFull() + d.addBoth(self.maybeDoVCRetry) d.addCallback(self._abandonOnFailure) return d @@ -614,9 +625,45 @@ self.sendStatus({'header': msg + "\n"}) log.msg(msg) d = self.doVCFull() + d.addBoth(self.maybeDoVCRetry) d.addCallback(self._abandonOnFailure) return d + def maybeDoVCRetry(self, res): + """We get here somewhere after a VC chain has finished. res could + be:: + + - 0: the operation was successful + - nonzero: the operation failed. retry if possible + - AbandonChain: the operation failed, someone else noticed. retry. + - Failure: some other exception, re-raise + """ + + if isinstance(res, failure.Failure): + if self.interrupted: + return res # don't re-try interrupted builds + res.trap(AbandonChain) + else: + if type(res) is int and res == 0: + return res + if self.interrupted: + raise AbandonChain(1) + # if we get here, we should retry, if possible + if self.retry: + delay, repeats = self.retry + if repeats >= 0: + self.retry = (delay, repeats-1) + msg = ("update failed, trying %d more times after %d seconds" + % (repeats, delay)) + self.sendStatus({'header': msg + "\n"}) + log.msg(msg) + d = defer.Deferred() + d.addCallback(lambda res: self.doVCFull()) + d.addBoth(self.maybeDoVCRetry) + reactor.callLater(delay, d.callback, None) + return d + return res + def doClobber(self, dummy, dirname): # TODO: remove the old tree in the background ## workdir = os.path.join(self.builder.basedir, self.workdir) From warner at users.sourceforge.net Tue May 17 04:41:00 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 04:41:00 +0000 Subject: [Buildbot-commits] buildbot/docs buildbot.texinfo,1.3,1.4 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10352/docs Modified Files: buildbot.texinfo Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-185 Creator: Brian Warner add retry-VC-checkout control (SF#1200395) Patches applied: * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-29 Merged from arch at buildbot.sf.net--2004 (patch 175-184) * warner at monolith.lothar.com--2005/buildbot--dev--0--patch-30 add retry-VC-checkout control (SF#1200395) Index: buildbot.texinfo =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/buildbot.texinfo,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- buildbot.texinfo 15 May 2005 23:51:18 -0000 1.3 +++ buildbot.texinfo 17 May 2005 04:40:57 -0000 1.4 @@ -2022,6 +2022,14 @@ if True, bypass the usual ``update to the last Change'' behavior, and always update to the latest changes instead. + at item retry +If set, this specifies a tuple of @code{(delay, repeats)} which means +that when a full VC checkout fails, it should be retried up to + at var{repeats} times, waiting @var{delay} seconds between attempts. If +you don't provide this, it defaults to @code{None}, which means VC +operations should not be retried. This is provided to make life easier +for buildslaves which are stuck behind poor network connections. + @end table From warner at users.sourceforge.net Tue May 17 10:14:12 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 10:14:12 +0000 Subject: [Buildbot-commits] buildbot/buildbot twcompat.py,NONE,1.1 master.py,1.71,1.72 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9810/buildbot Modified Files: master.py Added Files: twcompat.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-187 Creator: Brian Warner fix deprecation warnings in test suite * everything: fixed all deprecation warnings when running against Twisted-2.0 . (at least all the ones in buildbot code, there are a few that come from Twisted itself). This involved putting most of the Twisted-version specific code in the new buildbot.twcompat module, and creating some abstract base classes in buildbot.changes.base and buildbot.status.base (which might be useful anyway). __implements__ is a nuisance and requires an ugly 'if' clause everywhere. * buildbot/test/test_status.py (Mail.testMail): add a 0.1 second delay before finishing the test: it seems that smtp.sendmail doesn't hang up on the server, so we must wait a moment so it can hang up on us. This removes the trial warning about an unclean reactor. Index: master.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- master.py 6 May 2005 05:01:11 -0000 1.71 +++ master.py 17 May 2005 10:14:10 -0000 1.72 @@ -21,6 +21,7 @@ # sibling imports from buildbot import util +from buildbot.twcompat import implements from buildbot.util import now from buildbot.pbutil import NewCredPerspective from buildbot.process.interlock import Interlock @@ -513,7 +514,10 @@ print "debug", msg class Dispatcher(styles.Versioned): - __implements__ = portal.IRealm + if implements: + implements(portal.IRealm) + else: + __implements__ = portal.IRealm, persistenceVersion = 2 def __init__(self): @@ -1000,7 +1004,10 @@ class Control: - __implements__ = interfaces.IControl, + if implements: + implements(interfaces.IControl) + else: + __implements__ = interfaces.IControl, def __init__(self, master): self.master = master --- NEW FILE: twcompat.py --- from twisted.python import components """ utilities to be compatible with both Twisted-1.3 and 2.0 implements. Use this like: from buildbot.tcompat import implements class Foo: if implements: implements(IFoo) else: __implements__ = IFoo, Interface: from buildbot.tcompat import Interface class IFoo(Interface) providedBy: from buildbot.tcompat import providedBy assert providedBy(obj, IFoo) """ # does our Twisted use zope.interface? if hasattr(components, "interface"): # yes from zope.interface import implements from zope.interface import Interface def providedBy(obj, iface): return iface.providedBy(obj) else: # nope implements = None from twisted.python.components import Interface providedBy = components.implements From warner at users.sourceforge.net Tue May 17 10:14:11 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 10:14:11 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status base.py,NONE,1.1 client.py,1.17,1.18 html.py,1.63,1.64 words.py,1.35,1.36 builder.py,1.57,1.58 mail.py,1.15,1.16 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9810/buildbot/status Modified Files: client.py html.py words.py builder.py mail.py Added Files: base.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-187 Creator: Brian Warner fix deprecation warnings in test suite * everything: fixed all deprecation warnings when running against Twisted-2.0 . (at least all the ones in buildbot code, there are a few that come from Twisted itself). This involved putting most of the Twisted-version specific code in the new buildbot.twcompat module, and creating some abstract base classes in buildbot.changes.base and buildbot.status.base (which might be useful anyway). __implements__ is a nuisance and requires an ugly 'if' clause everywhere. * buildbot/test/test_status.py (Mail.testMail): add a 0.1 second delay before finishing the test: it seems that smtp.sendmail doesn't hang up on the server, so we must wait a moment so it can hang up on us. This removes the trial warning about an unclean reactor. --- NEW FILE: base.py --- #! /usr/bin/python from twisted.application import service from twisted.python import components try: from zope.interface import implements except ImportError: implements = None if not hasattr(components, "interface"): implements = None # nope from buildbot.interfaces import IStatusReceiver from buildbot import util, pbutil class StatusReceiver: if implements: implements(IStatusReceiver) else: __implements__ = IStatusReceiver, def builderAdded(self, builderName, builder): pass def builderChangedState(self, builderName, state, eta=None): pass def buildStarted(self, builderName, build): pass def buildETAUpdate(self, build, ETA): pass def stepStarted(self, build, step): pass def stepETAUpdate(self, build, step, ETA, expectations): pass def logStarted(self, build, step, log): pass def logChunk(self, build, step, log, channel, text): pass def logFinished(self, build, step, log): pass def stepFinished(self, build, step, results): pass def buildFinished(self, builderName, build, results): pass def builderRemoved(self, builderName): pass class StatusReceiverMultiService(service.MultiService, util.ComparableMixin): if implements: implements(IStatusReceiver) else: __implements__ = IStatusReceiver, service.MultiService.__implements__ class StatusReceiverPerspective(StatusReceiver, pbutil.NewCredPerspective): if implements: implements(IStatusReceiver) else: __implements__ = (IStatusReceiver, pbutil.NewCredPerspective.__implements__) Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- builder.py 16 May 2005 00:31:53 -0000 1.57 +++ builder.py 17 May 2005 10:14:09 -0000 1.58 @@ -2,7 +2,7 @@ from __future__ import generators -from twisted.python import log, components +from twisted.python import log from twisted.persisted import styles from twisted.internet import reactor, defer from twisted.protocols import basic @@ -15,6 +15,7 @@ # sibling imports from buildbot import interfaces, util +from buildbot.twcompat import implements SUCCESS, WARNINGS, FAILURE, SKIPPED, EXCEPTION = range(5) Results = ["success", "warnings", "failure", "skipped", "exception"] @@ -194,7 +195,11 @@ so users who go from 0.6.5 back to 0.6.4 don't have to lose their logs.""" - __implements__ = interfaces.IStatusLog, + if implements: + implements(interfaces.IStatusLog) + else: + __implements__ = interfaces.IStatusLog, + finished = False length = 0 progress = None @@ -431,7 +436,11 @@ class HTMLLogFile: - __implements__ = interfaces.IStatusLog, + if implements: + implements(interfaces.IStatusLog) + else: + __implements__ = interfaces.IStatusLog, + filename = None def __init__(self, parent, name, logfilename, html): @@ -474,7 +483,10 @@ class Event: - __implements__ = interfaces.IStatusEvent, + if implements: + implements(interfaces.IStatusEvent) + else: + __implements__ = interfaces.IStatusEvent, started = None finished = None @@ -495,7 +507,10 @@ self.finished = util.now() class TestResult: - __implements__ = interfaces.ITestResult, + if implements: + implements(interfaces.ITestResult) + else: + __implements__ = interfaces.ITestResult, def __init__(self, name, results, text, logs): assert type(name) is tuple @@ -538,7 +553,10 @@ """ # note that these are created when the Build is set up, before each # corresponding BuildStep has started. - __implements__ = interfaces.IBuildStepStatus, interfaces.IStatusEvent + if implements: + implements(interfaces.IBuildStepStatus, interfaces.IStatusEvent) + else: + __implements__ = interfaces.IBuildStepStatus, interfaces.IStatusEvent started = None finished = None @@ -753,7 +771,10 @@ class BuildStatus: - __implements__ = interfaces.IBuildStatus, interfaces.IStatusEvent + if implements: + implements(interfaces.IBuildStatus, interfaces.IStatusEvent) + else: + __implements__ = interfaces.IBuildStatus, interfaces.IStatusEvent sourceStamp = None reason = None @@ -1115,7 +1136,10 @@ used to filter on in status clients """ - __implements__ = interfaces.IBuilderStatus, + if implements: + implements(interfaces.IBuilderStatus) + else: + __implements__ = interfaces.IBuilderStatus, # these limit the amount of memory we consume, as well as the size of the # main Builder pickle. The Build and LogFile pickles on disk must be @@ -1580,7 +1604,10 @@ self.subscribers.remove(client) class SlaveStatus: - __implements__ = interfaces.ISlaveStatus, + if implements: + implements(interfaces.ISlaveStatus) + else: + __implements__ = interfaces.ISlaveStatus, admin = None host = None @@ -1602,7 +1629,10 @@ """ I represent the status of the buildmaster. """ - __implements__ = interfaces.IStatus, + if implements: + implements(interfaces.IStatus) + else: + __implements__ = interfaces.IStatus, def __init__(self, botmaster, basedir): """ Index: client.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/client.py,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- client.py 26 Apr 2005 09:08:30 -0000 1.17 +++ client.py 17 May 2005 10:14:09 -0000 1.18 @@ -8,11 +8,11 @@ from twisted.cred import portal, checkers from buildbot import util, interfaces -from buildbot.pbutil import NewCredPerspective -from buildbot.status import builder +from buildbot.twcompat import Interface, implements +from buildbot.status import builder, base from buildbot.changes import changes -class IRemote(components.Interface): +class IRemote(Interface): pass def makeRemote(obj): @@ -218,9 +218,7 @@ components.registerAdapter(RemoteChange, changes.Change, IRemote) -class StatusClientPerspective(NewCredPerspective): - __implements__ = (NewCredPerspective.__implements__, - interfaces.IStatusReceiver) +class StatusClientPerspective(base.StatusReceiverPerspective): subscribed = None client = None @@ -398,13 +396,15 @@ channel, text) -class PBListener(service.MultiService, util.ComparableMixin): +class PBListener(base.StatusReceiverMultiService): """I am a listener for PB-based status clients.""" compare_attrs = ["port", "cred"] - __implements__ = (interfaces.IStatusReceiver, - portal.IRealm, - service.MultiService.__implements__) + if implements: + implements(portal.IRealm) + else: + __implements__ = (portal.IRealm, + base.StatusReceiverMultiService.__implements__) def __init__(self, port, user="statusClient", passwd="clientpw"): service.MultiService.__init__(self) Index: html.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- html.py 15 May 2005 23:43:57 -0000 1.63 +++ html.py 17 May 2005 10:14:09 -0000 1.64 @@ -11,30 +11,32 @@ from twisted.web import static, html, server, distrib from twisted.web.error import NoResource from twisted.web.util import Redirect, DeferredResource -from twisted.application import service, internet +from twisted.application import internet from twisted.spread import pb +from buildbot.twcompat import implements, Interface + import string, types, time, os.path from buildbot import interfaces, util from buildbot import version -from buildbot.status import builder +from buildbot.status import builder, base from buildbot.changes import changes -class ITopBox(components.Interface): +class ITopBox(Interface): """I represent a box in the top row of the waterfall display: the one which shows the status of the last build for each builder.""" pass -class ICurrentBox(components.Interface): +class ICurrentBox(Interface): """I represent the 'current activity' box, just above the builder name.""" pass -class IBox(components.Interface): +class IBox(Interface): """I represent a box in the waterfall display.""" pass -class IHTMLLog(components.Interface): +class IHTMLLog(Interface): pass ROW_TEMPLATE = ''' @@ -535,7 +537,11 @@ """ class ChunkConsumer: - __implements__ = interfaces.IStatusLogConsumer, + if implements: + implements(interfaces.IStatusLogConsumer) + else: + __implements__ = interfaces.IStatusLogConsumer, + def __init__(self, original, textlog): self.original = original self.textlog = textlog @@ -556,7 +562,11 @@ class TextLog(Resource): # a new instance of this Resource is created for each client who views # it, so we can afford to track the request in the Resource. - __implements__ = IHTMLLog, + if implements: + implements(IHTMLLog) + else: + __implements__ = IHTMLLog, + asText = False subscribed = False @@ -639,7 +649,10 @@ class HTMLLog(Resource): - __implements__ = IHTMLLog, + if implements: + implements(IHTMLLog) + else: + __implements__ = IHTMLLog, def __init__(self, original): @@ -655,7 +668,10 @@ class CurrentBox(components.Adapter): # this provides the "current activity" box, just above the builder name - __implements__ = ICurrentBox, + if implements: + implements(ICurrentBox) + else: + __implements__ = ICurrentBox, def formatETA(self, eta): return time.strftime("%H:%M:%S", time.localtime(util.now()+eta)) @@ -684,7 +700,11 @@ components.registerAdapter(CurrentBox, builder.BuilderStatus, ICurrentBox) class ChangeBox(components.Adapter): - __implements__ = IBox, + if implements: + implements(IBox) + else: + __implements__ = IBox, + def getBox(self): url = "changes/%d" % self.original.number text = '%s' % (url, html.escape(self.original.who)) @@ -693,7 +713,10 @@ class BuildBox(components.Adapter): # this provides the yellow "starting line" box for each build - __implements__ = IBox, + if implements: + implements(IBox) + else: + __implements__ = IBox, def getBox(self): b = self.original @@ -713,7 +736,11 @@ components.registerAdapter(BuildBox, builder.BuildStatus, IBox) class StepBox(components.Adapter): - __implements__ = IBox, + if implements: + implements(IBox) + else: + __implements__ = IBox, + def getBox(self): b = self.original.getBuild() urlbase = "%s/builds/%d/%s" % (b.getBuilder().getName(), @@ -738,7 +765,11 @@ components.registerAdapter(StepBox, builder.BuildStepStatus, IBox) class EventBox(components.Adapter): - __implements__ = IBox, + if implements: + implements(IBox) + else: + __implements__ = IBox, + def getBox(self): text = self.original.getText() color = self.original.getColor() @@ -752,7 +783,11 @@ class BuildTopBox(components.Adapter): # this provides a per-builder box at the very top of the display, # showing the results of the most recent build - __implements__ = IBox, + if implements: + implements(IBox) + else: + __implements__ = IBox, + def getBox(self): assert interfaces.IBuilderStatus(self.original) b = self.original.getLastFinishedBuild() @@ -775,7 +810,11 @@ self.finished = finish class SpacerBox(components.Adapter): - __implements__ = IBox, + if implements: + implements(IBox) + else: + __implements__ = IBox, + def getBox(self): #b = Box(["spacer"], "white") b = Box([]) @@ -1354,10 +1393,11 @@ # the icon is sibpath(__file__, "../buildbot.png") . This is for portability. up = os.path.dirname -buildbot_icon = os.path.abspath(os.path.join(up(up(__file__)), "buildbot.png")) +buildbot_icon = os.path.abspath(os.path.join(up(up(__file__)), + "buildbot.png")) buildbot_css = os.path.abspath(os.path.join(up(__file__), "classic.css")) -class Waterfall(service.MultiService, util.ComparableMixin): +class Waterfall(base.StatusReceiverMultiService): """I implement the primary web-page status interface, called a 'Waterfall Display' because builds and steps are presented in a grid of boxes which move downwards over time. The top edge is always the present. Each column @@ -1395,8 +1435,7 @@ L{buildbot.master.BuildMaster} instance, through which the status-reporting object is acquired. """ - __implements__ = (interfaces.IStatusReceiver, - service.MultiService.__implements__) + compare_attrs = ["http_port", "distrib_port", "allowForce", "categories", "css"] @@ -1439,7 +1478,7 @@ a favicon at all. """ - service.MultiService.__init__(self) + base.StatusReceiverMultiService.__init__(self) assert allowForce in (True, False) # TODO: implement others self.http_port = http_port self.distrib_port = distrib_port @@ -1460,7 +1499,7 @@ """ @type parent: L{buildbot.master.BuildMaster} """ - service.MultiService.setServiceParent(self, parent) + base.StatusReceiverMultiService.setServiceParent(self, parent) self.setup() def setup(self): Index: mail.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/mail.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- mail.py 24 Apr 2005 21:30:25 -0000 1.15 +++ mail.py 17 May 2005 10:14:09 -0000 1.16 @@ -13,15 +13,23 @@ from twisted.internet import defer from twisted.application import service -from twisted.protocols.smtp import sendmail -from twisted.python import components, log +try: + from twisted.mail.smtp import sendmail # Twisted-2.0 +except ImportError: + from twisted.protocols.smtp import sendmail # Twisted-1.3 +from twisted.python import log from buildbot import interfaces, util +from buildbot.twcompat import implements, providedBy +from buildbot.status import base from buildbot.status.builder import FAILURE, SUCCESS, WARNINGS class Domain(util.ComparableMixin): - __implements__ = interfaces.IEmailLookup + if implements: + implements(interfaces.IEmailLookup) + else: + __implements__ = interfaces.IEmailLookup compare_attrs = ["domain"] def __init__(self, domain): @@ -32,7 +40,7 @@ return name + "@" + self.domain -class MailNotifier(service.Service, util.ComparableMixin): +class MailNotifier(base.StatusReceiverMultiService): """This is a status notifier which sends email to a list of recipients upon the completion of each build. It can be configured to only send out mail for certain builds, and only send messages when the build fails, or @@ -51,9 +59,11 @@ MailNotifiers. """ - __implements__ = (interfaces.IStatusReceiver, - interfaces.IEmailSender, - service.Service.__implements__) + if implements: + implements(interfaces.IEmailSender) + else: + __implements__ = (interfaces.IEmailSender, + base.StatusReceiverMultiService.__implements__) compare_attrs = ["extraRecipients", "lookup", "fromaddr", "mode", "categories", "builders", "addLogs", "relayhost", @@ -144,7 +154,7 @@ if lookup is not None: if type(lookup) is str: lookup = Domain(lookup) - assert components.implements(lookup, interfaces.IEmailLookup) + assert providedBy(lookup, interfaces.IEmailLookup) self.lookup = lookup self.watched = [] self.status = None @@ -158,7 +168,7 @@ """ @type parent: L{buildbot.master.BuildMaster} """ - service.Service.setServiceParent(self, parent) + base.StatusReceiverMultiService.setServiceParent(self, parent) self.setup() def setup(self): @@ -169,7 +179,7 @@ self.status.unsubscribe(self) for w in self.watched: w.unsubscribe(self) - return service.Service.disownServiceParent(self) + return base.StatusReceiverMultiService.disownServiceParent(self) def builderAdded(self, name, builder): # only subscribe to builders we are interested in Index: words.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/words.py,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- words.py 26 Apr 2005 06:35:36 -0000 1.35 +++ words.py 17 May 2005 10:14:09 -0000 1.36 @@ -6,12 +6,18 @@ import traceback, StringIO, re from twisted.internet import protocol, reactor -from twisted.protocols import irc +try: + # Twisted-2.0 + from twisted.words.protocols import irc +except ImportError: + # Twisted-1.3 + from twisted.protocols import irc from twisted.python import log, failure -from twisted.application import service, internet +from twisted.application import internet from buildbot import interfaces, util from buildbot import version +from buildbot.status import base from buildbot.status.builder import SUCCESS, WARNINGS, FAILURE class UsageError(ValueError): @@ -487,19 +493,17 @@ ThrottledClientFactory.clientConnectionFailed(self, connector, reason) -class IRC(service.MultiService, util.ComparableMixin): +class IRC(base.StatusReceiverMultiService): """I am an IRC bot which can be queried for status information. I connect to a single IRC server and am known by a single nickname on that server, however I can join multiple channels.""" compare_attrs = ["host", "port", "nick", "channels", "allowForce", "categories"] - __implements__ = (interfaces.IStatusReceiver, - service.MultiService.__implements__) def __init__(self, host, nick, channels, port=6667, allowForce=True, categories=None): - service.MultiService.__init__(self) + base.StatusReceiverMultiService.__init__(self) assert allowForce in (True, False) # TODO: implement others @@ -518,7 +522,7 @@ c.setServiceParent(self) def setServiceParent(self, parent): - service.MultiService.setServiceParent(self, parent) + base.StatusReceiverMultiService.setServiceParent(self, parent) self.f.status = parent.getStatus() if self.allowForce: self.f.control = interfaces.IControl(parent) @@ -526,7 +530,7 @@ def stopService(self): # make sure the factory will stop reconnecting self.f.shutdown() - return service.MultiService.stopService(self) + return base.StatusReceiverMultiService.stopService(self) def main(): From warner at users.sourceforge.net Tue May 17 10:14:12 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 10:14:12 +0000 Subject: [Buildbot-commits] buildbot/buildbot/changes base.py,NONE,1.1 freshcvs.py,1.19,1.20 changes.py,1.22,1.23 pb.py,1.7,1.8 p4poller.py,1.3,1.4 mail.py,1.17,1.18 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/changes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9810/buildbot/changes Modified Files: freshcvs.py changes.py pb.py p4poller.py mail.py Added Files: base.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-187 Creator: Brian Warner fix deprecation warnings in test suite * everything: fixed all deprecation warnings when running against Twisted-2.0 . (at least all the ones in buildbot code, there are a few that come from Twisted itself). This involved putting most of the Twisted-version specific code in the new buildbot.twcompat module, and creating some abstract base classes in buildbot.changes.base and buildbot.status.base (which might be useful anyway). __implements__ is a nuisance and requires an ugly 'if' clause everywhere. * buildbot/test/test_status.py (Mail.testMail): add a 0.1 second delay before finishing the test: it seems that smtp.sendmail doesn't hang up on the server, so we must wait a moment so it can hang up on us. This removes the trial warning about an unclean reactor. --- NEW FILE: base.py --- #! /usr/bin/python from twisted.application import service from twisted.python import components from buildbot.twcompat import implements from buildbot.interfaces import IChangeSource from buildbot import util class ChangeSource(service.Service, util.ComparableMixin): if implements: implements(IChangeSource) else: __implements__ = IChangeSource, service.Service.__implements__ Index: changes.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/changes.py,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- changes.py 6 May 2005 04:42:40 -0000 1.22 +++ changes.py 17 May 2005 10:14:09 -0000 1.23 @@ -15,6 +15,7 @@ from twisted.web import html from buildbot import interfaces, util +from buildbot.twcompat import implements, providedBy html_tmpl = """

    Changed by: %(who)s
    @@ -51,7 +52,11 @@ chronologically increasing order. Out-of-order changes will probably cause the html.Waterfall display to be corrupted.""" - __implements__ = interfaces.IStatusEvent, + if implements: + implements(interfaces.IStatusEvent) + else: + __implements__ = interfaces.IStatusEvent, + links = [] number = None revision = None # used to create a source-stamp @@ -175,8 +180,8 @@ self.nextNumber = 1 def addSource(self, source): - assert components.implements(source, interfaces.IChangeSource) - assert components.implements(source, service.IService) + assert providedBy(source, interfaces.IChangeSource) + assert providedBy(source, service.IService) if self.debug: print "ChangeMaster.addSource", source source.setServiceParent(self) Index: freshcvs.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/freshcvs.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- freshcvs.py 23 Sep 2004 09:10:09 -0000 1.19 +++ freshcvs.py 17 May 2005 10:14:09 -0000 1.20 @@ -9,6 +9,7 @@ import cvstoys.common # to make sure VersionedPatch gets registered +from buildbot.twcompat import implements from buildbot.interfaces import IChangeSource from buildbot.pbutil import ReconnectingPBClientFactory from buildbot.changes.changes import Change @@ -60,7 +61,10 @@ does not, later versions might. """ - __implements__ = IChangeSource, TCPClient.__implements__ + if implements: + implements(IChangeSource) + else: + __implements__ = IChangeSource, TCPClient.__implements__ compare_attrs = ["where", "prefix"] changemaster = None # filled in when we're added Index: mail.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/mail.py,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- mail.py 6 May 2005 04:42:41 -0000 1.17 +++ mail.py 17 May 2005 10:14:09 -0000 1.18 @@ -7,9 +7,8 @@ from rfc822 import Message from buildbot import util -from buildbot.interfaces import IChangeSource -from buildbot.changes.maildirtwisted import MaildirTwisted -from buildbot.changes.changes import Change +from buildbot.twcompat import implements +from buildbot.changes import base, changes, maildirtwisted def parseFreshCVSMail(self, fd, prefix=None, sep="/"): """Parse mail sent by FreshCVS""" @@ -77,7 +76,7 @@ if not files: return None - change = Change(who, files, comments, isdir, when=when) + change = changes.Change(who, files, comments, isdir, when=when) return change @@ -196,7 +195,7 @@ comments += line comments = comments.rstrip() + "\n" - change = Change(who, files, comments, isdir, when=when, tag=tag) + change = changes.Change(who, files, comments, isdir, when=when, tag=tag) return change @@ -287,20 +286,25 @@ comments = comments.rstrip() + "\n" # return buildbot Change object - return Change(who, files, comments, when=timestamp) + return changes.Change(who, files, comments, when=timestamp) -class MaildirSource(MaildirTwisted, util.ComparableMixin): +class MaildirSource(maildirtwisted.MaildirTwisted, base.ChangeSource): """This source will watch a maildir that is subscribed to a FreshCVS change-announcement mailing list. """ + # we need our own implements() here, at least for twisted-1.3, because + # the double-inheritance of Service shadows __implements__ from + # ChangeSource. + if not implements: + __implements__ = base.ChangeSource.__implements__ compare_attrs = ["basedir", "newdir", "pollinterval", "parser"] parser = None name = None def __init__(self, maildir, prefix=None, sep="/"): - MaildirTwisted.__init__(self, maildir) + maildirtwisted.MaildirTwisted.__init__(self, maildir) self.prefix = prefix self.sep = sep @@ -316,16 +320,13 @@ os.path.join(self.basedir, "cur", filename)) class FCMaildirSource(MaildirSource): - __implements__ = (IChangeSource, MaildirSource.__implements__) parser = parseFreshCVSMail name = "FreshCVS" class SyncmailMaildirSource(MaildirSource): - __implements__ = (IChangeSource, MaildirSource.__implements__) parser = parseSyncmail name = "Syncmail" class BonsaiMaildirSource(MaildirSource): - __implements__ = (IChangeSource, MaildirSource.__implements__) parser = parseBonsaiMail name = "Bonsai" Index: p4poller.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/p4poller.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- p4poller.py 18 Apr 2005 00:26:57 -0000 1.3 +++ p4poller.py 17 May 2005 10:14:09 -0000 1.4 @@ -2,20 +2,17 @@ # Many thanks to Dave Peticolas for contributing this module -from twisted.application import service from twisted.internet import defer from twisted.internet.utils import getProcessOutput from twisted.internet.task import LoopingCall from buildbot import util -from buildbot.interfaces import IChangeSource -from buildbot.changes.changes import Change +from buildbot.changes import base, changes -class P4Source(service.Service, util.ComparableMixin): +class P4Source(base.ChangeSource, util.ComparableMixin): """This source will poll a perforce repository for changes and submit them to the change master.""" - __implements__ = IChangeSource, service.Service.__implements__ compare_attrs = ["p4port", "p4user", "p4client", "p4base", "p4bin", "pollinterval", "histmax"] @@ -55,11 +52,11 @@ def startService(self): self.loop = LoopingCall(self.checkp4) self.loop.start(self.pollinterval) - service.Service.startService(self) + base.ChangeSource.startService(self) def stopService(self): self.loop.stop() - return service.Service.stopService(self) + return base.ChangeSource.stopService(self) def describe(self): return "p4source %s:%s %s" % (self.p4port, self.p4client, self.p4base) @@ -119,7 +116,8 @@ def _handle_changes(self, result): for success, change in result: if not success: continue - c = Change(change['user'], change['files'], change['comments'], - revision=change['num']) + c = changes.Change(change['user'], change['files'], + change['comments'], + revision=change['num']) self.parent.addChange(c) self.last_change = change['num'] Index: pb.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/pb.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- pb.py 4 May 2005 02:09:38 -0000 1.7 +++ pb.py 17 May 2005 10:14:09 -0000 1.8 @@ -6,8 +6,7 @@ from twisted.python import log from buildbot.pbutil import NewCredPerspective -from buildbot.changes.changes import Change -from buildbot.interfaces import IChangeSource +from buildbot.changes import base, changes class ChangePerspective(NewCredPerspective): @@ -40,14 +39,13 @@ pathnames.append(path) if pathnames: - change = Change(changedict['who'], - pathnames, - changedict['comments'], - revision=changedict.get('revision')) + change = changes.Change(changedict['who'], + pathnames, + changedict['comments'], + revision=changedict.get('revision')) self.changemaster.addChange(change) -class PBChangeSource(service.Service): - __implements__ = IChangeSource, service.Service.__implements__ +class PBChangeSource(base.ChangeSource): def __init__(self, user="change", passwd="changepw", port=None, prefix=None, sep="/"): @@ -70,7 +68,7 @@ return d def startService(self): - service.Service.startService(self) + base.ChangeSource.startService(self) # our parent is the ChangeMaster object # find the master's Dispatch object and register our username # TODO: the passwd should be registered here too @@ -78,7 +76,7 @@ master.dispatcher.register(self.user, self) def stopService(self): - service.Service.stopService(self) + base.ChangeSource.stopService(self) # unregister our username master = self.parent.parent master.dispatcher.unregister(self.user) From warner at users.sourceforge.net Tue May 17 10:14:14 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 10:14:14 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.33,1.34 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9810/buildbot/slave Modified Files: commands.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-187 Creator: Brian Warner fix deprecation warnings in test suite * everything: fixed all deprecation warnings when running against Twisted-2.0 . (at least all the ones in buildbot code, there are a few that come from Twisted itself). This involved putting most of the Twisted-version specific code in the new buildbot.twcompat module, and creating some abstract base classes in buildbot.changes.base and buildbot.status.base (which might be useful anyway). __implements__ is a nuisance and requires an ugly 'if' clause everywhere. * buildbot/test/test_status.py (Mail.testMail): add a 0.1 second delay before finishing the test: it seems that smtp.sendmail doesn't hang up on the server, so we must wait a moment so it can hang up on us. This removes the trial warning about an unclean reactor. Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- commands.py 17 May 2005 04:40:59 -0000 1.33 +++ commands.py 17 May 2005 10:14:11 -0000 1.34 @@ -6,6 +6,7 @@ from twisted.internet import reactor, defer from twisted.python import log, failure, runtime +from buildbot.twcompat import implements from buildbot.slave.interfaces import ISlaveCommand from buildbot.slave.registry import registerSlaveCommand @@ -309,7 +310,10 @@ class Command: - __implements__ = ISlaveCommand, + if implements: + implements(ISlaveCommand) + else: + __implements__ = ISlaveCommand """This class defines one command that can be invoked by the build master. The command is executed on the slave side, and always sends back a From warner at users.sourceforge.net Tue May 17 10:14:13 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 10:14:13 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_config.py,1.19,1.20 test_run.py,1.31,1.32 test_vc.py,1.29,1.30 test_web.py,1.17,1.18 test_status.py,1.18,1.19 test_control.py,1.5,1.6 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9810/buildbot/test Modified Files: test_config.py test_run.py test_vc.py test_web.py test_status.py test_control.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-187 Creator: Brian Warner fix deprecation warnings in test suite * everything: fixed all deprecation warnings when running against Twisted-2.0 . (at least all the ones in buildbot code, there are a few that come from Twisted itself). This involved putting most of the Twisted-version specific code in the new buildbot.twcompat module, and creating some abstract base classes in buildbot.changes.base and buildbot.status.base (which might be useful anyway). __implements__ is a nuisance and requires an ugly 'if' clause everywhere. * buildbot/test/test_status.py (Mail.testMail): add a 0.1 second delay before finishing the test: it seems that smtp.sendmail doesn't hang up on the server, so we must wait a moment so it can hang up on us. This removes the trial warning about an unclean reactor. Index: test_config.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_config.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- test_config.py 6 May 2005 04:57:59 -0000 1.19 +++ test_config.py 17 May 2005 10:14:10 -0000 1.20 @@ -14,6 +14,7 @@ except ImportError: cvstoys = None +from buildbot.twcompat import providedBy from buildbot.master import BuildMaster from twisted.application import service, internet from twisted.spread import pb @@ -447,7 +448,7 @@ # twisted.application.internet.TCPServer, then extract their .args # values to find the TCP ports they want to listen on for child in s: - if components.implements(child, service.IServiceCollection): + if providedBy(child, service.IServiceCollection): for gc in self.servers(child, types): yield gc if isinstance(child, types): Index: test_control.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_control.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- test_control.py 26 Apr 2005 09:43:20 -0000 1.5 +++ test_control.py 17 May 2005 10:14:10 -0000 1.6 @@ -5,9 +5,9 @@ from twisted.trial import unittest dr = unittest.deferredResult from twisted.internet import defer, reactor -from twisted.python.components import implements from buildbot import master, interfaces +from buildbot.twcompat import providedBy from buildbot.slave import bot from buildbot.status import builder from buildbot.status.builder import SUCCESS @@ -108,11 +108,11 @@ c = interfaces.IControl(m) builder_control = c.getBuilder("force") build_control = builder_control.forceBuild("bob", "I was bored") - self.failUnless(implements(build_control, interfaces.IBuildControl)) + self.failUnless(providedBy(build_control, interfaces.IBuildControl)) d = build_control.getStatus().waitUntilFinished() bs = dr(d) - self.failUnless(implements(bs, interfaces.IBuildStatus)) + self.failUnless(providedBy(bs, interfaces.IBuildStatus)) self.failUnless(bs.isFinished()) self.failUnlessEqual(bs.getResults(), SUCCESS) #self.failUnlessEqual(bs.getResponsibleUsers(), ["bob"]) # TODO Index: test_run.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_run.py,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- test_run.py 16 May 2005 08:42:10 -0000 1.31 +++ test_run.py 17 May 2005 10:14:10 -0000 1.32 @@ -10,8 +10,8 @@ from buildbot import master, interfaces from buildbot.util import now from buildbot.slave import bot -from buildbot.changes.changes import Change -from buildbot.status import builder +from buildbot.changes import changes +from buildbot.status import base, builder def maybeWait(d, timeout="none"): # this is required for oldtrial (twisted-1.3.0) compatibility. When we @@ -150,8 +150,7 @@ class MyBuildSlave(bot.BuildSlave): botClass = MyBot -class STarget: - __implements__ = interfaces.IStatusReceiver, +class STarget(base.StatusReceiver): debug = False def __init__(self, mode): @@ -226,7 +225,7 @@ m.readConfig = True m.startService() cm = m.change_svc - c = Change("bob", ["Makefile", "foo/bar.c"], "changed stuff") + c = changes.Change("bob", ["Makefile", "foo/bar.c"], "changed stuff") cm.addChange(c) b1 = m.botmaster.builders["quick"] self.failUnless(b1.waiting) @@ -590,6 +589,10 @@ fb, None, "forced build") def testIdle2(self): + # this used to be a testIdle2.skip="msg", but that caused a + # UserWarning when used with Twisted-1.3, which I think was an + # indication of an internal Trial problem + raise unittest.SkipTest("SF#1083403 pre-ping not yet implemented") m,s,c,s1 = self.disconnectSetup() # now suppose the slave goes missing self.disappearSlave() @@ -603,7 +606,6 @@ d = bs.waitUntilFinished() dr(d, 5) print bs.getText() - testIdle2.skip = "short timeout not yet implemented" def testSlaveTimeout(self): m,s,c,s1 = self.disconnectSetup2() # fast timeout Index: test_status.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_status.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- test_status.py 16 May 2005 00:16:28 -0000 1.18 +++ test_status.py 17 May 2005 10:14:10 -0000 1.19 @@ -2,12 +2,12 @@ import email, os -from twisted.internet import defer +from twisted.internet import defer, reactor from twisted.trial import unittest dr = unittest.deferredResult -from twisted.python import components from buildbot import interfaces +from buildbot.twcompat import implements, providedBy from buildbot.status import mail, builder from buildbot.status import progress, client # NEEDS COVERAGE @@ -76,7 +76,11 @@ return self.testlogs class MyLookup: - __implements__ = interfaces.IEmailLookup, + if implements: + implements(interfaces.IEmailLookup) + else: + __implements__ = interfaces.IEmailLookup, + def getAddress(self, user): d = defer.Deferred() # With me now is Mr Thomas Walters of West Hartlepool who is totally @@ -308,6 +312,15 @@ print "sending mail to", dest d = mailer.buildFinished("builder1", b1, b1.results) dr(d) + # the mail has been sent, but the SMTP connection is still up + # (because smtp.sendmail relies upon the server to hang up). Spin for + # a moment to avoid the "unclean reactor" warning that Trial gives us + # if we finish before the socket is disconnected. Really, sendmail() + # ought to hang up the connection once it is finished: otherwise a + # malicious SMTP server could make us consume lots of memory. + d = defer.Deferred() + reactor.callLater(0.1, d.callback, None) + dr(d) class Progress(unittest.TestCase): def testWavg(self): @@ -338,7 +351,7 @@ res = b.getTestResults() self.failUnlessEqual(res.keys(), [testname]) t = res[testname] - self.failUnless(components.implements(t, interfaces.ITestResult)) + self.failUnless(providedBy(t, interfaces.ITestResult)) self.failUnlessEqual(t.getName(), testname) self.failUnlessEqual(t.getResults(), builder.SUCCESS) self.failUnlessEqual(t.getText(), ["passed"]) Index: test_vc.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- test_vc.py 17 May 2005 04:40:58 -0000 1.29 +++ test_vc.py 17 May 2005 10:14:10 -0000 1.30 @@ -224,7 +224,10 @@ dr(defer.maybeDeferred(self.master.stopService)) if self.httpServer: dr(self.httpServer.stopListening()) - from twisted.protocols import http + try: + from twisted.web import http # Twisted-2.0 + except ImportError: + from twisted.protocols import http # Twisted-1.3 http._logDateTimeStop() # shut down the internal timer. DUMB! def doBuild(self, shouldSucceed=True): Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- test_web.py 17 May 2005 03:36:54 -0000 1.17 +++ test_web.py 17 May 2005 10:14:10 -0000 1.18 @@ -12,6 +12,7 @@ from twisted.web import client from buildbot import master, interfaces +from buildbot.twcompat import providedBy from buildbot.status import html, builder from buildbot.changes.changes import Change from buildbot.process import step, base @@ -79,7 +80,10 @@ def tearDown(self): # grr. - from twisted.protocols import http + try: + from twisted.web import http # Twisted-2.0 + except ImportError: + from twisted.protocols import http # Twisted-1.3 http._logDateTimeStop() if self.master: d = self.master.stopService() @@ -114,7 +118,7 @@ def test_webPathname(self): # running a t.web.distrib server over a UNIX socket - if not components.implements(reactor, IReactorUNIX): + if not providedBy(reactor, IReactorUNIX): raise unittest.SkipTest("UNIX sockets not supported here") config = """ from buildbot.status import html From warner at users.sourceforge.net Tue May 17 10:14:13 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 10:14:13 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.440,1.441 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9810 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-187 Creator: Brian Warner fix deprecation warnings in test suite * everything: fixed all deprecation warnings when running against Twisted-2.0 . (at least all the ones in buildbot code, there are a few that come from Twisted itself). This involved putting most of the Twisted-version specific code in the new buildbot.twcompat module, and creating some abstract base classes in buildbot.changes.base and buildbot.status.base (which might be useful anyway). __implements__ is a nuisance and requires an ugly 'if' clause everywhere. * buildbot/test/test_status.py (Mail.testMail): add a 0.1 second delay before finishing the test: it seems that smtp.sendmail doesn't hang up on the server, so we must wait a moment so it can hang up on us. This removes the trial warning about an unclean reactor. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.440 retrieving revision 1.441 diff -u -d -r1.440 -r1.441 --- ChangeLog 17 May 2005 04:40:58 -0000 1.440 +++ ChangeLog 17 May 2005 10:14:11 -0000 1.441 @@ -1,3 +1,20 @@ +2005-05-17 Brian Warner + + * everything: fixed all deprecation warnings when running against + Twisted-2.0 . (at least all the ones in buildbot code, there are a + few that come from Twisted itself). This involved putting most of + the Twisted-version specific code in the new buildbot.twcompat + module, and creating some abstract base classes in + buildbot.changes.base and buildbot.status.base (which might be + useful anyway). __implements__ is a nuisance and requires an ugly + 'if' clause everywhere. + + * buildbot/test/test_status.py (Mail.testMail): add a 0.1 second + delay before finishing the test: it seems that smtp.sendmail + doesn't hang up on the server, so we must wait a moment so it can + hang up on us. This removes the trial warning about an unclean + reactor. + 2005-05-16 Brian Warner * buildbot/process/step.py (Source): add 'retry' argument. It is a From warner at users.sourceforge.net Tue May 17 10:14:12 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 10:14:12 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process step_twisted2.py,1.1,1.2 base.py,1.51,1.52 builder.py,1.25,1.26 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9810/buildbot/process Modified Files: step_twisted2.py base.py builder.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-187 Creator: Brian Warner fix deprecation warnings in test suite * everything: fixed all deprecation warnings when running against Twisted-2.0 . (at least all the ones in buildbot code, there are a few that come from Twisted itself). This involved putting most of the Twisted-version specific code in the new buildbot.twcompat module, and creating some abstract base classes in buildbot.changes.base and buildbot.status.base (which might be useful anyway). __implements__ is a nuisance and requires an ugly 'if' clause everywhere. * buildbot/test/test_status.py (Mail.testMail): add a 0.1 second delay before finishing the test: it seems that smtp.sendmail doesn't hang up on the server, so we must wait a moment so it can hang up on us. This removes the trial warning about an unclean reactor. Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/base.py,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- base.py 6 May 2005 04:42:41 -0000 1.51 +++ base.py 17 May 2005 10:14:10 -0000 1.52 @@ -10,6 +10,7 @@ import twisted.web.util from buildbot import interfaces +from buildbot.twcompat import implements from buildbot.util import now from buildbot.status.builder import SUCCESS, WARNINGS, FAILURE, EXCEPTION from buildbot.status.builder import Results @@ -524,7 +525,10 @@ self.builder.testsFinished(results) class BuildControl(components.Adapter): - __implements__ = interfaces.IBuildControl, + if implements: + implements(interfaces.IBuildControl) + else: + __implements__ = interfaces.IBuildControl, def getStatus(self): return self.original.build_status Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/builder.py,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- builder.py 26 Apr 2005 07:16:36 -0000 1.25 +++ builder.py 17 May 2005 10:14:10 -0000 1.26 @@ -5,6 +5,7 @@ from twisted.internet import reactor, defer from buildbot import interfaces +from buildbot.twcompat import implements from buildbot.status.progress import Expectations from buildbot.status import builder from buildbot.util import now @@ -473,7 +474,11 @@ self.d.callback(ponged) class BuilderControl(components.Adapter): - __implements__ = interfaces.IBuilderControl, + if implements: + implements(interfaces.IBuilderControl) + else: + __implements__ = interfaces.IBuilderControl, + def forceBuild(self, who, reason): bc = self.original.forceBuild(who, reason) return bc Index: step_twisted2.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step_twisted2.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- step_twisted2.py 5 May 2003 21:52:48 -0000 1.1 +++ step_twisted2.py 17 May 2005 10:14:10 -0000 1.2 @@ -5,6 +5,7 @@ BuildStep from buildbot.process.step_twisted import RunUnitTests +from zope.interface import implements from twisted.python import log, failure from twisted.spread import jelly from twisted.web.util import formatFailure @@ -67,7 +68,7 @@ machine-parseable results as the tests are run. """ trialMode = "--jelly" - __implements__ = (remote.IRemoteReporter,) + implements(remote.IRemoteReporter) ourtypes = { ResultTypes.SKIP: tests.SKIP, ResultTypes.EXPECTED_FAILURE: tests.EXPECTED_FAILURE, From warner at users.sourceforge.net Tue May 17 10:38:18 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 10:38:18 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_vc.py,1.30,1.31 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13681/buildbot/test Modified Files: test_vc.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-189 Creator: Brian Warner handle string-in-string tests under python-2.2 * buildbot/test/test_vc.py (SetupMixin.failUnlessIn): Add a version that can handle string-in-string tests, because otherwise python-2.2 fails the tests. It'd be tremendous if Trial's test took two strings under 2.2 too. Index: test_vc.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- test_vc.py 17 May 2005 10:14:10 -0000 1.30 +++ test_vc.py 17 May 2005 10:38:10 -0000 1.31 @@ -170,6 +170,11 @@ httpServer = None httpPort = None + def failUnlessIn(self, substring, string, msg=None): + # trial provides a version of this that requires python-2.3 to test + # strings. + self.failUnless(string.find(substring) != -1, msg) + def setUpClass(self): global VCS if VCS is None: @@ -185,11 +190,13 @@ "BUILDBOT_TEST_VC=path/to/repositories " "to run this") self.serveHTTP() - shutil.rmtree("basedir", ignore_errors=1) + if os.path.exists("basedir"): + shutil.rmtree("basedir") os.mkdir("basedir") self.master = master.BuildMaster("basedir") self.slavebase = os.path.abspath("slavebase") - shutil.rmtree(self.slavebase, ignore_errors=1) + if os.path.exists(self.slavebase): + shutil.rmtree(self.slavebase) os.mkdir("slavebase") def serveHTTP(self): From warner at users.sourceforge.net Tue May 17 10:38:12 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 10:38:12 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.441,1.442 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13681 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-189 Creator: Brian Warner handle string-in-string tests under python-2.2 * buildbot/test/test_vc.py (SetupMixin.failUnlessIn): Add a version that can handle string-in-string tests, because otherwise python-2.2 fails the tests. It'd be tremendous if Trial's test took two strings under 2.2 too. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.441 retrieving revision 1.442 diff -u -d -r1.441 -r1.442 --- ChangeLog 17 May 2005 10:14:11 -0000 1.441 +++ ChangeLog 17 May 2005 10:38:08 -0000 1.442 @@ -1,5 +1,10 @@ 2005-05-17 Brian Warner + * buildbot/test/test_vc.py (SetupMixin.failUnlessIn): Add a + version that can handle string-in-string tests, because otherwise + python-2.2 fails the tests. It'd be tremendous if Trial's test + took two strings under 2.2 too. + * everything: fixed all deprecation warnings when running against Twisted-2.0 . (at least all the ones in buildbot code, there are a few that come from Twisted itself). This involved putting most of From warner at users.sourceforge.net Tue May 17 20:04:11 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 20:04:11 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_runner.py,1.5,1.6 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9329/buildbot/test Modified Files: test_runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-191 Creator: Brian Warner clean up 'buildbot start', change to Makefile.buildbot * buildbot/scripts/runner.py (start): change 'buildbot start' to look for Makefile.buildbot instead of a bare Makefile . The 'buildbot start' does not install this file, so you have to manually copy it if you want to customize startup behavior. (createMaster): change 'buildbot master' command to create Makefile.sample instead of Makefile, to create master.cfg.sample instead of master.cfg (requiring you to copy it before the buildmaster can be started). Both sample files are kept up to date, i.e. they are overwritten if they have been changed. The 'buildbot.tac' file is *not* overwritten, but if the new contents don't match the old, a 'buildbot.tac.new' file is created and the user is warned. This seems to be a much more sane way to handle startup files. Also, don't sys.exit(0) when done, so we can run unit tests against it. (createSlave): same. Don't overwrite the sample info/ files. * buildbot/scripts/sample.mk: remove. the contents were pulled into runner.py, since they need to match the behavior of start() * setup.py: same * MANIFEST.in: same Index: test_runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_runner.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- test_runner.py 26 Apr 2005 20:10:07 -0000 1.5 +++ test_runner.py 17 May 2005 20:04:08 -0000 1.6 @@ -40,3 +40,154 @@ self.home = os.path.abspath("nothome") os.makedirs(os.sep.join(["nothome", "dir1"])) self.check(["nothome", "dir1"], None) + +class Create(unittest.TestCase): + def failUnlessIn(self, substring, string, msg=None): + # trial provides a version of this that requires python-2.3 to test + # strings. + self.failUnless(string.find(substring) != -1, msg) + def failUnlessExists(self, filename): + self.failUnless(os.path.exists(filename), "%s should exist" % filename) + def failIfExists(self, filename): + self.failIf(os.path.exists(filename), "%s should not exist" % filename) + + def testMaster(self): + basedir = "test_runner.master" + options = runner.MasterOptions() + options.parseOptions(["-q", basedir]) + cwd = os.getcwd() + runner.createMaster(options) + os.chdir(cwd) + + tac = os.path.join(basedir, "buildbot.tac") + self.failUnless(os.path.exists(tac)) + tacfile = open(tac,"rt").read() + self.failUnlessIn("basedir", tacfile) + self.failUnlessIn("configfile = 'master.cfg'", tacfile) + self.failUnlessIn("BuildMaster(basedir, configfile)", tacfile) + + cfg = os.path.join(basedir, "master.cfg") + self.failIfExists(cfg) + samplecfg = os.path.join(basedir, "master.cfg.sample") + self.failUnlessExists(samplecfg) + cfgfile = open(samplecfg,"rt").read() + self.failUnlessIn("This is a sample buildmaster config file", cfgfile) + + makefile = os.path.join(basedir, "Makefile.sample") + self.failUnlessExists(makefile) + + # now verify that running it a second time (with the same options) + # does the right thing: nothing changes + runner.createMaster(options) + os.chdir(cwd) + + self.failIfExists(os.path.join(basedir, "buildbot.tac.new")) + self.failUnlessExists(os.path.join(basedir, "master.cfg.sample")) + + oldtac = open(os.path.join(basedir, "buildbot.tac"), "rt").read() + + # mutate Makefile.sample, since it should be rewritten + f = open(os.path.join(basedir, "Makefile.sample"), "rt") + oldmake = f.read() + f = open(os.path.join(basedir, "Makefile.sample"), "wt") + f.write(oldmake) + f.write("# additional line added\n") + f.close() + + # also mutate master.cfg.sample + f = open(os.path.join(basedir, "master.cfg.sample"), "rt") + oldsamplecfg = f.read() + f = open(os.path.join(basedir, "master.cfg.sample"), "wt") + f.write(oldsamplecfg) + f.write("# additional line added\n") + f.close() + + # now run it again (with different options) + options = runner.MasterOptions() + options.parseOptions(["-q", "--config", "other.cfg", basedir]) + runner.createMaster(options) + os.chdir(cwd) + + tac = open(os.path.join(basedir, "buildbot.tac"), "rt").read() + self.failUnlessEqual(tac, oldtac, "shouldn't change existing .tac") + self.failUnlessExists(os.path.join(basedir, "buildbot.tac.new")) + + make = open(os.path.join(basedir, "Makefile.sample"), "rt").read() + self.failUnlessEqual(make, oldmake, "*should* rewrite Makefile.sample") + + samplecfg = open(os.path.join(basedir, "master.cfg.sample"), + "rt").read() + self.failUnlessEqual(samplecfg, oldsamplecfg, + "*should* rewrite master.cfg.sample") + + + def testSlave(self): + basedir = "test_runner.slave" + options = runner.SlaveOptions() + options.parseOptions(["-q", basedir, "buildmaster:1234", + "botname", "passwd"]) + cwd = os.getcwd() + runner.createSlave(options) + os.chdir(cwd) + + tac = os.path.join(basedir, "buildbot.tac") + self.failUnless(os.path.exists(tac)) + tacfile = open(tac,"rt").read() + self.failUnlessIn("basedir", tacfile) + self.failUnlessIn("host = 'buildmaster'", tacfile) + self.failUnlessIn("port = 1234", tacfile) + self.failUnlessIn("slavename = 'botname'", tacfile) + self.failUnlessIn("passwd = 'passwd'", tacfile) + self.failUnlessIn("keepalive = 0", tacfile) + self.failUnlessIn("BuildSlave(host, port, slavename", tacfile) + + makefile = os.path.join(basedir, "Makefile.sample") + self.failUnlessExists(makefile) + + self.failUnlessExists(os.path.join(basedir, "info", "admin")) + self.failUnlessExists(os.path.join(basedir, "info", "host")) + # edit one to make sure the later install doesn't change it + f = open(os.path.join(basedir, "info", "admin"), "wt") + f.write("updated at buildbot.example.org\n") + f.close() + + # now verify that running it a second time (with the same options) + # does the right thing: nothing changes + runner.createSlave(options) + os.chdir(cwd) + + self.failIfExists(os.path.join(basedir, "buildbot.tac.new")) + admin = open(os.path.join(basedir, "info", "admin"), "rt").read() + self.failUnlessEqual(admin, "updated at buildbot.example.org\n") + + + # mutate Makefile.sample, since it should be rewritten + oldmake = open(os.path.join(basedir, "Makefile.sample"), "rt").read() + f = open(os.path.join(basedir, "Makefile.sample"), "wt") + f.write(oldmake) + f.write("# additional line added\n") + f.close() + oldtac = open(os.path.join(basedir, "buildbot.tac"), "rt").read() + + # now run it again (with different options) + options = runner.SlaveOptions() + options.parseOptions(["-q", "--keepalive", "600", + basedir, "buildmaster:9999", + "newbotname", "passwd"]) + runner.createSlave(options) + os.chdir(cwd) + + tac = open(os.path.join(basedir, "buildbot.tac"), "rt").read() + self.failUnlessEqual(tac, oldtac, "shouldn't change existing .tac") + self.failUnlessExists(os.path.join(basedir, "buildbot.tac.new")) + tacfile = open(os.path.join(basedir, "buildbot.tac.new"),"rt").read() + self.failUnlessIn("basedir", tacfile) + self.failUnlessIn("host = 'buildmaster'", tacfile) + self.failUnlessIn("port = 9999", tacfile) + self.failUnlessIn("slavename = 'newbotname'", tacfile) + self.failUnlessIn("passwd = 'passwd'", tacfile) + self.failUnlessIn("keepalive = 600", tacfile) + self.failUnlessIn("BuildSlave(host, port, slavename", tacfile) + + make = open(os.path.join(basedir, "Makefile.sample"), "rt").read() + self.failUnlessEqual(make, oldmake, "*should* rewrite Makefile.sample") From warner at users.sourceforge.net Tue May 17 20:04:22 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 20:04:22 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.22,1.23 sample.mk,1.2,NONE Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9329/buildbot/scripts Modified Files: runner.py Removed Files: sample.mk Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-191 Creator: Brian Warner clean up 'buildbot start', change to Makefile.buildbot * buildbot/scripts/runner.py (start): change 'buildbot start' to look for Makefile.buildbot instead of a bare Makefile . The 'buildbot start' does not install this file, so you have to manually copy it if you want to customize startup behavior. (createMaster): change 'buildbot master' command to create Makefile.sample instead of Makefile, to create master.cfg.sample instead of master.cfg (requiring you to copy it before the buildmaster can be started). Both sample files are kept up to date, i.e. they are overwritten if they have been changed. The 'buildbot.tac' file is *not* overwritten, but if the new contents don't match the old, a 'buildbot.tac.new' file is created and the user is warned. This seems to be a much more sane way to handle startup files. Also, don't sys.exit(0) when done, so we can run unit tests against it. (createSlave): same. Don't overwrite the sample info/ files. * buildbot/scripts/sample.mk: remove. the contents were pulled into runner.py, since they need to match the behavior of start() * setup.py: same * MANIFEST.in: same Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- runner.py 17 May 2005 03:36:54 -0000 1.22 +++ runner.py 17 May 2005 20:04:09 -0000 1.23 @@ -34,6 +34,28 @@ raise usage.UsageError(" parameter is required") self['basedir'] = os.path.abspath(self['basedir']) +makefile_sample = """ +# -*- makefile -*- + +# This is a simple makefile which lives in a buildmaster/buildslave +# directory (next to the buildbot.tac file). It allows you to start/stop the +# master or slave by doing 'make start' or 'make stop'. + +# The 'reconfig' target will tell a buildmaster to reload its config file. + +start: + twistd --no_save -y buildbot.tac + +stop: + kill `cat twistd.pid` + +reconfig: + kill -HUP `cat twistd.pid` + +log: + tail -f twistd.log +""" + class Maker: def __init__(self, config): self.config = config @@ -42,31 +64,37 @@ self.quiet = config['quiet'] def mkdir(self): - if os.path.exists(self.basedir) and not self.force: - print ("basedir %s already exists and --force not used" - % self.basedir) - print "refusing to touch existing setup" - sys.exit(1) - if not os.path.exists(self.basedir): - if not self.quiet: print "mkdir", self.basedir - os.mkdir(self.basedir) + if os.path.exists(self.basedir): + if not self.quiet: + print "updating existing installation" + return + if not self.quiet: print "mkdir", self.basedir + os.mkdir(self.basedir) def mkinfo(self): path = os.path.join(self.basedir, "info") if not os.path.exists(path): if not self.quiet: print "mkdir", path os.mkdir(path) + created = False admin = os.path.join(path, "admin") if not os.path.exists(admin): + if not self.quiet: + print "Creating info/admin, you need to edit it appropriately" f = open(admin, "wt") f.write("Your Name Here \n") f.close() + created = True host = os.path.join(path, "host") if not os.path.exists(host): + if not self.quiet: + print "Creating info/host, you need to edit it appropriately" f = open(host, "wt") f.write("Please put a description of this build host here\n") f.close() - print "Please edit the files in %s appropriately." % path + created = True + if created and not self.quiet: + print "Please edit the files in %s appropriately." % path def chdir(self): if not self.quiet: print "chdir", self.basedir @@ -77,10 +105,12 @@ if os.path.exists(tacfile): oldcontents = open(tacfile, "rt").read() if oldcontents == contents: - print "buildbot.tac already exists and is correct" + if not self.quiet: + print "buildbot.tac already exists and is correct" return - print "not touching existing buildbot.tac" - print "creating buildbot.tac.new instead" + if not self.quiet: + print "not touching existing buildbot.tac" + print "creating buildbot.tac.new instead" tacfile = "buildbot.tac.new" f = open(tacfile, "wt") f.write(contents) @@ -103,21 +133,40 @@ f.write(contents) f.close() - def makefile(self, source): - target = "Makefile" + def makefile(self): + target = "Makefile.sample" if os.path.exists(target): - print "not touching existing Makefile" - print "installing sample in Makefile.sample instead" - target = "Makefile.sample" - shutil.copy(source, target) + oldcontents = open(target, "rt").read() + if oldcontents == makefile_sample: + if not self.quiet: + print "Makefile.sample already exists and is correct" + return + if not self.quiet: + print "replacing Makefile.sample" + else: + if not self.quiet: + print "creating Makefile.sample" + f = open(target, "wt") + f.write(makefile_sample) + f.close() def sampleconfig(self, source): - target = "master.cfg" + target = "master.cfg.sample" + config_sample = open(source, "rt").read() if os.path.exists(target): - print "not touching existing master.cfg" - print "installing sample in master.cfg.sample instead" - target = "master.cfg.sample" - shutil.copy(source, target) + oldcontents = open(target, "rt").read() + if oldcontents == config_sample: + if not self.quiet: + print "master.cfg.sample already exists and is up-to-date" + return + if not self.quiet: + print "replacing master.cfg.sample" + else: + if not self.quiet: + print "creating master.cfg.sample" + f = open(target, "wt") + f.write(config_sample) + f.close() os.chmod(target, 0600) class MasterOptions(MakerBase): @@ -161,10 +210,9 @@ contents = masterTAC % config m.makeTAC(contents) m.sampleconfig(util.sibpath(__file__, "sample.cfg")) - m.makefile(util.sibpath(__file__, "sample.mk")) + m.makefile() if not m.quiet: print "buildmaster configured in %s" % m.basedir - sys.exit(0) class SlaveOptions(MakerBase): optFlags = [ @@ -247,20 +295,20 @@ m.makeTAC(contents, secret=True) - m.makefile(util.sibpath(__file__, "sample.mk")) + m.makefile() m.mkinfo() if not m.quiet: print "buildslave configured in %s" % m.basedir - sys.exit(0) + def start(config): basedir = config['basedir'] quiet = config['quiet'] os.chdir(basedir) - if os.path.exists("/usr/bin/make") and os.path.exists("Makefile"): - # yes, this is clunky. Preferring the Makefile lets slave admins do - # useful things like set up environment variables for the buildslave. - cmd = "make start" + if os.path.exists("/usr/bin/make") and os.path.exists("Makefile.buildbot"): + # Preferring the Makefile lets slave admins do useful things like set + # up environment variables for the buildslave. + cmd = "make -f Makefile.buildbot start" if not quiet: print cmd os.system(cmd) else: --- sample.mk DELETED --- From warner at users.sourceforge.net Tue May 17 20:04:23 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 20:04:23 +0000 Subject: [Buildbot-commits] buildbot/docs buildbot.texinfo,1.4,1.5 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9329/docs Modified Files: buildbot.texinfo Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-191 Creator: Brian Warner clean up 'buildbot start', change to Makefile.buildbot * buildbot/scripts/runner.py (start): change 'buildbot start' to look for Makefile.buildbot instead of a bare Makefile . The 'buildbot start' does not install this file, so you have to manually copy it if you want to customize startup behavior. (createMaster): change 'buildbot master' command to create Makefile.sample instead of Makefile, to create master.cfg.sample instead of master.cfg (requiring you to copy it before the buildmaster can be started). Both sample files are kept up to date, i.e. they are overwritten if they have been changed. The 'buildbot.tac' file is *not* overwritten, but if the new contents don't match the old, a 'buildbot.tac.new' file is created and the user is warned. This seems to be a much more sane way to handle startup files. Also, don't sys.exit(0) when done, so we can run unit tests against it. (createSlave): same. Don't overwrite the sample info/ files. * buildbot/scripts/sample.mk: remove. the contents were pulled into runner.py, since they need to match the behavior of start() * setup.py: same * MANIFEST.in: same Index: buildbot.texinfo =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/buildbot.texinfo,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- buildbot.texinfo 17 May 2005 04:40:57 -0000 1.4 +++ buildbot.texinfo 17 May 2005 20:04:20 -0000 1.5 @@ -532,8 +532,8 @@ You will need to create a configuration file (@pxref{Configuration}) before starting the buildmaster. Most of the rest of this manual is dedicated to explaining how to do this. A sample configuration file is -placed in the working directory, named @file{master.cfg}, which can be -edited to suit your purposes. +placed in the working directory, named @file{master.cfg.sample}, which +can be copied to @file{master.cfg} and edited to suit your purposes. Internal details: @@ -544,10 +544,9 @@ (running the program in the background). @file{/usr/bin/buildbot} is a front end which runs twistd for you. -In addition to @file{buildbot.tac}, a small Makefile is created for -performing common actions. The @file{buildbot} front-end tool can do -most of these actions for you, so eventually the Makefile will be -redundant. +In addition to @file{buildbot.tac}, a small @file{Makefile.sample} is +installed. This can be used as the basis for customize daemon startup, + at xref{Launching the daemons}. @node Creating a buildslave, Launching the daemons, Creating a buildmaster, Installation @@ -729,6 +728,18 @@ @code{PATH}, or for @code{PYTHONPATH} to not be set correctly. Sometimes @code{HOME} is messed up too. +To modify the way the daemons are started (perhaps you want to set +some environment variables first, or perform some cleanup each time), +you can create a file named @file{Makefile.buildbot} in the base +directory. When the @file{buildbot} front-end tool is told to + at command{start} the daemon, and it sees this file (and + at file{/usr/bin/make} exists), it will do @command{make -f +Makefile.buildbot start} instead of its usual action (which involves +running @command{twistd}). When the buildmaster or buildslave is +installed, a @file{Makefile.sample} is created which implements the +same behavior as the the @file{buildbot} tool uses, so if you want to +customize the process, just copy @file{Makefile.sample} to + at file{Makefile.buildbot} and edit it as necessary. @node Logfiles, Shutdown, Launching the daemons, Installation @section Logfiles From warner at users.sourceforge.net Tue May 17 20:04:24 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 20:04:24 +0000 Subject: [Buildbot-commits] buildbot setup.py,1.34,1.35 MANIFEST.in,1.19,1.20 ChangeLog,1.442,1.443 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9329 Modified Files: setup.py MANIFEST.in ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-191 Creator: Brian Warner clean up 'buildbot start', change to Makefile.buildbot * buildbot/scripts/runner.py (start): change 'buildbot start' to look for Makefile.buildbot instead of a bare Makefile . The 'buildbot start' does not install this file, so you have to manually copy it if you want to customize startup behavior. (createMaster): change 'buildbot master' command to create Makefile.sample instead of Makefile, to create master.cfg.sample instead of master.cfg (requiring you to copy it before the buildmaster can be started). Both sample files are kept up to date, i.e. they are overwritten if they have been changed. The 'buildbot.tac' file is *not* overwritten, but if the new contents don't match the old, a 'buildbot.tac.new' file is created and the user is warned. This seems to be a much more sane way to handle startup files. Also, don't sys.exit(0) when done, so we can run unit tests against it. (createSlave): same. Don't overwrite the sample info/ files. * buildbot/scripts/sample.mk: remove. the contents were pulled into runner.py, since they need to match the behavior of start() * setup.py: same * MANIFEST.in: same Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.442 retrieving revision 1.443 diff -u -d -r1.442 -r1.443 --- ChangeLog 17 May 2005 10:38:08 -0000 1.442 +++ ChangeLog 17 May 2005 20:04:21 -0000 1.443 @@ -1,5 +1,28 @@ 2005-05-17 Brian Warner + * buildbot/scripts/runner.py (start): change 'buildbot start' to + look for Makefile.buildbot instead of a bare Makefile . The + 'buildbot start' does not install this file, so you have to + manually copy it if you want to customize startup behavior. + (createMaster): change 'buildbot master' command to create + Makefile.sample instead of Makefile, to create master.cfg.sample + instead of master.cfg (requiring you to copy it before the + buildmaster can be started). Both sample files are kept up to + date, i.e. they are overwritten if they have been changed. The + 'buildbot.tac' file is *not* overwritten, but if the new contents + don't match the old, a 'buildbot.tac.new' file is created and the + user is warned. This seems to be a much more sane way to handle + startup files. Also, don't sys.exit(0) when done, so we can run + unit tests against it. + (createSlave): same. Don't overwrite the sample info/ files. + * buildbot/scripts/sample.mk: remove. the contents were pulled + into runner.py, since they need to match the behavior of start() + * setup.py: same + * MANIFEST.in: same + + * docs/buildbot.texinfo (Launching the daemons): document it + * buildbot/test/test_runner.py (Create): test it + * buildbot/test/test_vc.py (SetupMixin.failUnlessIn): Add a version that can handle string-in-string tests, because otherwise python-2.2 fails the tests. It'd be tremendous if Trial's test Index: MANIFEST.in =================================================================== RCS file: /cvsroot/buildbot/buildbot/MANIFEST.in,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- MANIFEST.in 11 May 2005 23:25:25 -0000 1.19 +++ MANIFEST.in 17 May 2005 20:04:21 -0000 1.20 @@ -7,7 +7,7 @@ include docs/buildbot.texinfo docs/buildbot.info include docs/epyrun docs/gen-reference include buildbot/test/mail/* buildbot/test/subdir/* -include buildbot/scripts/sample.cfg buildbot/scripts/sample.mk +include buildbot/scripts/sample.cfg include buildbot/status/classic.css include buildbot/clients/debug.glade include buildbot/buildbot.png Index: setup.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/setup.py,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- setup.py 11 May 2005 23:30:15 -0000 1.34 +++ setup.py 17 May 2005 20:04:21 -0000 1.35 @@ -55,8 +55,7 @@ data_files=[("buildbot", ["buildbot/buildbot.png"]), ("buildbot/clients", ["buildbot/clients/debug.glade"]), ("buildbot/status", ["buildbot/status/classic.css"]), - ("buildbot/scripts", ["buildbot/scripts/sample.cfg", - "buildbot/scripts/sample.mk"]),], + ("buildbot/scripts", ["buildbot/scripts/sample.cfg"]),], scripts = scripts, cmdclass={'install_data': install_data_twisted}, ) From warner at users.sourceforge.net Tue May 17 20:31:23 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 20:31:23 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.443,1.444 NEWS,1.41,1.42 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15902 Modified Files: ChangeLog NEWS Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-193 Creator: Brian Warner NEWS: document changes since the last release Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.443 retrieving revision 1.444 diff -u -d -r1.443 -r1.444 --- ChangeLog 17 May 2005 20:04:21 -0000 1.443 +++ ChangeLog 17 May 2005 20:31:19 -0000 1.444 @@ -1,5 +1,7 @@ 2005-05-17 Brian Warner + * NEWS: document changes since the last release + * buildbot/scripts/runner.py (start): change 'buildbot start' to look for Makefile.buildbot instead of a bare Makefile . The 'buildbot start' does not install this file, so you have to Index: NEWS =================================================================== RCS file: /cvsroot/buildbot/buildbot/NEWS,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- NEWS 28 Apr 2005 07:57:28 -0000 1.41 +++ NEWS 17 May 2005 20:31:20 -0000 1.42 @@ -1,5 +1,96 @@ User visible changes in Buildbot. +* Release ?.?.? (??) + +** deprecated config keys removed + +The 'webPortnum', 'webPathname', 'irc', and 'manholePort' config-file keys, +which were deprecated in the previous release, have now been removed. In +addition, Builders must now always be configured with dictionaries: the +support for configuring them with tuples has been removed. + +** master/slave creation and startup changed + +The buildbot no longer uses .tap files to store serialized representations of +the buildmaster/buildslave applications. Instead, this release now uses .tac +files, which are human-readable scripts that create new instances (rather +than .tap files, which were pickles of pre-created instances). 'mktap +buildbot' is gone. + +You will need to update your buildbot directories to handle this. The +procedure is the same as creating a new buildmaster or buildslave: use +'buildbot master BASEDIR' or 'buildbot slave BASEDIR ARGS..'. This will +create a 'buildbot.tac' file in the target directory. The 'buildbot start +BASEDIR' will use twistd to start the application. + +The 'buildbot start' command now looks for a Makefile.buildbot, and if it +finds one (and /usr/bin/make exists), it will use it to start the application +instead of calling twistd directly. This allows you to customize startup, +perhaps by adding environment variables. The setup commands create a sample +file in Makefile.sample, but you must copy this to Makefile.buildbot to +actually use it. The previous release looked for a bare 'Makefile', and also +installed a 'Makefile', so you were always using the customized approach, +even if you didn't ask for it. That old Makefile launched the .tap file, so +changing names was also necessary to make sure that the new 'buildbot start' +doesn't try to run the old .tap file. + +'buildbot stop' now uses os.kill instead of spawning an external process, +making it more likely to work under windows. It waits up to 5 seconds for the +daemon to go away, so you can now do 'buildbot stop BASEDIR; buildbot start +BASEDIR' with less risk of launching the new daemon before the old one has +fully shut down. Likewise, 'buildbot start' imports twistd's internals +directly instead of spawning an external copy, so it should work better under +windows. + +** new documentation + +All of the old Lore-based documents were converted into a new Texinfo-format +manual, and considerable new text was added to describe the installation +process. The docs are not yet complete, but they're slowly shaping up to form +a proper user's manual. + +** new features + +Arch checkouts can now use precise revision stamps instead of always using +the latest revision. A separate Source step for using Bazaar (an alternative +Arch client) instead of 'tla' was added. A Source step for Cogito (the new +linux kernel VC system) was contributed by Brandon Philips. All Source steps +now accept a retry= argument to indicate that failing VC checkouts should be +retried a few times (SF#1200395), note that this requires an updated +buildslave. + +The 'buildbot sendchange' command was added, to be used in VC hook scripts to +send changes at a pb.PBChangeSource . contrib/arch_buildbot.py was added to +use this tool; it should be installed using the 'Arch meta hook' scheme. + +Changes can now accept a tag= parameter. Thanks to Thomas Vander Stichele. + +LogFiles have been rewritten to stream the incoming data directly to disk +rather than keeping a copy in memory all the time (SF#1200392). This +drastically reduces the buildmaster's memory requirements and makes 100MB+ +log files feasible. The log files are stored next to the serialized Builds, +in files like BASEDIR/builder-dir/12-log-compile-output, so you'll want a +cron job to delete old ones just like you do with old Builds. Old-style +Builds from 0.6.4 and earlier are converted when they are first read, so the +first load of the Waterfall display after updating to this release may take +quite some time. + +** build process updates + +BuildSteps can now return a status of EXCEPTION, which terminates the build +right away. This allows exceptions to be caught right away, but still make +sure the build stops quickly. + +** bug fixes + +Some more windows incompatibilities were fixed. The test suite now has two +failing tests remaining, both of which appear to be Twisted issues that +should not affect normal operation. + +The test suite no longer raises any deprecation warnings when run against +twisted-2.0 (except for the ones which come from Twisted itself). + + * Release 0.6.4 (28 Apr 2005) ** major bugs fixed From warner at users.sourceforge.net Tue May 17 22:19:20 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 22:19:20 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.444,1.445 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6131 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-195 Creator: Brian Warner don't explode when trying to interrupt non-existent Command * buildbot/slave/commands.py (ShellCommand.kill): if somehow this gets called when there isn't actually an active process, just end the Command instead of blowing up. I don't know how it gets into this state, but the twisted win32 buildslave will sometimes hang, and when it shakes its head and comes back, it thinks it's still running a Command. The next build causes this command to be interrupted, but the lack of self.process.pid breaks the interrupt attempt. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.444 retrieving revision 1.445 diff -u -d -r1.444 -r1.445 --- ChangeLog 17 May 2005 20:31:19 -0000 1.444 +++ ChangeLog 17 May 2005 22:19:18 -0000 1.445 @@ -1,5 +1,14 @@ 2005-05-17 Brian Warner + * buildbot/slave/commands.py (ShellCommand.kill): if somehow this + gets called when there isn't actually an active process, just end + the Command instead of blowing up. I don't know how it gets into + this state, but the twisted win32 buildslave will sometimes hang, + and when it shakes its head and comes back, it thinks it's still + running a Command. The next build causes this command to be + interrupted, but the lack of self.process.pid breaks the interrupt + attempt. + * NEWS: document changes since the last release * buildbot/scripts/runner.py (start): change 'buildbot start' to From warner at users.sourceforge.net Tue May 17 22:19:21 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 17 May 2005 22:19:21 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.34,1.35 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6131/buildbot/slave Modified Files: commands.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-195 Creator: Brian Warner don't explode when trying to interrupt non-existent Command * buildbot/slave/commands.py (ShellCommand.kill): if somehow this gets called when there isn't actually an active process, just end the Command instead of blowing up. I don't know how it gets into this state, but the twisted win32 buildslave will sometimes hang, and when it shakes its head and comes back, it thinks it's still running a Command. The next build causes this command to be interrupted, but the lack of self.process.pid breaks the interrupt attempt. Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- commands.py 17 May 2005 10:14:11 -0000 1.34 +++ commands.py 17 May 2005 22:19:18 -0000 1.35 @@ -266,6 +266,14 @@ self.kill(msg) def kill(self, msg): + if not self.process: + msg += ", but there is no current process, finishing anyway" + log.msg(msg) + self.sendStatus({'header': "\n" + msg + "\n"}) + if self.pp: + self.pp.command = None + self.commandFailed(CommandInterrupted("no process to interrupt")) + return msg += ", killing pid %d" % self.process.pid log.msg(msg) self.sendStatus({'header': "\n" + msg + "\n"}) From warner at users.sourceforge.net Wed May 18 00:29:45 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 00:29:45 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status mail.py,1.16,1.17 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32706/buildbot/status Modified Files: mail.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-197 Creator: Brian Warner minor updates * buildbot/scripts/runner.py (makefile_sample): remove the leading newline * buildbot/status/mail.py (MailNotifier): oops, forgot to upcall * Makefile: update some release-related stuff Index: mail.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/mail.py,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- mail.py 17 May 2005 10:14:09 -0000 1.16 +++ mail.py 18 May 2005 00:29:43 -0000 1.17 @@ -138,6 +138,7 @@ match their twistedmatrix.com account names. """ + base.StatusReceiverMultiService.__init__(self) assert type(extraRecipients) in (list, tuple) for r in extraRecipients: assert type(r) is str From warner at users.sourceforge.net Wed May 18 00:29:45 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 00:29:45 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.23,1.24 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32706/buildbot/scripts Modified Files: runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-197 Creator: Brian Warner minor updates * buildbot/scripts/runner.py (makefile_sample): remove the leading newline * buildbot/status/mail.py (MailNotifier): oops, forgot to upcall * Makefile: update some release-related stuff Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- runner.py 17 May 2005 20:04:09 -0000 1.23 +++ runner.py 18 May 2005 00:29:43 -0000 1.24 @@ -34,8 +34,7 @@ raise usage.UsageError(" parameter is required") self['basedir'] = os.path.abspath(self['basedir']) -makefile_sample = """ -# -*- makefile -*- +makefile_sample = """# -*- makefile -*- # This is a simple makefile which lives in a buildmaster/buildslave # directory (next to the buildbot.tac file). It allows you to start/stop the From warner at users.sourceforge.net Wed May 18 00:29:45 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 00:29:45 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.445,1.446 Makefile,1.8,1.9 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32706 Modified Files: ChangeLog Makefile Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-197 Creator: Brian Warner minor updates * buildbot/scripts/runner.py (makefile_sample): remove the leading newline * buildbot/status/mail.py (MailNotifier): oops, forgot to upcall * Makefile: update some release-related stuff Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.445 retrieving revision 1.446 diff -u -d -r1.445 -r1.446 --- ChangeLog 17 May 2005 22:19:18 -0000 1.445 +++ ChangeLog 18 May 2005 00:29:43 -0000 1.446 @@ -1,5 +1,10 @@ 2005-05-17 Brian Warner + * buildbot/scripts/runner.py (makefile_sample): remove the leading + newline + * buildbot/status/mail.py (MailNotifier): oops, forgot to upcall + * Makefile: update some release-related stuff + * buildbot/slave/commands.py (ShellCommand.kill): if somehow this gets called when there isn't actually an active process, just end the Command instead of blowing up. I don't know how it gets into Index: Makefile =================================================================== RCS file: /cvsroot/buildbot/buildbot/Makefile,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile 11 May 2005 23:30:15 -0000 1.8 +++ Makefile 18 May 2005 00:29:43 -0000 1.9 @@ -26,12 +26,18 @@ "snapshot build" debuild binary -.PHONY: docs +.PHONY: docs apidocs paper docs: + $(MAKE) -C docs buildbot.info +apidocs: PYTHONPATH=.:$(T) docs/epyrun -o docs/reference +paper: + $(MAKE) -C docs/PyCon-2003 all -release: - python ./setup.py clean +release: docs paper + find . -type d -exec chmod 0755 {} \; + find . -type f -exec chmod 0644 {} \; + chmod a+x bin/buildbot contrib/*.py debian/rules rm -rf _trial_temp - make -C docs/PyCon-2003 all + python ./setup.py clean python ./setup.py sdist From warner at users.sourceforge.net Wed May 18 00:51:06 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 00:51:06 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.446,1.447 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4223 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-200 Creator: Brian Warner don't treat exception-raising Steps as SUCCESS * buildbot/status/client.py (PBListener): upcall more correctly * buildbot/process/base.py (Build.allStepsDone): if a step caused an exception mark the overall build with EXCEPTION, not SUCCESS Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.446 retrieving revision 1.447 diff -u -d -r1.446 -r1.447 --- ChangeLog 18 May 2005 00:29:43 -0000 1.446 +++ ChangeLog 18 May 2005 00:51:03 -0000 1.447 @@ -1,5 +1,10 @@ 2005-05-17 Brian Warner + * buildbot/status/client.py (PBListener): upcall more correctly + + * buildbot/process/base.py (Build.allStepsDone): if a step caused + an exception mark the overall build with EXCEPTION, not SUCCESS + * buildbot/scripts/runner.py (makefile_sample): remove the leading newline * buildbot/status/mail.py (MailNotifier): oops, forgot to upcall From warner at users.sourceforge.net Wed May 18 00:51:05 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 00:51:05 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process base.py,1.52,1.53 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4223/buildbot/process Modified Files: base.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-200 Creator: Brian Warner don't treat exception-raising Steps as SUCCESS * buildbot/status/client.py (PBListener): upcall more correctly * buildbot/process/base.py (Build.allStepsDone): if a step caused an exception mark the overall build with EXCEPTION, not SUCCESS Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/base.py,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- base.py 17 May 2005 10:14:10 -0000 1.52 +++ base.py 18 May 2005 00:51:03 -0000 1.53 @@ -479,6 +479,9 @@ elif self.result == WARNINGS: color = "orange" text = ["warnings"] + elif self.result == EXCEPTION: + color = "purple" + text = ["exception"] else: color = "green" text = ["build", "successful"] From warner at users.sourceforge.net Wed May 18 00:51:05 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 00:51:05 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status client.py,1.18,1.19 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4223/buildbot/status Modified Files: client.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-200 Creator: Brian Warner don't treat exception-raising Steps as SUCCESS * buildbot/status/client.py (PBListener): upcall more correctly * buildbot/process/base.py (Build.allStepsDone): if a step caused an exception mark the overall build with EXCEPTION, not SUCCESS Index: client.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/client.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- client.py 17 May 2005 10:14:09 -0000 1.18 +++ client.py 18 May 2005 00:50:51 -0000 1.19 @@ -407,7 +407,7 @@ base.StatusReceiverMultiService.__implements__) def __init__(self, port, user="statusClient", passwd="clientpw"): - service.MultiService.__init__(self) + base.StatusReceiverMultiService.__init__(self) self.port = port self.cred = (user, passwd) p = portal.Portal(self) @@ -419,7 +419,7 @@ s.setServiceParent(self) def setServiceParent(self, parent): - service.MultiService.setServiceParent(self, parent) + base.StatusReceiverMultiService.setServiceParent(self, parent) self.setup() def setup(self): From warner at users.sourceforge.net Wed May 18 01:03:51 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 01:03:51 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.447,1.448 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6215 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-202 Creator: Brian Warner Teach the IRC bot about EXCEPTION * buildbot/status/words.py (IrcStatusBot.buildFinished): Teach the IRC bot about EXCEPTION Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.447 retrieving revision 1.448 diff -u -d -r1.447 -r1.448 --- ChangeLog 18 May 2005 00:51:03 -0000 1.447 +++ ChangeLog 18 May 2005 01:03:48 -0000 1.448 @@ -1,5 +1,8 @@ 2005-05-17 Brian Warner + * buildbot/status/words.py (IrcStatusBot.buildFinished): Teach the + IRC bot about EXCEPTION + * buildbot/status/client.py (PBListener): upcall more correctly * buildbot/process/base.py (Build.allStepsDone): if a step caused From warner at users.sourceforge.net Wed May 18 01:03:51 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 01:03:51 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status words.py,1.36,1.37 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6215/buildbot/status Modified Files: words.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-202 Creator: Brian Warner Teach the IRC bot about EXCEPTION * buildbot/status/words.py (IrcStatusBot.buildFinished): Teach the IRC bot about EXCEPTION Index: words.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/words.py,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- words.py 17 May 2005 10:14:09 -0000 1.36 +++ words.py 18 May 2005 01:03:49 -0000 1.37 @@ -18,7 +18,7 @@ from buildbot import interfaces, util from buildbot import version from buildbot.status import base -from buildbot.status.builder import SUCCESS, WARNINGS, FAILURE +from buildbot.status.builder import SUCCESS, WARNINGS, FAILURE, EXCEPTION class UsageError(ValueError): def __init__(self, string = "Invalid usage", *more): @@ -232,6 +232,7 @@ results = {SUCCESS: "Success", WARNINGS: "Warnings", FAILURE: "Failure", + EXCEPTION: "Exception", } # only notify about builders we are interested in From warner at users.sourceforge.net Wed May 18 01:59:56 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 01:59:56 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.448,1.449 Makefile,1.9,1.10 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15821 Modified Files: ChangeLog Makefile Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-204 Creator: Brian Warner make slave default to --keepalive=600 * Makefile: improve permission-setting to not kick Arch so badly * buildbot/scripts/runner.py (SlaveOptions.optParameters): set a default --keepalive=600, since it doesn't hurt very much, and it's a hassle to discover that you need it. * buildbot/test/test_runner.py (Create.testSlave): test it Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.448 retrieving revision 1.449 diff -u -d -r1.448 -r1.449 --- ChangeLog 18 May 2005 01:03:48 -0000 1.448 +++ ChangeLog 18 May 2005 01:59:54 -0000 1.449 @@ -1,5 +1,12 @@ 2005-05-17 Brian Warner + * Makefile: improve permission-setting to not kick Arch so badly + + * buildbot/scripts/runner.py (SlaveOptions.optParameters): set a + default --keepalive=600, since it doesn't hurt very much, and it's + a hassle to discover that you need it. + * buildbot/test/test_runner.py (Create.testSlave): test it + * buildbot/status/words.py (IrcStatusBot.buildFinished): Teach the IRC bot about EXCEPTION Index: Makefile =================================================================== RCS file: /cvsroot/buildbot/buildbot/Makefile,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Makefile 18 May 2005 00:29:43 -0000 1.9 +++ Makefile 18 May 2005 01:59:54 -0000 1.10 @@ -30,13 +30,15 @@ docs: $(MAKE) -C docs buildbot.info apidocs: - PYTHONPATH=.:$(T) docs/epyrun -o docs/reference + PYTHONPATH=.:$(T) python docs/epyrun -o docs/reference paper: $(MAKE) -C docs/PyCon-2003 all release: docs paper - find . -type d -exec chmod 0755 {} \; - find . -type f -exec chmod 0644 {} \; + chmod 0755 . + find buildbot contrib debian docs -type d -exec chmod 0755 {} \; + find bin buildbot contrib debian docs -type f -exec chmod 0644 {} \; + chmod 0644 ChangeLog MANIFEST* NEWS README* setup.py chmod a+x bin/buildbot contrib/*.py debian/rules rm -rf _trial_temp python ./setup.py clean From warner at users.sourceforge.net Wed May 18 01:59:56 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 01:59:56 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.24,1.25 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15821/buildbot/scripts Modified Files: runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-204 Creator: Brian Warner make slave default to --keepalive=600 * Makefile: improve permission-setting to not kick Arch so badly * buildbot/scripts/runner.py (SlaveOptions.optParameters): set a default --keepalive=600, since it doesn't hurt very much, and it's a hassle to discover that you need it. * buildbot/test/test_runner.py (Create.testSlave): test it Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- runner.py 18 May 2005 00:29:43 -0000 1.24 +++ runner.py 18 May 2005 01:59:54 -0000 1.25 @@ -224,7 +224,7 @@ # ["master", "m", "localhost:8007", # "Location of the buildmaster (host:port)"], - ["keepalive", "k", 0, + ["keepalive", "k", 600, "Interval at which keepalives should be sent (in seconds)"], ["usepty", None, 1, "(1 or 0) child processes should be run in a pty"], From warner at users.sourceforge.net Wed May 18 01:59:56 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 01:59:56 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_runner.py,1.6,1.7 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15821/buildbot/test Modified Files: test_runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-204 Creator: Brian Warner make slave default to --keepalive=600 * Makefile: improve permission-setting to not kick Arch so badly * buildbot/scripts/runner.py (SlaveOptions.optParameters): set a default --keepalive=600, since it doesn't hurt very much, and it's a hassle to discover that you need it. * buildbot/test/test_runner.py (Create.testSlave): test it Index: test_runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_runner.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- test_runner.py 17 May 2005 20:04:08 -0000 1.6 +++ test_runner.py 18 May 2005 01:59:53 -0000 1.7 @@ -138,7 +138,7 @@ self.failUnlessIn("port = 1234", tacfile) self.failUnlessIn("slavename = 'botname'", tacfile) self.failUnlessIn("passwd = 'passwd'", tacfile) - self.failUnlessIn("keepalive = 0", tacfile) + self.failUnlessIn("keepalive = 600", tacfile) self.failUnlessIn("BuildSlave(host, port, slavename", tacfile) makefile = os.path.join(basedir, "Makefile.sample") @@ -171,7 +171,7 @@ # now run it again (with different options) options = runner.SlaveOptions() - options.parseOptions(["-q", "--keepalive", "600", + options.parseOptions(["-q", "--keepalive", "30", basedir, "buildmaster:9999", "newbotname", "passwd"]) runner.createSlave(options) @@ -186,7 +186,7 @@ self.failUnlessIn("port = 9999", tacfile) self.failUnlessIn("slavename = 'newbotname'", tacfile) self.failUnlessIn("passwd = 'passwd'", tacfile) - self.failUnlessIn("keepalive = 600", tacfile) + self.failUnlessIn("keepalive = 30", tacfile) self.failUnlessIn("BuildSlave(host, port, slavename", tacfile) make = open(os.path.join(basedir, "Makefile.sample"), "rt").read() From warner at users.sourceforge.net Wed May 18 02:21:32 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 02:21:32 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.25,1.26 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19140/buildbot/scripts Modified Files: runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-207 Creator: Brian Warner 'buildbot stop': don't double-kill the daemon * buildbot/scripts/runner.py (stop): actually poll once per second, instead of re-killing the poor daemon once per second. Sleep briefly (0.1s) before the first poll, since there's a good chance we can avoid waiting the full second if the daemon shuts down quickly. Also remove the sys.exit() at the end. (start): remove the unneighborly sys.exit() Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- runner.py 18 May 2005 01:59:54 -0000 1.25 +++ runner.py 18 May 2005 02:21:29 -0000 1.26 @@ -334,7 +334,6 @@ from twisted.scripts.twistd import run run() - sys.exit(0) def stop(config, signame="TERM"): import signal @@ -346,17 +345,17 @@ signum = getattr(signal, "SIG"+signame) timer = 0 os.kill(pid, signum) + time.sleep(0.1) while timer < 5: # poll once per second until twistd.pid goes away, up to 5 seconds try: - os.kill(pid, signum) + os.kill(pid, 0) except OSError: print "buildbot process %d is dead" % pid sys.exit(0) timer += 1 time.sleep(1) print "never saw process go away" - sys.exit(0) def loadOptions(filename="options", here=None, home=None): """Find the .buildbot/FILENAME file. Crawl from the current directory up From warner at users.sourceforge.net Wed May 18 02:21:32 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 02:21:32 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.449,1.450 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19140 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-207 Creator: Brian Warner 'buildbot stop': don't double-kill the daemon * buildbot/scripts/runner.py (stop): actually poll once per second, instead of re-killing the poor daemon once per second. Sleep briefly (0.1s) before the first poll, since there's a good chance we can avoid waiting the full second if the daemon shuts down quickly. Also remove the sys.exit() at the end. (start): remove the unneighborly sys.exit() Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.449 retrieving revision 1.450 diff -u -d -r1.449 -r1.450 --- ChangeLog 18 May 2005 01:59:54 -0000 1.449 +++ ChangeLog 18 May 2005 02:21:30 -0000 1.450 @@ -1,5 +1,12 @@ 2005-05-17 Brian Warner + * buildbot/scripts/runner.py (stop): actually poll once per + second, instead of re-killing the poor daemon once per second. + Sleep briefly (0.1s) before the first poll, since there's a good + chance we can avoid waiting the full second if the daemon shuts + down quickly. Also remove the sys.exit() at the end. + (start): remove the unneighborly sys.exit() + * Makefile: improve permission-setting to not kick Arch so badly * buildbot/scripts/runner.py (SlaveOptions.optParameters): set a From warner at users.sourceforge.net Wed May 18 07:49:33 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 07:49:33 +0000 Subject: [Buildbot-commits] buildbot/docs buildbot.texinfo,1.5,1.6 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9801/docs Modified Files: buildbot.texinfo Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-209 Creator: Brian Warner rename Change(tag=) to branch= * buildbot/changes/changes.py: rename tag= to branch=, since that's how we're using it, and my design for the upcoming "build a specific branch" feature wants it. also, tag= was too CVS-centric * buildbot/changes/mail.py (parseSyncmail): same * buildbot/process/base.py (Build.isBranchImportant): same * buildbot/test/test_mailparse.py (Test3.testMsgS4): same * docs/buildbot.texinfo (Attributes of Changes): same * NEWS: update tag=, update for upcoming release Index: buildbot.texinfo =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/buildbot.texinfo,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- buildbot.texinfo 17 May 2005 20:04:20 -0000 1.5 +++ buildbot.texinfo 18 May 2005 07:49:30 -0000 1.6 @@ -1090,17 +1090,17 @@ @code{revision} is an int, the transaction number @end table -The Change might also have a @code{tag} attribute. This is primarily -intended to represent the CVS named branch (since CVS does not embed -the @code{branch} in the pathname like many of the other systems), -however it could be used for other purposes as well (e.g. some VC -systems might allow commits to be marked as @code{cosmetic}, or -docs-only, or something). The Build, in its @code{isTagImportant} -method, gets to decide whether the tag is important or not. This -allows you to configure Builds which only fire on changes to a -specific branch. For a change to trigger a build, both the @code{tag} -must be important, and at least one of the files inside the change -must be considered important. +The Change might also have a @code{branch} attribute. This is +primarily intended to represent the CVS named branch (since CVS does +not embed the @code{branch} in the pathname like many of the other +systems), however it could be used for other purposes as well (e.g. +some VC systems might allow commits to be marked as @code{cosmetic}, +or docs-only, or something). The Build, in its + at code{isBranchImportant} method, gets to decide whether the branch is +important or not. This allows you to configure Builds which only fire +on changes to a specific branch. For a change to trigger a build, both +the @code{branch} must be important, and at least one of the files +inside the change must be considered important. From warner at users.sourceforge.net Wed May 18 07:49:33 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 07:49:33 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.450,1.451 NEWS,1.42,1.43 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9801 Modified Files: ChangeLog NEWS Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-209 Creator: Brian Warner rename Change(tag=) to branch= * buildbot/changes/changes.py: rename tag= to branch=, since that's how we're using it, and my design for the upcoming "build a specific branch" feature wants it. also, tag= was too CVS-centric * buildbot/changes/mail.py (parseSyncmail): same * buildbot/process/base.py (Build.isBranchImportant): same * buildbot/test/test_mailparse.py (Test3.testMsgS4): same * docs/buildbot.texinfo (Attributes of Changes): same * NEWS: update tag=, update for upcoming release Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.450 retrieving revision 1.451 diff -u -d -r1.450 -r1.451 --- ChangeLog 18 May 2005 02:21:30 -0000 1.450 +++ ChangeLog 18 May 2005 07:49:31 -0000 1.451 @@ -1,3 +1,15 @@ +2005-05-18 Brian Warner + + * buildbot/changes/changes.py: rename tag= to branch=, since + that's how we're using it, and my design for the upcoming "build a + specific branch" feature wants it. also, tag= was too CVS-centric + * buildbot/changes/mail.py (parseSyncmail): same + * buildbot/process/base.py (Build.isBranchImportant): same + * buildbot/test/test_mailparse.py (Test3.testMsgS4): same + * docs/buildbot.texinfo (Attributes of Changes): same + + * NEWS: update tag=, update for upcoming release + 2005-05-17 Brian Warner * buildbot/scripts/runner.py (stop): actually poll once per Index: NEWS =================================================================== RCS file: /cvsroot/buildbot/buildbot/NEWS,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- NEWS 17 May 2005 20:31:20 -0000 1.42 +++ NEWS 18 May 2005 07:49:31 -0000 1.43 @@ -1,6 +1,6 @@ User visible changes in Buildbot. -* Release ?.?.? (??) +* Release 0.6.5 (18 May 2005) ** deprecated config keys removed @@ -63,7 +63,10 @@ send changes at a pb.PBChangeSource . contrib/arch_buildbot.py was added to use this tool; it should be installed using the 'Arch meta hook' scheme. -Changes can now accept a tag= parameter. Thanks to Thomas Vander Stichele. +Changes can now accept a branch= parameter, and Builders have an +isBranchImportant() test that acts like isFileImportant(). Thanks to Thomas +Vander Stichele. Note: I renamed his tag= to branch=, in anticipation of an +upcoming feature to build specific branches. "tag" seemed too CVS-centric. LogFiles have been rewritten to stream the incoming data directly to disk rather than keeping a copy in memory all the time (SF#1200392). This From warner at users.sourceforge.net Wed May 18 07:49:32 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 07:49:32 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_mailparse.py,1.3,1.4 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9801/buildbot/test Modified Files: test_mailparse.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-209 Creator: Brian Warner rename Change(tag=) to branch= * buildbot/changes/changes.py: rename tag= to branch=, since that's how we're using it, and my design for the upcoming "build a specific branch" feature wants it. also, tag= was too CVS-centric * buildbot/changes/mail.py (parseSyncmail): same * buildbot/process/base.py (Build.isBranchImportant): same * buildbot/test/test_mailparse.py (Test3.testMsgS4): same * docs/buildbot.texinfo (Attributes of Changes): same * NEWS: update tag=, update for upcoming release Index: test_mailparse.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_mailparse.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- test_mailparse.py 6 May 2005 04:42:41 -0000 1.3 +++ test_mailparse.py 18 May 2005 07:49:30 -0000 1.4 @@ -232,7 +232,7 @@ ]) self.assertEqual(c.comments, "test cases for syncmail parser\n") self.assertEqual(c.isdir, 0) - self.assertEqual(c.tag, None) + self.assertEqual(c.branch, None) # tests a tag def testMsgS5(self): @@ -244,5 +244,5 @@ 'test1/autogen.sh', 'test1/configure.in' ]) - self.assertEqual(c.tag, "BRANCH-DEVEL") + self.assertEqual(c.branch, "BRANCH-DEVEL") self.assertEqual(c.isdir, 0) From warner at users.sourceforge.net Wed May 18 07:49:32 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 07:49:32 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process base.py,1.53,1.54 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9801/buildbot/process Modified Files: base.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-209 Creator: Brian Warner rename Change(tag=) to branch= * buildbot/changes/changes.py: rename tag= to branch=, since that's how we're using it, and my design for the upcoming "build a specific branch" feature wants it. also, tag= was too CVS-centric * buildbot/changes/mail.py (parseSyncmail): same * buildbot/process/base.py (Build.isBranchImportant): same * buildbot/test/test_mailparse.py (Test3.testMsgS4): same * docs/buildbot.texinfo (Attributes of Changes): same * NEWS: update tag=, update for upcoming release Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/base.py,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- base.py 18 May 2005 00:51:03 -0000 1.53 +++ base.py 18 May 2005 07:49:30 -0000 1.54 @@ -107,12 +107,12 @@ """ return True - def isTagImportant(self, tag): - """I return True if the given tag is important enough to trigger a + def isBranchImportant(self, branch): + """I return True if the given branch is important enough to trigger a rebuild, False if it should be ignored. Override me to ignore - unimporant tags. The timer is not restarted, so a checkout may occur - in the middle of a set of changes marked 'unimportant'. Also, the - checkout may or may not pick up the 'unimportant' changes.""" + unimportant branches. The timer is not restarted, so a checkout may + occur in the middle of a set of changes marked 'unimportant'. Also, + the checkout may or may not pick up the 'unimportant' changes.""" return True def bumpMaxChangeNumber(self, change): @@ -129,11 +129,11 @@ @type change: L{buildbot.changes.changes.Change} """ # for a change to be important, it needs to be with an important - # tag and it need to contain an important file + # branch and it need to contain an important file important = 0 - if self.isTagImportant(change.tag): + if self.isBranchImportant(change.branch): for filename in change.files: if self.isFileImportant(filename): important = 1 From warner at users.sourceforge.net Wed May 18 07:49:32 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 07:49:32 +0000 Subject: [Buildbot-commits] buildbot/buildbot/changes changes.py,1.23,1.24 mail.py,1.18,1.19 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/changes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9801/buildbot/changes Modified Files: changes.py mail.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-209 Creator: Brian Warner rename Change(tag=) to branch= * buildbot/changes/changes.py: rename tag= to branch=, since that's how we're using it, and my design for the upcoming "build a specific branch" feature wants it. also, tag= was too CVS-centric * buildbot/changes/mail.py (parseSyncmail): same * buildbot/process/base.py (Build.isBranchImportant): same * buildbot/test/test_mailparse.py (Test3.testMsgS4): same * docs/buildbot.texinfo (Attributes of Changes): same * NEWS: update tag=, update for upcoming release Index: changes.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/changes.py,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- changes.py 17 May 2005 10:14:09 -0000 1.23 +++ changes.py 18 May 2005 07:49:29 -0000 1.24 @@ -20,8 +20,8 @@ html_tmpl = """

    Changed by: %(who)s
    Changed at: %(at)s
    +%(branch)s %(revision)s -%(tag)s
    Changed files: @@ -62,7 +62,7 @@ revision = None # used to create a source-stamp def __init__(self, who, files, comments, isdir=0, links=[], - revision=None, when=None, tag=None): + revision=None, when=None, branch=None): self.who = who self.files = files self.comments = comments @@ -72,7 +72,7 @@ if when is None: when = util.now() self.when = when - self.tag = tag + self.branch = branch def asText(self): data = "" @@ -94,15 +94,15 @@ revision = "" if self.revision: revision = "Revision: %s
    \n" % self.revision - tag = "" - if self.tag: - tag = "Tag: %s
    \n" % self.tag + branch = "" + if self.branch: + branch = "Branch: %s
    \n" % self.branch kwargs = { 'who' : html.escape(self.who), 'at' : self.getTime(), 'files' : html.UL(links) + '\n', 'revision': revision, - 'tag' : tag, + 'branch' : branch, 'comments': html.PRE(self.comments) } return html_tmpl % kwargs @@ -163,9 +163,9 @@ seconds if not. It parses incoming mail to determine what files were changed. - - L{buildbot.changes.freshcvs.FreshCVSSource} makes a PB - connection to the CVSToys 'freshcvs' daemon and relays any - changes it announces. + - L{buildbot.changes.freshcvs.FreshCVSSource} makes a PB + connection to the CVSToys 'freshcvs' daemon and relays any + changes it announces. """ @@ -196,9 +196,9 @@ def addChange(self, change): """Deliver a file change event. The event should be a Change object. This method will timestamp the object as it is received.""" - log.msg("adding change, who %s, %d files, rev=%s, tag=%s, " + log.msg("adding change, who %s, %d files, rev=%s, branch=%s, " "comments %s" % (change.who, len(change.files), - change.revision, change.tag, + change.revision, change.branch, change.comments)) change.number = self.nextNumber self.nextNumber += 1 Index: mail.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/mail.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- mail.py 17 May 2005 10:14:09 -0000 1.18 +++ mail.py 18 May 2005 07:49:29 -0000 1.19 @@ -125,7 +125,7 @@ files = [] comments = "" isdir = 0 - tag = None + branch = None lines = m.fp.readlines() while lines: @@ -154,7 +154,7 @@ # e.g.: Tag: BRANCH-DEVEL if line.startswith('Tag:'): - tag = line.split(' ')[-1].rstrip() + branch = line.split(' ')[-1].rstrip() continue # note: it doesn't actually make sense to use portable functions @@ -195,7 +195,8 @@ comments += line comments = comments.rstrip() + "\n" - change = changes.Change(who, files, comments, isdir, when=when, tag=tag) + change = changes.Change(who, files, comments, isdir, when=when, + branch=branch) return change From warner at users.sourceforge.net Wed May 18 08:01:38 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 08:01:38 +0000 Subject: [Buildbot-commits] buildbot/buildbot __init__.py,1.12,1.13 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12144/buildbot Modified Files: __init__.py Log Message: (version): Releasing buildbot-0.6.5 Index: __init__.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/__init__.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- __init__.py 3 May 2005 04:31:20 -0000 1.12 +++ __init__.py 18 May 2005 08:01:35 -0000 1.13 @@ -1,3 +1,3 @@ #! /usr/bin/python -version = "0.6.4+" +version = "0.6.5" From warner at users.sourceforge.net Wed May 18 08:01:40 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 08:01:40 +0000 Subject: [Buildbot-commits] buildbot README,1.26,1.27 ChangeLog,1.451,1.452 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12144 Modified Files: README ChangeLog Log Message: (version): Releasing buildbot-0.6.5 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.451 retrieving revision 1.452 diff -u -d -r1.451 -r1.452 --- ChangeLog 18 May 2005 07:49:31 -0000 1.451 +++ ChangeLog 18 May 2005 08:01:36 -0000 1.452 @@ -1,5 +1,12 @@ 2005-05-18 Brian Warner + * buildbot/__init__.py (version): Releasing buildbot-0.6.5 + +2005-05-18 Brian Warner + + * README: update for 0.6.5 + * debian/changelog: same + * buildbot/changes/changes.py: rename tag= to branch=, since that's how we're using it, and my design for the upcoming "build a specific branch" feature wants it. also, tag= was too CVS-centric Index: README =================================================================== RCS file: /cvsroot/buildbot/buildbot/README,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- README 6 May 2005 04:57:58 -0000 1.26 +++ README 18 May 2005 08:01:36 -0000 1.27 @@ -43,6 +43,10 @@ The PyCon paper has a good description of the overall architecture. It is available in HTML form in docs/PyCon-2003/buildbot.html, or on the web page. +docs/buildbot.info contains the beginnings of the User's Manual, and the +Installation chapter is the best guide to use for setup instructions. The +.texinfo source can also be turned into printed documentation. + REQUIREMENTS: Python: http://www.python.org @@ -61,12 +65,10 @@ with Twisted-1.1.0, but 1.3.0 is the version that has received the most testing. - They run against Twisted-2.0.0 as well, albeit with a number of warnings - about the use of deprecated features. If you use Twisted-2.0, you'll need - at least "Twisted" (the core package), and you'll also want TwistedMail, - TwistedWeb, TwistedWords, and TwistedLore (for sending email, serving a - web status page, delivering build status via IRC, and generating the HTML - documentation, respectively). + Both work with Twisted-2.0.0 as well. You'll need at least "Twisted" (the + core package), and you'll also want TwistedMail, TwistedWeb, and + TwistedWords (for sending email, serving a web status page, and delivering + build status via IRC, respectively). CVSToys: http://purl.net/net/CVSToys @@ -76,16 +78,18 @@ a mail-parsing change source, or the SVN notification script), you will not need CVSToys. - INSTALLATION: +Please read the User's Manual in docs/buildbot.info for complete +instructions. + RUNNING THE UNIT TESTS If you would like to run the unit test suite, use a command like this: PYTHONPATH=. trial -v buildbot.test -This should run up to 109 tests, depending upon what VC tools you have +This should run up to 124 tests, depending upon what VC tools you have installed. On my desktop machine it takes about two minutes to complete. Nothing should fail, a few might be skipped. If any of the tests fail, you should stop and investigate the cause before continuing the installation From warner at users.sourceforge.net Wed May 18 08:01:37 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 08:01:37 +0000 Subject: [Buildbot-commits] buildbot/debian changelog,1.6,1.7 Message-ID: Update of /cvsroot/buildbot/buildbot/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12144/debian Modified Files: changelog Log Message: (version): Releasing buildbot-0.6.5 Index: changelog =================================================================== RCS file: /cvsroot/buildbot/buildbot/debian/changelog,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- changelog 28 Apr 2005 07:57:27 -0000 1.6 +++ changelog 18 May 2005 08:01:34 -0000 1.7 @@ -1,3 +1,9 @@ +buildbot (0.6.5-1) unstable; urgency=low + + * New upstream release + + -- Brian Warner Wed, 18 May 2005 01:00:12 -0700 + buildbot (0.6.4-1) unstable; urgency=low * New upstream release From warner at users.sourceforge.net Wed May 18 08:30:50 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 18 May 2005 08:30:50 +0000 Subject: [Buildbot-commits] site ChangeLog,1.20,1.21 NEWS,1.6,1.7 README,1.13,1.14 index.html,1.39,1.40 Message-ID: Update of /cvsroot/buildbot/site In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18540 Modified Files: ChangeLog NEWS README index.html Log Message: update for 0.6.5 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/site/ChangeLog,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- ChangeLog 28 Apr 2005 08:21:10 -0000 1.20 +++ ChangeLog 18 May 2005 08:30:47 -0000 1.21 @@ -1,3 +1,408 @@ +2005-05-18 Brian Warner + + * buildbot/__init__.py (version): Releasing buildbot-0.6.5 + +2005-05-18 Brian Warner + + * README: update for 0.6.5 + * debian/changelog: same + + * buildbot/changes/changes.py: rename tag= to branch=, since + that's how we're using it, and my design for the upcoming "build a + specific branch" feature wants it. also, tag= was too CVS-centric + * buildbot/changes/mail.py (parseSyncmail): same + * buildbot/process/base.py (Build.isBranchImportant): same + * buildbot/test/test_mailparse.py (Test3.testMsgS4): same + * docs/buildbot.texinfo (Attributes of Changes): same + + * NEWS: update tag=, update for upcoming release + +2005-05-17 Brian Warner + + * buildbot/scripts/runner.py (stop): actually poll once per + second, instead of re-killing the poor daemon once per second. + Sleep briefly (0.1s) before the first poll, since there's a good + chance we can avoid waiting the full second if the daemon shuts + down quickly. Also remove the sys.exit() at the end. + (start): remove the unneighborly sys.exit() + + * Makefile: improve permission-setting to not kick Arch so badly + + * buildbot/scripts/runner.py (SlaveOptions.optParameters): set a + default --keepalive=600, since it doesn't hurt very much, and it's + a hassle to discover that you need it. + * buildbot/test/test_runner.py (Create.testSlave): test it + + * buildbot/status/words.py (IrcStatusBot.buildFinished): Teach the + IRC bot about EXCEPTION + + * buildbot/status/client.py (PBListener): upcall more correctly + + * buildbot/process/base.py (Build.allStepsDone): if a step caused + an exception mark the overall build with EXCEPTION, not SUCCESS + + * buildbot/scripts/runner.py (makefile_sample): remove the leading + newline + * buildbot/status/mail.py (MailNotifier): oops, forgot to upcall + * Makefile: update some release-related stuff + + * buildbot/slave/commands.py (ShellCommand.kill): if somehow this + gets called when there isn't actually an active process, just end + the Command instead of blowing up. I don't know how it gets into + this state, but the twisted win32 buildslave will sometimes hang, + and when it shakes its head and comes back, it thinks it's still + running a Command. The next build causes this command to be + interrupted, but the lack of self.process.pid breaks the interrupt + attempt. + + * NEWS: document changes since the last release + + * buildbot/scripts/runner.py (start): change 'buildbot start' to + look for Makefile.buildbot instead of a bare Makefile . The + 'buildbot start' does not install this file, so you have to + manually copy it if you want to customize startup behavior. + (createMaster): change 'buildbot master' command to create + Makefile.sample instead of Makefile, to create master.cfg.sample + instead of master.cfg (requiring you to copy it before the + buildmaster can be started). Both sample files are kept up to + date, i.e. they are overwritten if they have been changed. The + 'buildbot.tac' file is *not* overwritten, but if the new contents + don't match the old, a 'buildbot.tac.new' file is created and the + user is warned. This seems to be a much more sane way to handle + startup files. Also, don't sys.exit(0) when done, so we can run + unit tests against it. + (createSlave): same. Don't overwrite the sample info/ files. + * buildbot/scripts/sample.mk: remove. the contents were pulled + into runner.py, since they need to match the behavior of start() + * setup.py: same + * MANIFEST.in: same + + * docs/buildbot.texinfo (Launching the daemons): document it + * buildbot/test/test_runner.py (Create): test it + + * buildbot/test/test_vc.py (SetupMixin.failUnlessIn): Add a + version that can handle string-in-string tests, because otherwise + python-2.2 fails the tests. It'd be tremendous if Trial's test + took two strings under 2.2 too. + + * everything: fixed all deprecation warnings when running against + Twisted-2.0 . (at least all the ones in buildbot code, there are a + few that come from Twisted itself). This involved putting most of + the Twisted-version specific code in the new buildbot.twcompat + module, and creating some abstract base classes in + buildbot.changes.base and buildbot.status.base (which might be + useful anyway). __implements__ is a nuisance and requires an ugly + 'if' clause everywhere. + + * buildbot/test/test_status.py (Mail.testMail): add a 0.1 second + delay before finishing the test: it seems that smtp.sendmail + doesn't hang up on the server, so we must wait a moment so it can + hang up on us. This removes the trial warning about an unclean + reactor. + +2005-05-16 Brian Warner + + * buildbot/process/step.py (Source): add 'retry' argument. It is a + tuple of (delay, repeats). + * buildbot/test/test_vc.py (Retry): test it + * docs/buildbot.texinfo (Source Checkout): document it + * buildbot/slave/commands.py (SourceBase): add 'retry' parameter. + (SourceBase.maybeDoVCRetry): If 'retry' is set, failures in + doVCFull() are handled by re-trying the checkout (after a delay) + some number of times. + (ShellCommand._startCommand): make header lines easier to read + + * buildbot/test/test_web.py (WebTest.tearDown): factor out master + shutdown + (WebTest.test_logfile): make sure master gets shut down, silences + some "unclean reactor" test errors + + * buildbot/test/test_changes.py (Sender.tearDown): spin the + reactor once after shutdown, something in certain versions of + Twisted trigger a test failure. 1.3.0 is ok, 2.0.0 fails, 2.0.1pre + fails, svn-trunk is ok. + + * buildbot/test/test_slavecommand.py (Shell.testShellZ): add a + second win32 error message + + * buildbot/test/test_run.py (Status.testSlave): be smarter about + validating the ETA, so the tests don't fail on slow systems + +2005-05-15 Brian Warner + + * buildbot/status/builder.py (HTMLLogFile): make this behave like + the new LogFile class, so upgrading works properly + (LogFileProducer.resumeProducing): survive resumeProducing after + we've exhausted the chunkGenerator + + * buildbot/test/test_web.py (WebTest.test_logfile): validate HTML + logs too + * buildbot/test/test_status.py (Log.testAdd): validate hasContents + (Log.testUpgrade): same + + * docs/buildbot.texinfo (Maintenance): describe how to delete old + Builds and logs with a cron job. + + * buildbot/status/builder.py (LogFile): revamp LogFiles. Got rid + of the old non-offline LogFile, added code to upgrade these to + new-style contents-live-on-disk instances at load time (in a way + that doesn't invalidate the old Build pickles, so upgrading to + 0.6.5 is not a one-way operation). Got rid of everything related + to 'stub' builds. + (LogFile.__init__): create LogFiles with the parent step status, + the log's name, and a builder-relative filename where it can keep + the contents on disk. + (LogFile.hasContents): new method, clients are advised to call it + before getText or getChunks and friends. If it returns False, the + log's contents have been deleted and getText() will raise an + error. + (LogFile.getChunks): made it a generator + (LogFile.subscribeConsumer): new method, takes a Twisted-style + Consumer (except one that takes chunks instead of strings). This + enables streaming of very large logfiles without storing the whole + thing in memory. + (BuildStatus.generateLogfileName): create names like + 12-log-compile-output, with a _0 suffix if required to be unique + (BuildStatus.upgradeLogfiles): transform any old-style (from 0.6.4 + or earlier) logfiles into new-style ones + (BuilderStatus): remove everything related to 'stub' builds. There + is now only one build cache, and we don't strip logs from old + builds anymore. + (BuilderStatus.getBuildByNumber): check self.currentBuild too, + since we no longer fight to keep it in the cache + + * buildbot/status/html.py (TextLog.render_GET): use a + ChunkConsumer to stream the log entries efficiently. + (ChunkConsumer): wrapper which consumes chunks and writes + formatted HTML. + + * buildbot/test/test_twisted.py (Parse.testParse): use a + LogFile-like object instead of a real one + + * buildbot/test/test_status.py (MyLog): handle new LogFile code + (Log.testMerge3): validate more merge behavior + (Log.testChunks): validate LogFile.getChunks + (Log.testUpgrade): validate old-style LogFile upgrading + (Log.testSubscribe): validate LogFile.subscribe + (Log.testConsumer): validate LogFile.subscribeConsumer + + * buildbot/interfaces.py (IStatusLogStub): remove + (IStatusLog.subscribeConsumer): new method + (IStatusLog.hasContents): new method + (IStatusLogConsumer): describes things passed to subscribeConsumer + + * buildbot/status/html.py (StepBox.getBox): Don't offer an href to + the log contents if it does not have any contents. + (StatusResourceBuildStep.body): same + (StatusResourceBuildStep.getChild): give a 404 for empty logs + +2005-05-14 Brian Warner + + * buildbot/test/test_web.py (WebTest.test_logfile): add 5-second + timeouts to try and make the windows metabuildslave not hang + +2005-05-13 Mike Taylor + + * buildbot/slave/commands.py (rmdirRecursive): added a check + to ensure the path passed into rmdirRecursive actually exists. + On win32 a non-existant path would generate an exception. + +2005-05-13 Brian Warner + + * buildbot/slave/commands.py (rmdirRecursive): replacement for + shutil.rmtree which behaves correctly on windows in the face of + files that you have to chmod before deleting. Thanks to Bear at + the OSAF for the routine. + (SourceBase.doClobber): use rmdirRecursive + +2005-05-12 Brian Warner + + * buildbot/status/builder.py (OfflineLogFile.getChunks): have this + method generate chunks instead of returning a big list. This + allows the same method to be used for both old LogFile and new + OfflineLogFile. + (OfflineLogFile.getText): use the generator + (OfflineLogFile.subscribe): same + * buildbot/status/html.py (TextLog.resumeProducing): same + * buildbot/interfaces.py (IStatusLog.getChunks): document it + + * buildbot/test/test_web.py (WebTest.test_logfile): Add a test to + point out that OfflineLogFile does not currently work with + html.Waterfall . Fixing this is high-priority. + + * buildbot/scripts/runner.py (start): add --logfile=twistd.log, since + apparently windows defaults to using stdout + + * buildbot/test/test_slavecommand.py (Shell.testShellZ): log a + better message on failure so I can figure out the win32 problem + + * buildbot/slave/commands.py (ShellCommand._startCommand): update + log messages to include more useful copies of the command being + run, the argv array, and the child command's environment. + (Git.doVCFull): update cg-close usage, patch from Brandon Philips. + +2005-05-11 Brian Warner + + * setup.py: oops, install debug.glade so 'buildbot debugclient' + will actually work + * Makefile: update the deb-snapshot version + + * docs/buildbot.texinfo: move all .xhtml docs into a new + .texinfo-format document, adding a lot of material in the process. + This is starting to look like a real user's manual. Removed all + the Lore-related files: *.xhtml, *.css, template.tpl . + * docs/Makefile: simple makefile to run 'makeinfo' + * buildbot/scripts/sample.cfg: rearrange slightly + * MANIFEST.in: include .info and .textinfo, don't include *.xhtml + +2005-05-10 Brian Warner + + * buildbot/scripts/runner.py (start): Twisted-1.3.0 used a + different name for the internal twistw module, handle it. + + * MANIFEST.in: we deleted plugins.tml, so stop shipping it + * setup.py: .. and stop trying to install it + + * buildbot/process/step.py (Git): added support for 'cogito' (aka + 'git'), the new linux kernel VC system (http://kernel.org/git/). + Thanks to Brandon Philips for the patch. + * buildbot/slave/commands.py (Git): same + +2005-05-06 Brian Warner + + * buildbot/status/builder.py (OfflineLogFile): replace the default + LogFile with a form that appends its new contents to a disk file + as they arrive. The complete log data is never kept in RAM. This + is the first step towards handling very large (100MB+) logfiles + without choking quite so badly. (The other half is + producer/consumer on the HTML pages). + (BuildStepStatus.addLog): use OfflineLogFile by default + (BuildStatus.getLogfileName): helper code to give the + OfflineLogFile a filename to work with + + * buildbot/test/test_status.py (Results.testAddResults): update + tests to handle new asserts + * buildbot/test/test_vc.py (Patch.doPatch): same + * buildbot/test/test_steps.py (BuildStep.setUp): same + +2005-05-05 Brian Warner + + * buildbot/scripts/runner.py (start): if there is no Makefile, + launch the app by importing twistd's internals and calling run(), + rather than spawning a new twistd process. This stands a much + better chance of working under windows. + (stop): kill the process with os.kill instead of spawning + /bin/kill, again to reduce the number of external programs which + windows might not have in the PATH. Also wait up to 5 seconds for + the process to go away, allowing things like 'buildbot stop; + buildbot start' to be reliable in the face of slow shutdowns. + + * buildbot/master.py (Dispatcher.__getstate__): remove old + .tap-related methods + (BuildMaster.__getstate__): same + (makeService): same + * buildbot/slave/bot.py (makeService): same + (Options.longdesc): same + * buildbot/scripts/runner.py: copy over some old mktap option text + + * buildbot/scripts/runner.py (masterTAC): stop using mktap. + 'buildbot master' now creates a buildbot.tac file, so there is no + longer a create-instance/save/reload sequence. mktap is dead, long + live twistd -y. + * buildbot/scripts/sample.mk: use twistd -y, not -f + * buildbot/test/test_config.py: remove mktap-based test + * buildbot/bb_tap.py, buildbot/plugins.tml: delete old files + * README: don't reference mktap + + * docs/source.xhtml: document some of the attributes that Changes + might have + + * docs/steps.xhtml (Bazaar): document the Bazaar checkout step + + * general: merge in Change(tag=) patch from Thomas Vander Stichele. + [org.apestaart at thomas--buildbot/buildbot--cvstag--0-dev--patch-2] + * buildbot/changes/changes.py (Change) + * buildbot/changes/mail.py (parseSyncmail) + * buildbot/test/test_mailparse.py (Test3.getNoPrefix) + (Test3.testMsgS5) + * buildbot/process/base.py (Build.isTagImportant) + (Build.addChange) + + +2005-05-04 Brian Warner + + * buildbot/clients/sendchange.py (Sender.send): tear down the PB + connection after sending the change, so that unit tests don't + complain about sockets being left around + + * buildbot/status/html.py (WaterfallStatusResource.body): fix + exception in phase=0 rendering + * buildbot/test/test_web.py (WebTest.test_waterfall): test it + + * buildbot/changes/dnotify.py (DNotify.__init__): remove debug msg + + * buildbot/master.py (BuildMaster.loadConfig): finally remove + deprecated config keys: webPortnum, webPathname, irc, manholePort, + and configuring builders with tuples. + * buildbot/test/test_config.py: stop testing compatibility with + deprecated config keys + * buildbot/test/test_run.py: same + +2005-05-03 Brian Warner + + * contrib/arch_buildbot.py: survive if there are no logfiles + (username): just use a string, os.getlogin isn't reliable + + * buildbot/scripts/runner.py (sendchange): oops, fix the command + so 'buildbot sendchange' actually works. The earlier test only + covered the internal (non-reactor-running) form. + + * contrib/arch_buildbot.py: utility that can run as an Arch hook + script to notify the buildmaster about changes + + * buildbot/scripts/runner.py (sendchange): new command to send a + change to a buildbot.changes.pb.PBChangeSource receiver. + * buildbot/test/test_changes.py (Sender): test it + + * buildbot/master.py (BuildMaster.startService): mark .readConfig + after any reading of the config file, not just when we do it in + startService. This makes some tests a bit cleaner. + + * buildbot/changes/pb.py: add some log messages + + * buildbot/process/base.py (Build.startBuild): fix a bug that + caused an exception when the build terminated in the very first + step. + (Build.stepDone): let steps return a status of EXCEPTION. This + terminates the build right away, and sets the build's overall + status to EXCEPTION too. + * buildbot/process/step.py (BuildStep.failed): return a status of + EXCEPTION when that is what has happened. + + * buildbot/process/step.py (Arch.computeSourceRevision): finally + implement this, allowing Arch-based projects to get precise + checkouts instead of always using the latest code + (Bazaar): create variant of Arch to let folks use baz instead of + tla. Requires a new buildslave too. + * buildbot/slave/commands.py (Arch): add 'revision' argument + (Bazaar): create variant of Arch that uses baz instead of tla. + Remove the code that extracts the archive name from the + register-archive output, since baz doesn't provide it, and require + the user provide both the archive name and its location. + * buildbot/test/test_vc.py (VC.testBazaar): added tests + +2005-05-02 Brian Warner + + * buildbot/scripts/sample.cfg: improve docs for c['buildbotURL'], + thanks to Nick Trout. + + * buildbot/scripts/runner.py (Maker.makefile): chmod before edit, + deals better with source Makefile coming from a read-only CVS + checkout. Thanks to Nick Trout for the catch. + + * buildbot/__init__.py (version): bump to 0.6.4+ while between + releases + 2005-04-28 Brian Warner * buildbot/__init__.py (version): Releasing buildbot-0.6.4 Index: NEWS =================================================================== RCS file: /cvsroot/buildbot/site/NEWS,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- NEWS 28 Apr 2005 08:21:13 -0000 1.6 +++ NEWS 18 May 2005 08:30:48 -0000 1.7 @@ -1,5 +1,99 @@ User visible changes in Buildbot. +* Release 0.6.5 (18 May 2005) + +** deprecated config keys removed + +The 'webPortnum', 'webPathname', 'irc', and 'manholePort' config-file keys, +which were deprecated in the previous release, have now been removed. In +addition, Builders must now always be configured with dictionaries: the +support for configuring them with tuples has been removed. + +** master/slave creation and startup changed + +The buildbot no longer uses .tap files to store serialized representations of +the buildmaster/buildslave applications. Instead, this release now uses .tac +files, which are human-readable scripts that create new instances (rather +than .tap files, which were pickles of pre-created instances). 'mktap +buildbot' is gone. + +You will need to update your buildbot directories to handle this. The +procedure is the same as creating a new buildmaster or buildslave: use +'buildbot master BASEDIR' or 'buildbot slave BASEDIR ARGS..'. This will +create a 'buildbot.tac' file in the target directory. The 'buildbot start +BASEDIR' will use twistd to start the application. + +The 'buildbot start' command now looks for a Makefile.buildbot, and if it +finds one (and /usr/bin/make exists), it will use it to start the application +instead of calling twistd directly. This allows you to customize startup, +perhaps by adding environment variables. The setup commands create a sample +file in Makefile.sample, but you must copy this to Makefile.buildbot to +actually use it. The previous release looked for a bare 'Makefile', and also +installed a 'Makefile', so you were always using the customized approach, +even if you didn't ask for it. That old Makefile launched the .tap file, so +changing names was also necessary to make sure that the new 'buildbot start' +doesn't try to run the old .tap file. + +'buildbot stop' now uses os.kill instead of spawning an external process, +making it more likely to work under windows. It waits up to 5 seconds for the +daemon to go away, so you can now do 'buildbot stop BASEDIR; buildbot start +BASEDIR' with less risk of launching the new daemon before the old one has +fully shut down. Likewise, 'buildbot start' imports twistd's internals +directly instead of spawning an external copy, so it should work better under +windows. + +** new documentation + +All of the old Lore-based documents were converted into a new Texinfo-format +manual, and considerable new text was added to describe the installation +process. The docs are not yet complete, but they're slowly shaping up to form +a proper user's manual. + +** new features + +Arch checkouts can now use precise revision stamps instead of always using +the latest revision. A separate Source step for using Bazaar (an alternative +Arch client) instead of 'tla' was added. A Source step for Cogito (the new +linux kernel VC system) was contributed by Brandon Philips. All Source steps +now accept a retry= argument to indicate that failing VC checkouts should be +retried a few times (SF#1200395), note that this requires an updated +buildslave. + +The 'buildbot sendchange' command was added, to be used in VC hook scripts to +send changes at a pb.PBChangeSource . contrib/arch_buildbot.py was added to +use this tool; it should be installed using the 'Arch meta hook' scheme. + +Changes can now accept a branch= parameter, and Builders have an +isBranchImportant() test that acts like isFileImportant(). Thanks to Thomas +Vander Stichele. Note: I renamed his tag= to branch=, in anticipation of an +upcoming feature to build specific branches. "tag" seemed too CVS-centric. + +LogFiles have been rewritten to stream the incoming data directly to disk +rather than keeping a copy in memory all the time (SF#1200392). This +drastically reduces the buildmaster's memory requirements and makes 100MB+ +log files feasible. The log files are stored next to the serialized Builds, +in files like BASEDIR/builder-dir/12-log-compile-output, so you'll want a +cron job to delete old ones just like you do with old Builds. Old-style +Builds from 0.6.4 and earlier are converted when they are first read, so the +first load of the Waterfall display after updating to this release may take +quite some time. + +** build process updates + +BuildSteps can now return a status of EXCEPTION, which terminates the build +right away. This allows exceptions to be caught right away, but still make +sure the build stops quickly. + +** bug fixes + +Some more windows incompatibilities were fixed. The test suite now has two +failing tests remaining, both of which appear to be Twisted issues that +should not affect normal operation. + +The test suite no longer raises any deprecation warnings when run against +twisted-2.0 (except for the ones which come from Twisted itself). + + * Release 0.6.4 (28 Apr 2005) ** major bugs fixed Index: README =================================================================== RCS file: /cvsroot/buildbot/site/README,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- README 26 Apr 2005 03:44:41 -0000 1.13 +++ README 18 May 2005 08:30:48 -0000 1.14 @@ -43,6 +43,10 @@ The PyCon paper has a good description of the overall architecture. It is available in HTML form in docs/PyCon-2003/buildbot.html, or on the web page. +docs/buildbot.info contains the beginnings of the User's Manual, and the +Installation chapter is the best guide to use for setup instructions. The +.texinfo source can also be turned into printed documentation. + REQUIREMENTS: Python: http://www.python.org @@ -61,12 +65,10 @@ with Twisted-1.1.0, but 1.3.0 is the version that has received the most testing. - They run against Twisted-2.0.0 as well, albeit with a number of warnings - about the use of deprecated features. If you use Twisted-2.0, you'll need - at least "Twisted" (the core package), and you'll also want TwistedMail, - TwistedWeb, TwistedWords, and TwistedLore (for sending email, serving a - web status page, delivering build status via IRC, and generating the HTML - documentation, respectively). + Both work with Twisted-2.0.0 as well. You'll need at least "Twisted" (the + core package), and you'll also want TwistedMail, TwistedWeb, and + TwistedWords (for sending email, serving a web status page, and delivering + build status via IRC, respectively). CVSToys: http://purl.net/net/CVSToys @@ -76,16 +78,18 @@ a mail-parsing change source, or the SVN notification script), you will not need CVSToys. - INSTALLATION: +Please read the User's Manual in docs/buildbot.info for complete +instructions. + RUNNING THE UNIT TESTS If you would like to run the unit test suite, use a command like this: PYTHONPATH=. trial -v buildbot.test -This should run up to 109 tests, depending upon what VC tools you have +This should run up to 124 tests, depending upon what VC tools you have installed. On my desktop machine it takes about two minutes to complete. Nothing should fail, a few might be skipped. If any of the tests fail, you should stop and investigate the cause before continuing the installation @@ -168,10 +172,10 @@ keepalive defaults to running once every 10 minutes. To manually turn on application-level keepalives, or to set them to use some -other interval, add "--keepalive NNN" to the mktap command line. NNN is the -number of seconds between keepalives. Use as large a value as your NAT box -allows to reduce the amount of unnecessary traffic on the wire. 600 seconds -(10 minutes) is a reasonable value. +other interval, add "--keepalive NNN" to the 'buildbot slave' command line. +NNN is the number of seconds between keepalives. Use as large a value as your +NAT box allows to reduce the amount of unnecessary traffic on the wire. 600 +seconds (10 minutes) is a reasonable value. SETTING UP A BUILD MASTER: Index: index.html =================================================================== RCS file: /cvsroot/buildbot/site/index.html,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- index.html 28 Apr 2005 08:21:13 -0000 1.39 +++ index.html 18 May 2005 08:30:48 -0000 1.40 @@ -11,7 +11,7 @@ Current contents:

      -
    • The current release is buildbot-0.6.4 . You can download the source +
    • The current release is buildbot-0.6.5 . You can download the source from the sf.net download page here. The release is signed with my GPG public key, available -Last modified: Thu Apr 28 01:19:22 PDT 2005 +Last modified: Wed May 18 01:29:48 PDT 2005 From warner at users.sourceforge.net Fri May 20 21:09:37 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 20 May 2005 21:09:37 +0000 Subject: [Buildbot-commits] site source-Arch.html,1.3,1.4 Message-ID: Update of /cvsroot/buildbot/site In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31849 Modified Files: source-Arch.html Log Message: add the E56998FC key Index: source-Arch.html =================================================================== RCS file: /cvsroot/buildbot/site/source-Arch.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- source-Arch.html 6 Dec 2004 07:07:51 -0000 1.3 +++ source-Arch.html 20 May 2005 21:09:35 -0000 1.4 @@ -38,9 +38,10 @@ tla get arch at buildbot.sf.net--2004/buildbot--dev--0 -

      All changes are signed with a dedicated GPG key 0x12FF2BDA, -provided below. To verify the signatures on each revision as you access them, -import the key, and put something like the following in your +

      All changes are signed with one of two dedicated GPG keys: +0x12FF2BDA and 0xE56998FC, provided below. To +verify the signatures on each revision as you access them, import the key, +and put something like the following in your ~/.arch-params/signing/arch at buildbot.sf.net--2004.check (this uses the tla-gpg-check utility from the debian tla package), or see the -

      Please note that this is an automated signing key, with slightly less -security than my master +

      Please note that one of these is an automated signing key, with slightly +less security than my master key (0x1514A7BD) which is used to sign buildbot releases. It is signed by my master key.

      -pub  1024D/12FF2BDA 2004-12-05 Arch Signing Key (automated) <arch at buildbot.sf.net>
      -sub  1024g/9D779314 2004-12-05 [expires: 2009-12-04]
      +pub   1024D/E56998FC 2004-11-14
      +uid                  Brian Warner (Arch signing key) <warner-arch at lothar.com>
      +sub   1024g/DFCAB71C 2004-11-14
      +
      +pub   1024D/12FF2BDA 2004-12-05 [expires: 2009-12-04]
      +uid                  Arch Signing Key (automated) <arch at buildbot.sf.net>
      +sub   1024g/9D779314 2004-12-05 [expires: 2009-12-04]
       
       -----BEGIN PGP PUBLIC KEY BLOCK-----
      -Version: GnuPG v1.2.5 (GNU/Linux)
      +Version: GnuPG v1.4.1 (GNU/Linux)
       
      -mQGiBEGzfJERBAChqsnvXWFkx0PdfdD8pfuriKy0QxDaRW63KW+BC9P/AVkVW5h+
      -j4KKoBlF45V+nWEyu+PkNlDYscn94kodvytA1Ah1x1ZVR2SeqLEoQSgZV9WIfhBm
      -2wxHkCpSnfhxgr/a/YYeSBHIqqyl6ONU6CuXcrMNt1qnHe2k5NgfRob/UwCgghKe
      -gRbhCXOCirBb8EG10iohRjcEAJWl5ZWYHzIuqYv9FnLj/68onZhWZw3Rfldi7EMY
      -GJgNanhTs4o3I7S9qL5UXWl1VD1ypkPrLQwLz1sY7DqyEmEyJZeYDfUoHSXAq6in
      -6o/TgNkOo9BJNThpY2sEhXBsP7pEIb3m8b+JNt0tFaEdBFbYBxgWJqCu2Uyyl60X
      -ZLDiA/0VklvxyMtQSb5JHUD3JZ20m9/ejUUEizGpm7FbZD/+oTqI1WzzpJNzaUy7
      -74FHbhzx7Fgm3gZhCZRAvTLPnJuiiAZH4CwO0oHPOBd3PbpnQz34mqcVwn/ogXaT
      -EwT9mtSB7pcRyoOtopaOt9NKcGcFzi1gMvnHQsC4kUWi0dfnqLQzQXJjaCBTaWdu
      -aW5nIEtleSAoYXV0b21hdGVkKSA8YXJjaEBidWlsZGJvdC5zZi5uZXQ+iGQEExEC
      -ACQFAkGzfJECGwMFCQlmAYAGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQYoUuNBL/
      -K9oCeACeN5CEGXWi67yLRVA6GmA8ofHhlx8AnjQUXM82HHuPScO2/Ta4GWlyNq/Z
      -iEwEExECAAwFAkGz/8gFgwllfkkACgkQtGNUshUUp73g2ACeJCYRwYrpn6Fx5/Q/
      -Pvm/5BaN6xAAoIYLv4PwaBHuaHi5q32b4RFoDq8RuQENBEGzfJIQBADCxhNV9ZI+
      -d6EkITC3CFdFN7Q7s5YKCxYEhhgnWb4LrBiYG4iCpZptgakHzc4cf+xDGZbz9foN
      -lnMfS1UDgtCB3DFYSLS0Z1h2GfWPaUQH/EUqlZ2KcSCAq+loU+2PN4E6Kh05AuoD
      -yIrUtzwadV2upm+5BAf8j3ErGwrXeM6IwwADBQP+OKXD9pRidJgFuEMbioljHl8S
      -Dxl1L7Q6OFtCMl7/AjSx1kKHbn44n1jSIUQYZ9lbUibdK4BHfZI6EHm7lU6raaWR
      -JDbuGSTVTwakjPCHbPA3D2EYYGSIOODs2Y2/YrUHagWjDEJGfpczRquhY8Ysspfp
      -dV0r5DUEUnyVzrvJmyOITwQYEQIADwUCQbN8kgIbDAUJCWYBgAAKCRBihS40Ev8r
      -2tl9AJ4wYrucqksA+DYIF6d+oNT+3WhF0gCfY2YXan8ut+X58k/pfYc5zVAh+4s=
      -=jDx5
      +mQGiBEGX3MERBADZG5x8Gcy3A8l23E1Rc0aOYV+6Un9bLPkrEtgt/6DRqoiSYu2J
      +bbhz2Mwh4E4Ok2yYhvZ6QcGejm13HcVCUkWgec0H8nLHh/nXRJZ5Jim+61UHNV+w
      +B5Kk5BL4uh+IauqtvFbiLb6aAr9r0Rb3I0Igqr02EsnjPrBEsXN76vpi/wCg6pqH
      +aQvgC2/1jXfnj8WomFOo1MUD/AgWfdjg15CZ1gixKExTSQZSIyWVho+poL5nQhpB
      +IMg98SKDy0WLpmB32VW/RJyza2vT7s+mPTBv2+j/Mv4MsK91DW0YDH2VbZD3YwgV
      +atbyVtOBHAjQGkuf070LrIS92H3438eFxH66Wdba7Z14nKJleATqybQlc4g1S52e
      +VhQcBAC9SX6zOB+6uJWe9aVkYJl4kpGA9H1F/XW/DDakq/LotZyQI7Zp6djPlu3n
      +VIvQFQ4Qun/PoY5GsmfFDupJuSUQXxAD3dMsk+md8aq/kPnNg9Pg0Yx8i/bYYZYJ
      +RmZ/P1nzuJj9gbIkSiRX6svCft7vAh3RRU2t48oFWo3BJem1q7Q4QnJpYW4gV2Fy
      +bmVyIChBcmNoIHNpZ25pbmcga2V5KSA8d2FybmVyLWFyY2hAbG90aGFyLmNvbT6I
      +XgQTEQIAHgUCQZfcwQIbAwYLCQgHAwIDFQIDAxYCAQIeAQIXgAAKCRAtL6xH5WmY
      +/HIJAKCIy0sv3apTHnyzm5NUfhSzdw4WxwCaAvPJbe5RGn58ihlerHPQRsR7M8u5
      +AQ0EQZfcwhAEAOwxUb1s+YOG0GhSfHYsO7MXz04nIIOGewqNA0om9LeQuxGLRLy6
      +6YZy7E0BhmhWTdyPCM77ttrR6DouplaUdZCBJF+7/B+E0Fra9EodZIpPnFtfv3p4
      +79xEEdfruTHBdaMzAtM0OPViixRInaZxPNvBw4NF9QAjHsbKzVooB6X7AAMGBADZ
      +WX4A0nEpD6po24nNCGIrCF3emdv5qcgc8WqZ9GXZzENrzUpC/dN+h3IdWpZxXro2
      +oLZTQpi7XV5hs4tq2LH4qbMWm4GHuCLK9NK9lkK/5u9IESv+OBuBJHmrhxLNZ8we
      +YonrSmQxrR12ImvKzmXwBV1jh/ESfkDKiUPzU5mhjYhJBBgRAgAJBQJBl9zCAhsM
      +AAoJEC0vrEflaZj8adoAoIgAjkZgXFi122nfUSZvytjSMeXnAKCRIw41I5CX+dby
      +ZfvFo8E4NXZ+z5kBogRBs3yREQQAoarJ711hZMdD3X3Q/KX7q4istEMQ2kVutylv
      +gQvT/wFZFVuYfo+CiqAZReOVfp1hMrvj5DZQ2LHJ/eJKHb8rQNQIdcdWVUdknqix
      +KEEoGVfViH4QZtsMR5AqUp34cYK/2v2GHkgRyKqspejjVOgrl3KzDbdapx3tpOTY
      +H0aG/1MAoIISnoEW4QlzgoqwW/BBtdIqIUY3BACVpeWVmB8yLqmL/RZy4/+vKJ2Y
      +VmcN0X5XYuxDGBiYDWp4U7OKNyO0vai+VF1pdVQ9cqZD6y0MC89bGOw6shJhMiWX
      +mA31KB0lwKuop+qP04DZDqPQSTU4aWNrBIVwbD+6RCG95vG/iTbdLRWhHQRW2AcY
      +FiagrtlMspetF2Sw4gP9FZJb8cjLUEm+SR1A9yWdtJvf3o1FBIsxqZuxW2Q//qE6
      +iNVs86STc2lMu++BR24c8exYJt4GYQmUQL0yz5yboogGR+AsDtKBzzgXdz26Z0M9
      ++JqnFcJ/6IF2kxME/ZrUge6XEcqDraKWjrfTSnBnBc4tYDL5x0LAuJFFotHX56i0
      +M0FyY2ggU2lnbmluZyBLZXkgKGF1dG9tYXRlZCkgPGFyY2hAYnVpbGRib3Quc2Yu
      +bmV0PohkBBMRAgAkBQJBs3yRAhsDBQkJZgGABgsJCAcDAgMVAgMDFgIBAh4BAheA
      +AAoJEGKFLjQS/yvaAngAnjeQhBl1ouu8i0VQOhpgPKHx4ZcfAJ40FFzPNhx7j0nD
      +tv02uBlpcjav2YhMBBMRAgAMBQJBs//IBYMJZX5JAAoJELRjVLIVFKe94NgAniQm
      +EcGK6Z+hcef0Pz75v+QWjesQAKCGC7+D8GgR7mh4uat9m+ERaA6vEbkBDQRBs3yS
      +EAQAwsYTVfWSPnehJCEwtwhXRTe0O7OWCgsWBIYYJ1m+C6wYmBuIgqWabYGpB83O
      +HH/sQxmW8/X6DZZzH0tVA4LQgdwxWEi0tGdYdhn1j2lEB/xFKpWdinEggKvpaFPt
      +jzeBOiodOQLqA8iK1Lc8GnVdrqZvuQQH/I9xKxsK13jOiMMAAwUD/jilw/aUYnSY
      +BbhDG4qJYx5fEg8ZdS+0OjhbQjJe/wI0sdZCh25+OJ9Y0iFEGGfZW1Im3SuAR32S
      +OhB5u5VOq2mlkSQ27hkk1U8GpIzwh2zwNw9hGGBkiDjg7NmNv2K1B2oFowxCRn6X
      +M0aroWPGLLKX6XVdK+Q1BFJ8lc67yZsjiE8EGBECAA8FAkGzfJICGwwFCQlmAYAA
      +CgkQYoUuNBL/K9rZfQCeMGK7nKpLAPg2CBenfqDU/t1oRdIAn2NmF2p/Lrfl+fJP
      +6X2HOc1QIfuL
      +=4ynv
       -----END PGP PUBLIC KEY BLOCK-----
       
      @@ -107,5 +133,5 @@ Brian Warner <warner @ lothar.com> -Last modified: Sun Dec 5 23:07:27 PST 2004 +Last modified: Fri May 20 14:08:29 PDT 2005 From warner at users.sourceforge.net Fri May 20 21:12:06 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 20 May 2005 21:12:06 +0000 Subject: [Buildbot-commits] site source-Arch.html,1.4,1.5 Message-ID: Update of /cvsroot/buildbot/site In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32340 Modified Files: source-Arch.html Log Message: *** empty log message *** Index: source-Arch.html =================================================================== RCS file: /cvsroot/buildbot/site/source-Arch.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- source-Arch.html 20 May 2005 21:09:35 -0000 1.4 +++ source-Arch.html 20 May 2005 21:12:04 -0000 1.5 @@ -30,6 +30,10 @@
    • Version: buildbot--dev--0
    +

    (There is also a buildbot--release--$RELEASE branch, with one +version per release. For example, the 0.6.5 release is tagged onto the +buildbot--release--0.6.5 branch.)

    +

    Therefore, the following commands will get you an up-to-date Buildbot tree:

    @@ -133,5 +137,5 @@ Brian Warner <warner @ lothar.com> -Last modified: Fri May 20 14:08:29 PDT 2005 +Last modified: Fri May 20 14:11:38 PDT 2005 From warner at users.sourceforge.net Sun May 22 01:44:22 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 22 May 2005 01:44:22 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.452,1.453 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3211 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-212 Creator: Brian Warner fix some bugs in several 'buildbot' subcommands * buildbot/scripts/runner.py (run): call sendchange(), not do_sendchange(): thus 'buildbot sendchange' was broken in 0.6.5 (run): call stop("HUP"), not "-HUP", 'buildbot stop' was broken. (stop): don't wait for process to die when sending SIGHUP (masterTAC): use a rawstring for basedir=, otherwise '\' in the directory name gets interpreted, which you don't want (slaveTAC): same * buildbot/__init__.py (version): bump to 0.6.5+ while between releases Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.452 retrieving revision 1.453 diff -u -d -r1.452 -r1.453 --- ChangeLog 18 May 2005 08:01:36 -0000 1.452 +++ ChangeLog 22 May 2005 01:44:20 -0000 1.453 @@ -1,3 +1,16 @@ +2005-05-20 Brian Warner + + * buildbot/scripts/runner.py (run): call sendchange(), not + do_sendchange(): thus 'buildbot sendchange' was broken in 0.6.5 + (run): call stop("HUP"), not "-HUP", 'buildbot stop' was broken. + (stop): don't wait for process to die when sending SIGHUP + (masterTAC): use a rawstring for basedir=, otherwise '\' in the + directory name gets interpreted, which you don't want + (slaveTAC): same + + * buildbot/__init__.py (version): bump to 0.6.5+ while between + releases + 2005-05-18 Brian Warner * buildbot/__init__.py (version): Releasing buildbot-0.6.5 From warner at users.sourceforge.net Sun May 22 01:44:22 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 22 May 2005 01:44:22 +0000 Subject: [Buildbot-commits] buildbot/buildbot __init__.py,1.13,1.14 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3211/buildbot Modified Files: __init__.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-212 Creator: Brian Warner fix some bugs in several 'buildbot' subcommands * buildbot/scripts/runner.py (run): call sendchange(), not do_sendchange(): thus 'buildbot sendchange' was broken in 0.6.5 (run): call stop("HUP"), not "-HUP", 'buildbot stop' was broken. (stop): don't wait for process to die when sending SIGHUP (masterTAC): use a rawstring for basedir=, otherwise '\' in the directory name gets interpreted, which you don't want (slaveTAC): same * buildbot/__init__.py (version): bump to 0.6.5+ while between releases Index: __init__.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/__init__.py,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- __init__.py 18 May 2005 08:01:35 -0000 1.13 +++ __init__.py 22 May 2005 01:44:19 -0000 1.14 @@ -1,3 +1,3 @@ #! /usr/bin/python -version = "0.6.5" +version = "0.6.5+" From warner at users.sourceforge.net Sun May 22 01:44:21 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 22 May 2005 01:44:21 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.26,1.27 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3211/buildbot/scripts Modified Files: runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-212 Creator: Brian Warner fix some bugs in several 'buildbot' subcommands * buildbot/scripts/runner.py (run): call sendchange(), not do_sendchange(): thus 'buildbot sendchange' was broken in 0.6.5 (run): call stop("HUP"), not "-HUP", 'buildbot stop' was broken. (stop): don't wait for process to die when sending SIGHUP (masterTAC): use a rawstring for basedir=, otherwise '\' in the directory name gets interpreted, which you don't want (slaveTAC): same * buildbot/__init__.py (version): bump to 0.6.5+ while between releases Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- runner.py 18 May 2005 02:21:29 -0000 1.26 +++ runner.py 22 May 2005 01:44:19 -0000 1.27 @@ -194,8 +194,8 @@ from twisted.application import service from buildbot.master import BuildMaster -basedir = '%(basedir)s' -configfile = '%(config)s' +basedir = r'%(basedir)s' +configfile = r'%(config)s' application = service.Application('buildmaster') BuildMaster(basedir, configfile).setServiceParent(application) @@ -263,7 +263,7 @@ from twisted.application import service from buildbot.slave.bot import BuildSlave -basedir = '%(basedir)s' +basedir = r'%(basedir)s' host = '%(host)s' port = %(port)d slavename = '%(name)s' @@ -335,7 +335,7 @@ run() -def stop(config, signame="TERM"): +def stop(config, signame="TERM", wait=False): import signal basedir = config['basedir'] quiet = config['quiet'] @@ -345,6 +345,9 @@ signum = getattr(signal, "SIG"+signame) timer = 0 os.kill(pid, signum) + if not wait: + print "sent SIG%s to process" % signame + return time.sleep(0.1) while timer < 5: # poll once per second until twistd.pid goes away, up to 5 seconds @@ -609,11 +612,11 @@ elif command == "start": start(so) elif command == "stop": - stop(so) + stop(so, wait=True) elif command == "sighup": - stop(so, "-HUP") + stop(so, "HUP") elif command == "sendchange": - do_sendchange(so, True) + sendchange(so, True) elif command == "debugclient": debugclient(so) elif command == "statuslog": From warner at users.sourceforge.net Sun May 22 02:16:16 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 22 May 2005 02:16:16 +0000 Subject: [Buildbot-commits] buildbot/buildbot/process base.py,1.54,1.55 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/process In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6844/buildbot/process Modified Files: base.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-214 Creator: Brian Warner fix tests to run without a full Twisted-2.0.0 (Sumo) installation * buildbot/test/test_runner.py (Create.testMaster): match the rawstring change in runner.py:masterTAC * buildbot/test/test_config.py (ConfigTest.testIRC): skip unless TwistedWords is installed * buildbot/test/test_status.py: same, with TwistedMail * buildbot/master.py: remove old IRC/Waterfall imports (used by some old, deprecated, and removed config keys). This should enable you to use the base buildbot functionality with Twisted-2.0.0 when you don't also have TwistedWeb and TwistedWords installed Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/process/base.py,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- base.py 18 May 2005 07:49:30 -0000 1.54 +++ base.py 22 May 2005 02:16:14 -0000 1.55 @@ -7,7 +7,6 @@ from twisted.python.failure import Failure from twisted.internet import reactor, defer, error from twisted.spread import pb -import twisted.web.util from buildbot import interfaces from buildbot.twcompat import implements From warner at users.sourceforge.net Sun May 22 02:16:16 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 22 May 2005 02:16:16 +0000 Subject: [Buildbot-commits] buildbot/buildbot master.py,1.72,1.73 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6844/buildbot Modified Files: master.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-214 Creator: Brian Warner fix tests to run without a full Twisted-2.0.0 (Sumo) installation * buildbot/test/test_runner.py (Create.testMaster): match the rawstring change in runner.py:masterTAC * buildbot/test/test_config.py (ConfigTest.testIRC): skip unless TwistedWords is installed * buildbot/test/test_status.py: same, with TwistedMail * buildbot/master.py: remove old IRC/Waterfall imports (used by some old, deprecated, and removed config keys). This should enable you to use the base buildbot functionality with Twisted-2.0.0 when you don't also have TwistedWeb and TwistedWords installed Index: master.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- master.py 17 May 2005 10:14:10 -0000 1.72 +++ master.py 22 May 2005 02:16:14 -0000 1.73 @@ -27,8 +27,6 @@ from buildbot.process.interlock import Interlock from buildbot.process.builder import Builder from buildbot.status.builder import BuilderStatus, SlaveStatus, Status -from buildbot.status.html import Waterfall -from buildbot.status.words import IRC from buildbot.changes.changes import Change, ChangeMaster from buildbot import interfaces From warner at users.sourceforge.net Sun May 22 02:16:16 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 22 May 2005 02:16:16 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_runner.py,1.7,1.8 test_config.py,1.20,1.21 test_status.py,1.19,1.20 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6844/buildbot/test Modified Files: test_runner.py test_config.py test_status.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-214 Creator: Brian Warner fix tests to run without a full Twisted-2.0.0 (Sumo) installation * buildbot/test/test_runner.py (Create.testMaster): match the rawstring change in runner.py:masterTAC * buildbot/test/test_config.py (ConfigTest.testIRC): skip unless TwistedWords is installed * buildbot/test/test_status.py: same, with TwistedMail * buildbot/master.py: remove old IRC/Waterfall imports (used by some old, deprecated, and removed config keys). This should enable you to use the base buildbot functionality with Twisted-2.0.0 when you don't also have TwistedWeb and TwistedWords installed Index: test_config.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_config.py,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- test_config.py 17 May 2005 10:14:10 -0000 1.20 +++ test_config.py 22 May 2005 02:16:13 -0000 1.21 @@ -24,7 +24,11 @@ from buildbot.process.factory import BasicBuildFactory from buildbot.process.interlock import Interlock from buildbot.process import step -from buildbot.status import words, html, builder +from buildbot.status import html, builder +try: + from buildbot.status import words +except ImportError: + words = None import sys from twisted.python import log @@ -677,6 +681,8 @@ self.failUnlessEqual(ircs, expected) def testIRC(self): + if not words: + raise unittest.SkipTest("Twisted Words package is not installed") master = self.buildmaster master.loadChanges() d = master.loadConfig(emptyCfg) Index: test_runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_runner.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- test_runner.py 18 May 2005 01:59:53 -0000 1.7 +++ test_runner.py 22 May 2005 02:16:13 -0000 1.8 @@ -63,7 +63,7 @@ self.failUnless(os.path.exists(tac)) tacfile = open(tac,"rt").read() self.failUnlessIn("basedir", tacfile) - self.failUnlessIn("configfile = 'master.cfg'", tacfile) + self.failUnlessIn("configfile = r'master.cfg'", tacfile) self.failUnlessIn("BuildMaster(basedir, configfile)", tacfile) cfg = os.path.join(basedir, "master.cfg") Index: test_status.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_status.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- test_status.py 17 May 2005 10:14:10 -0000 1.19 +++ test_status.py 22 May 2005 02:16:13 -0000 1.20 @@ -8,7 +8,11 @@ from buildbot import interfaces from buildbot.twcompat import implements, providedBy -from buildbot.status import mail, builder +from buildbot.status import builder +try: + from buildbot.status import mail +except ImportError: + mail = None from buildbot.status import progress, client # NEEDS COVERAGE class MyStep: @@ -53,9 +57,10 @@ def finish(self): self.finished = True -class MyMailer(mail.MailNotifier): - def sendMessage(self, m, recipients): - self.parent.messages.append((m, recipients)) +if mail: + class MyMailer(mail.MailNotifier): + def sendMessage(self, m, recipients): + self.parent.messages.append((m, recipients)) class MyStatus: def getBuildbotURL(self): @@ -322,6 +327,9 @@ reactor.callLater(0.1, d.callback, None) dr(d) +if not mail: + Mail.skip = "the Twisted Mail package is not installed" + class Progress(unittest.TestCase): def testWavg(self): bp = progress.BuildProgress([]) From warner at users.sourceforge.net Sun May 22 02:16:17 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 22 May 2005 02:16:17 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.453,1.454 Makefile,1.10,1.11 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6844 Modified Files: ChangeLog Makefile Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-214 Creator: Brian Warner fix tests to run without a full Twisted-2.0.0 (Sumo) installation * buildbot/test/test_runner.py (Create.testMaster): match the rawstring change in runner.py:masterTAC * buildbot/test/test_config.py (ConfigTest.testIRC): skip unless TwistedWords is installed * buildbot/test/test_status.py: same, with TwistedMail * buildbot/master.py: remove old IRC/Waterfall imports (used by some old, deprecated, and removed config keys). This should enable you to use the base buildbot functionality with Twisted-2.0.0 when you don't also have TwistedWeb and TwistedWords installed Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.453 retrieving revision 1.454 diff -u -d -r1.453 -r1.454 --- ChangeLog 22 May 2005 01:44:20 -0000 1.453 +++ ChangeLog 22 May 2005 02:16:14 -0000 1.454 @@ -1,3 +1,17 @@ +2005-05-21 Brian Warner + + * buildbot/test/test_runner.py (Create.testMaster): match the + rawstring change in runner.py:masterTAC + + * buildbot/test/test_config.py (ConfigTest.testIRC): skip unless + TwistedWords is installed + * buildbot/test/test_status.py: same, with TwistedMail + + * buildbot/master.py: remove old IRC/Waterfall imports (used by + some old, deprecated, and removed config keys). This should enable + you to use the base buildbot functionality with Twisted-2.0.0 when + you don't also have TwistedWeb and TwistedWords installed + 2005-05-20 Brian Warner * buildbot/scripts/runner.py (run): call sendchange(), not Index: Makefile =================================================================== RCS file: /cvsroot/buildbot/buildbot/Makefile,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Makefile 18 May 2005 01:59:54 -0000 1.10 +++ Makefile 22 May 2005 02:16:14 -0000 1.11 @@ -22,7 +22,7 @@ #debuild -uc -us deb-snapshot: - debchange --newversion 0.6.4.snapshot.`date +%Y.%m.%d.%H.%M.%S` \ + debchange --newversion `PYTHONPATH=. python -c "import buildbot; print buildbot.version"`.`date +%Y.%m.%d.%H.%M.%S` \ "snapshot build" debuild binary From warner at users.sourceforge.net Sun May 22 02:16:17 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 22 May 2005 02:16:17 +0000 Subject: [Buildbot-commits] buildbot/debian changelog,1.7,1.8 Message-ID: Update of /cvsroot/buildbot/buildbot/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6844/debian Modified Files: changelog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-214 Creator: Brian Warner fix tests to run without a full Twisted-2.0.0 (Sumo) installation * buildbot/test/test_runner.py (Create.testMaster): match the rawstring change in runner.py:masterTAC * buildbot/test/test_config.py (ConfigTest.testIRC): skip unless TwistedWords is installed * buildbot/test/test_status.py: same, with TwistedMail * buildbot/master.py: remove old IRC/Waterfall imports (used by some old, deprecated, and removed config keys). This should enable you to use the base buildbot functionality with Twisted-2.0.0 when you don't also have TwistedWeb and TwistedWords installed Index: changelog =================================================================== RCS file: /cvsroot/buildbot/buildbot/debian/changelog,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- changelog 18 May 2005 08:01:34 -0000 1.7 +++ changelog 22 May 2005 02:16:15 -0000 1.8 @@ -1,3 +1,9 @@ +buildbot (0.6.5+.2005.05.21.19.13.46) unstable; urgency=low + + * snapshot build + + -- Brian Warner Sat, 21 May 2005 19:13:47 -0700 + buildbot (0.6.5-1) unstable; urgency=low * New upstream release From warner at users.sourceforge.net Mon May 23 17:45:58 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 23 May 2005 17:45:58 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_status.py,1.20,1.21 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6003/buildbot/test Modified Files: test_status.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-216 Creator: Brian Warner fix HTMLLogFile upgrades, add basedir to sys.path in 'buildbot start' * buildbot/scripts/runner.py (start): put the basedir in sys.path before starting: this was done by twistd back when we spawned it, now that we're importing the pieces and running them in the current process, we have to do it ourselves. This allows master.cfg to import files from the same directory without explicitly manipulating PYTHONPATH. Thanks to Thomas Vander Stichele for the catch. * buildbot/status/builder.py (HTMLLogFile.upgrade): oops! second fix to make this behave like other LogFiles, this time to handle existing LogFiles on disk. (add the missing .upgrade method) * buildbot/test/test_status.py (Log.testHTMLUpgrade): test it Index: test_status.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_status.py,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- test_status.py 22 May 2005 02:16:13 -0000 1.20 +++ test_status.py 23 May 2005 17:45:55 -0000 1.21 @@ -32,6 +32,11 @@ def getFilename(self): return os.path.join(self.fakeBuilderBasedir, self.name) +class MyHTMLLog(builder.HTMLLogFile): + def __init__(self, basedir, name, html): + step = MyStep() + builder.HTMLLogFile.__init__(self, step, name, name, html) + class MyLogSubscriber: def __init__(self): self.chunks = [] @@ -499,6 +504,10 @@ self.failIf(l.entries) self.failUnless(l.hasContents()) + def testHTMLUpgrade(self): + l = MyHTMLLog(self.basedir, "upgrade", "log contents") + l.upgrade("filename") + def testSubscribe(self): l1 = MyLog(self.basedir, "subscribe1") l1.finish() From warner at users.sourceforge.net Mon May 23 17:45:57 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 23 May 2005 17:45:57 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.454,1.455 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6003 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-216 Creator: Brian Warner fix HTMLLogFile upgrades, add basedir to sys.path in 'buildbot start' * buildbot/scripts/runner.py (start): put the basedir in sys.path before starting: this was done by twistd back when we spawned it, now that we're importing the pieces and running them in the current process, we have to do it ourselves. This allows master.cfg to import files from the same directory without explicitly manipulating PYTHONPATH. Thanks to Thomas Vander Stichele for the catch. * buildbot/status/builder.py (HTMLLogFile.upgrade): oops! second fix to make this behave like other LogFiles, this time to handle existing LogFiles on disk. (add the missing .upgrade method) * buildbot/test/test_status.py (Log.testHTMLUpgrade): test it Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.454 retrieving revision 1.455 diff -u -d -r1.454 -r1.455 --- ChangeLog 22 May 2005 02:16:14 -0000 1.454 +++ ChangeLog 23 May 2005 17:45:55 -0000 1.455 @@ -1,3 +1,18 @@ +2005-05-23 Brian Warner + + * buildbot/scripts/runner.py (start): put the basedir in sys.path + before starting: this was done by twistd back when we spawned it, + now that we're importing the pieces and running them in the + current process, we have to do it ourselves. This allows + master.cfg to import files from the same directory without + explicitly manipulating PYTHONPATH. Thanks to Thomas Vander + Stichele for the catch. + + * buildbot/status/builder.py (HTMLLogFile.upgrade): oops! second + fix to make this behave like other LogFiles, this time to handle + existing LogFiles on disk. (add the missing .upgrade method) + * buildbot/test/test_status.py (Log.testHTMLUpgrade): test it + 2005-05-21 Brian Warner * buildbot/test/test_runner.py (Create.testMaster): match the From warner at users.sourceforge.net Mon May 23 17:45:57 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 23 May 2005 17:45:57 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.27,1.28 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6003/buildbot/scripts Modified Files: runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-216 Creator: Brian Warner fix HTMLLogFile upgrades, add basedir to sys.path in 'buildbot start' * buildbot/scripts/runner.py (start): put the basedir in sys.path before starting: this was done by twistd back when we spawned it, now that we're importing the pieces and running them in the current process, we have to do it ourselves. This allows master.cfg to import files from the same directory without explicitly manipulating PYTHONPATH. Thanks to Thomas Vander Stichele for the catch. * buildbot/status/builder.py (HTMLLogFile.upgrade): oops! second fix to make this behave like other LogFiles, this time to handle existing LogFiles on disk. (add the missing .upgrade method) * buildbot/test/test_status.py (Log.testHTMLUpgrade): test it Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- runner.py 22 May 2005 01:44:19 -0000 1.27 +++ runner.py 23 May 2005 17:45:54 -0000 1.28 @@ -304,6 +304,7 @@ basedir = config['basedir'] quiet = config['quiet'] os.chdir(basedir) + sys.path.insert(0, os.path.abspath(os.getcwd())) if os.path.exists("/usr/bin/make") and os.path.exists("Makefile.buildbot"): # Preferring the Makefile lets slave admins do useful things like set # up environment variables for the buildslave. From warner at users.sourceforge.net Mon May 23 17:45:58 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 23 May 2005 17:45:58 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status builder.py,1.58,1.59 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6003/buildbot/status Modified Files: builder.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-216 Creator: Brian Warner fix HTMLLogFile upgrades, add basedir to sys.path in 'buildbot start' * buildbot/scripts/runner.py (start): put the basedir in sys.path before starting: this was done by twistd back when we spawned it, now that we're importing the pieces and running them in the current process, we have to do it ourselves. This allows master.cfg to import files from the same directory without explicitly manipulating PYTHONPATH. Thanks to Thomas Vander Stichele for the catch. * buildbot/status/builder.py (HTMLLogFile.upgrade): oops! second fix to make this behave like other LogFiles, this time to handle existing LogFiles on disk. (add the missing .upgrade method) * buildbot/test/test_status.py (Log.testHTMLUpgrade): test it Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- builder.py 17 May 2005 10:14:09 -0000 1.58 +++ builder.py 23 May 2005 17:45:56 -0000 1.59 @@ -481,6 +481,9 @@ del d['step'] return d + def upgrade(self, logfilename): + pass + class Event: if implements: From warner at users.sourceforge.net Mon May 23 22:48:07 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 23 May 2005 22:48:07 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.28,1.29 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13391/buildbot/scripts Modified Files: runner.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-218 Creator: Brian Warner add --version, update NEWS * NEWS: update for 0.6.6 release * buildbot/scripts/runner.py (Options.opt_version): Add a --version command (actually, just make the existing --version command emit Buildbot's version too) Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- runner.py 23 May 2005 17:45:54 -0000 1.28 +++ runner.py 23 May 2005 22:47:51 -0000 1.29 @@ -587,6 +587,11 @@ # TODO: 'try', 'watch' ] + def opt_version(self): + import buildbot + print "Buildbot version: %s" % buildbot.version + usage.Options.opt_version(self) + def postOptions(self): if not hasattr(self, 'subOptions'): raise usage.UsageError("must specify a command") From warner at users.sourceforge.net Mon May 23 22:48:08 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 23 May 2005 22:48:08 +0000 Subject: [Buildbot-commits] buildbot/debian changelog,1.8,1.9 Message-ID: Update of /cvsroot/buildbot/buildbot/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13391/debian Modified Files: changelog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-218 Creator: Brian Warner add --version, update NEWS * NEWS: update for 0.6.6 release * buildbot/scripts/runner.py (Options.opt_version): Add a --version command (actually, just make the existing --version command emit Buildbot's version too) Index: changelog =================================================================== RCS file: /cvsroot/buildbot/buildbot/debian/changelog,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- changelog 22 May 2005 02:16:15 -0000 1.8 +++ changelog 23 May 2005 22:48:06 -0000 1.9 @@ -1,9 +1,3 @@ -buildbot (0.6.5+.2005.05.21.19.13.46) unstable; urgency=low - - * snapshot build - - -- Brian Warner Sat, 21 May 2005 19:13:47 -0700 - buildbot (0.6.5-1) unstable; urgency=low * New upstream release From warner at users.sourceforge.net Mon May 23 22:48:08 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 23 May 2005 22:48:08 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.455,1.456 NEWS,1.43,1.44 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13391 Modified Files: ChangeLog NEWS Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-218 Creator: Brian Warner add --version, update NEWS * NEWS: update for 0.6.6 release * buildbot/scripts/runner.py (Options.opt_version): Add a --version command (actually, just make the existing --version command emit Buildbot's version too) Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.455 retrieving revision 1.456 diff -u -d -r1.455 -r1.456 --- ChangeLog 23 May 2005 17:45:55 -0000 1.455 +++ ChangeLog 23 May 2005 22:48:05 -0000 1.456 @@ -1,5 +1,7 @@ 2005-05-23 Brian Warner + * NEWS: update for 0.6.6 release + * buildbot/scripts/runner.py (start): put the basedir in sys.path before starting: this was done by twistd back when we spawned it, now that we're importing the pieces and running them in the @@ -7,6 +9,8 @@ master.cfg to import files from the same directory without explicitly manipulating PYTHONPATH. Thanks to Thomas Vander Stichele for the catch. + (Options.opt_version): Add a --version command (actually, just make + the existing --version command emit Buildbot's version too) * buildbot/status/builder.py (HTMLLogFile.upgrade): oops! second fix to make this behave like other LogFiles, this time to handle Index: NEWS =================================================================== RCS file: /cvsroot/buildbot/buildbot/NEWS,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- NEWS 18 May 2005 07:49:31 -0000 1.43 +++ NEWS 23 May 2005 22:48:05 -0000 1.44 @@ -1,5 +1,36 @@ User visible changes in Buildbot. +* Release 0.6.6 (23 May 2005) + +** bugs fixed + +The 'sendchange', 'stop', and 'sighup' subcommands were broken, simple bugs +that were not caught by the test suite. Sorry. + +The 'buildbot master' command now uses "raw" strings to create .tac files +that will still function under windows (since we must put directory names +that contain backslashes into that file). + +The keep-on-disk behavior added in 0.6.5 included the ability to upgrade old +in-pickle LogFile instances. This upgrade function was not added to the +HTMLLogFile class, so an exception would be raised when attempting to load or +display any build with one of these logs (which are normally used only for +showing build exceptions). This has been fixed. + +Several unnecessary imports were removed, so the Buildbot should function +normally with just Twisted-2.0.0's "Core" module installed. (of course you +will need TwistedWeb, TwistedWords, and/or TwistedMail if you use status +targets that require them). The test suite should skip all tests that cannot +be run because of missing Twisted modules. + +The master/slave's basedir is now prepended to sys.path before starting the +daemon. This used to happen implicitly (as a result of twistd's setup +preamble), but 0.6.5 internalized the invocation of twistd and did not copy +this behavior. This change restores the ability to access "private.py"-style +modules in the basedir from the master.cfg file with a simple "import +private" statement. Thanks to Thomas Vander Stichele for the catch. + + * Release 0.6.5 (18 May 2005) ** deprecated config keys removed From warner at users.sourceforge.net Mon May 23 23:27:57 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 23 May 2005 23:27:57 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.456,1.457 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22550 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-220 Creator: Brian Warner release 0.6.6 * buildbot/__init__.py (version): release 0.6.6 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.456 retrieving revision 1.457 diff -u -d -r1.456 -r1.457 --- ChangeLog 23 May 2005 22:48:05 -0000 1.456 +++ ChangeLog 23 May 2005 23:27:44 -0000 1.457 @@ -1,6 +1,11 @@ 2005-05-23 Brian Warner + * buildbot/__init__.py (version): release 0.6.6 + +2005-05-23 Brian Warner + * NEWS: update for 0.6.6 release + * debian/changelog: same * buildbot/scripts/runner.py (start): put the basedir in sys.path before starting: this was done by twistd back when we spawned it, From warner at users.sourceforge.net Mon May 23 23:27:57 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 23 May 2005 23:27:57 +0000 Subject: [Buildbot-commits] buildbot/debian changelog,1.9,1.10 Message-ID: Update of /cvsroot/buildbot/buildbot/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22550/debian Modified Files: changelog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-220 Creator: Brian Warner release 0.6.6 * buildbot/__init__.py (version): release 0.6.6 Index: changelog =================================================================== RCS file: /cvsroot/buildbot/buildbot/debian/changelog,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- changelog 23 May 2005 22:48:06 -0000 1.9 +++ changelog 23 May 2005 23:27:55 -0000 1.10 @@ -1,3 +1,9 @@ +buildbot (0.6.6-1) unstable; urgency=low + + * New upstream release + + -- Brian Warner Mon, 23 May 2005 16:06:52 -0700 + buildbot (0.6.5-1) unstable; urgency=low * New upstream release From warner at users.sourceforge.net Mon May 23 23:27:46 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 23 May 2005 23:27:46 +0000 Subject: [Buildbot-commits] buildbot/buildbot __init__.py,1.14,1.15 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22550/buildbot Modified Files: __init__.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-220 Creator: Brian Warner release 0.6.6 * buildbot/__init__.py (version): release 0.6.6 Index: __init__.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/__init__.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- __init__.py 22 May 2005 01:44:19 -0000 1.14 +++ __init__.py 23 May 2005 23:27:43 -0000 1.15 @@ -1,3 +1,3 @@ #! /usr/bin/python -version = "0.6.5+" +version = "0.6.6" From warner at users.sourceforge.net Mon May 23 23:53:58 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Mon, 23 May 2005 23:53:58 +0000 Subject: [Buildbot-commits] site ChangeLog,1.21,1.22 NEWS,1.7,1.8 index.html,1.40,1.41 Message-ID: Update of /cvsroot/buildbot/site In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28535 Modified Files: ChangeLog NEWS index.html Log Message: update for 0.6.6 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/site/ChangeLog,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- ChangeLog 18 May 2005 08:30:47 -0000 1.21 +++ ChangeLog 23 May 2005 23:53:55 -0000 1.22 @@ -1,3 +1,54 @@ +2005-05-23 Brian Warner + + * buildbot/__init__.py (version): release 0.6.6 + +2005-05-23 Brian Warner + + * NEWS: update for 0.6.6 release + * debian/changelog: same + + * buildbot/scripts/runner.py (start): put the basedir in sys.path + before starting: this was done by twistd back when we spawned it, + now that we're importing the pieces and running them in the + current process, we have to do it ourselves. This allows + master.cfg to import files from the same directory without + explicitly manipulating PYTHONPATH. Thanks to Thomas Vander + Stichele for the catch. + (Options.opt_version): Add a --version command (actually, just make + the existing --version command emit Buildbot's version too) + + * buildbot/status/builder.py (HTMLLogFile.upgrade): oops! second + fix to make this behave like other LogFiles, this time to handle + existing LogFiles on disk. (add the missing .upgrade method) + * buildbot/test/test_status.py (Log.testHTMLUpgrade): test it + +2005-05-21 Brian Warner + + * buildbot/test/test_runner.py (Create.testMaster): match the + rawstring change in runner.py:masterTAC + + * buildbot/test/test_config.py (ConfigTest.testIRC): skip unless + TwistedWords is installed + * buildbot/test/test_status.py: same, with TwistedMail + + * buildbot/master.py: remove old IRC/Waterfall imports (used by + some old, deprecated, and removed config keys). This should enable + you to use the base buildbot functionality with Twisted-2.0.0 when + you don't also have TwistedWeb and TwistedWords installed + +2005-05-20 Brian Warner + + * buildbot/scripts/runner.py (run): call sendchange(), not + do_sendchange(): thus 'buildbot sendchange' was broken in 0.6.5 + (run): call stop("HUP"), not "-HUP", 'buildbot stop' was broken. + (stop): don't wait for process to die when sending SIGHUP + (masterTAC): use a rawstring for basedir=, otherwise '\' in the + directory name gets interpreted, which you don't want + (slaveTAC): same + + * buildbot/__init__.py (version): bump to 0.6.5+ while between + releases + 2005-05-18 Brian Warner * buildbot/__init__.py (version): Releasing buildbot-0.6.5 Index: NEWS =================================================================== RCS file: /cvsroot/buildbot/site/NEWS,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- NEWS 18 May 2005 08:30:48 -0000 1.7 +++ NEWS 23 May 2005 23:53:55 -0000 1.8 @@ -1,5 +1,36 @@ User visible changes in Buildbot. +* Release 0.6.6 (23 May 2005) + +** bugs fixed + +The 'sendchange', 'stop', and 'sighup' subcommands were broken, simple bugs +that were not caught by the test suite. Sorry. + +The 'buildbot master' command now uses "raw" strings to create .tac files +that will still function under windows (since we must put directory names +that contain backslashes into that file). + +The keep-on-disk behavior added in 0.6.5 included the ability to upgrade old +in-pickle LogFile instances. This upgrade function was not added to the +HTMLLogFile class, so an exception would be raised when attempting to load or +display any build with one of these logs (which are normally used only for +showing build exceptions). This has been fixed. + +Several unnecessary imports were removed, so the Buildbot should function +normally with just Twisted-2.0.0's "Core" module installed. (of course you +will need TwistedWeb, TwistedWords, and/or TwistedMail if you use status +targets that require them). The test suite should skip all tests that cannot +be run because of missing Twisted modules. + +The master/slave's basedir is now prepended to sys.path before starting the +daemon. This used to happen implicitly (as a result of twistd's setup +preamble), but 0.6.5 internalized the invocation of twistd and did not copy +this behavior. This change restores the ability to access "private.py"-style +modules in the basedir from the master.cfg file with a simple "import +private" statement. Thanks to Thomas Vander Stichele for the catch. + + * Release 0.6.5 (18 May 2005) ** deprecated config keys removed Index: index.html =================================================================== RCS file: /cvsroot/buildbot/site/index.html,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- index.html 18 May 2005 08:30:48 -0000 1.40 +++ index.html 23 May 2005 23:53:55 -0000 1.41 @@ -11,7 +11,7 @@ Current contents:
      -
    • The current release is buildbot-0.6.5 . You can download the source +
    • The current release is buildbot-0.6.6 . You can download the source from the sf.net download page here. The release is signed with my GPG public key, available -Last modified: Wed May 18 01:29:48 PDT 2005 +Last modified: Mon May 23 16:52:31 PDT 2005 From warner at users.sourceforge.net Tue May 24 18:57:51 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 24 May 2005 18:57:51 +0000 Subject: [Buildbot-commits] buildbot/buildbot __init__.py,1.15,1.16 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24023/buildbot Modified Files: __init__.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-223 Creator: Brian Warner handle old Change instances without exploding * buildbot/changes/changes.py (Change.branch): doh! Add a class-level attribute to accomodate old Change instances that were pickled before 0.6.5 (where .branch was added for new Changes). This fixes the exception that occurs when you try to look at an old Change (through asHTML). * buildbot/__init__.py (version): bump to 0.6.6+ while between releases Index: __init__.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/__init__.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- __init__.py 23 May 2005 23:27:43 -0000 1.15 +++ __init__.py 24 May 2005 18:57:49 -0000 1.16 @@ -1,3 +1,3 @@ #! /usr/bin/python -version = "0.6.6" +version = "0.6.6+" From warner at users.sourceforge.net Tue May 24 18:57:52 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 24 May 2005 18:57:52 +0000 Subject: [Buildbot-commits] buildbot/buildbot/changes changes.py,1.24,1.25 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/changes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24023/buildbot/changes Modified Files: changes.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-223 Creator: Brian Warner handle old Change instances without exploding * buildbot/changes/changes.py (Change.branch): doh! Add a class-level attribute to accomodate old Change instances that were pickled before 0.6.5 (where .branch was added for new Changes). This fixes the exception that occurs when you try to look at an old Change (through asHTML). * buildbot/__init__.py (version): bump to 0.6.6+ while between releases Index: changes.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/changes.py,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- changes.py 18 May 2005 07:49:29 -0000 1.24 +++ changes.py 24 May 2005 18:57:49 -0000 1.25 @@ -57,8 +57,10 @@ else: __implements__ = interfaces.IStatusEvent, - links = [] number = None + + links = [] + branch = None revision = None # used to create a source-stamp def __init__(self, who, files, comments, isdir=0, links=[], From warner at users.sourceforge.net Tue May 24 18:57:52 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 24 May 2005 18:57:52 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.457,1.458 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24023 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-223 Creator: Brian Warner handle old Change instances without exploding * buildbot/changes/changes.py (Change.branch): doh! Add a class-level attribute to accomodate old Change instances that were pickled before 0.6.5 (where .branch was added for new Changes). This fixes the exception that occurs when you try to look at an old Change (through asHTML). * buildbot/__init__.py (version): bump to 0.6.6+ while between releases Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.457 retrieving revision 1.458 diff -u -d -r1.457 -r1.458 --- ChangeLog 23 May 2005 23:27:44 -0000 1.457 +++ ChangeLog 24 May 2005 18:57:50 -0000 1.458 @@ -1,3 +1,14 @@ +2005-05-24 Brian Warner + + * buildbot/changes/changes.py (Change.branch): doh! Add a + class-level attribute to accomodate old Change instances that were + pickled before 0.6.5 (where .branch was added for new Changes). + This fixes the exception that occurs when you try to look at an + old Change (through asHTML). + + * buildbot/__init__.py (version): bump to 0.6.6+ while between + releases + 2005-05-23 Brian Warner * buildbot/__init__.py (version): release 0.6.6 From warner at users.sourceforge.net Tue May 24 22:33:03 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 24 May 2005 22:33:03 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.458,1.459 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4686 Modified Files: ChangeLog Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-225 Creator: Brian Warner fix slave-reconnect on network loss * buildbot/pbutil.py (ReconnectingPBClientFactory): Twisted-1.3 erroneously abandons the connection (in clientConnectionFailed) for non-UserErrors, which means that if we lose the connection due to a network problem or a timeout, we'll never try to reconnect. Fix this by not upcalling to the buggy parent method. Note: twisted-2.0 fixes this, but the function only has 3 lines so it makes more sense to copy it than to try and detect the buggyness of the parent class. Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.458 retrieving revision 1.459 diff -u -d -r1.458 -r1.459 --- ChangeLog 24 May 2005 18:57:50 -0000 1.458 +++ ChangeLog 24 May 2005 22:33:00 -0000 1.459 @@ -1,5 +1,14 @@ 2005-05-24 Brian Warner + * buildbot/pbutil.py (ReconnectingPBClientFactory): Twisted-1.3 + erroneously abandons the connection (in clientConnectionFailed) + for non-UserErrors, which means that if we lose the connection due + to a network problem or a timeout, we'll never try to reconnect. + Fix this by not upcalling to the buggy parent method. Note: + twisted-2.0 fixes this, but the function only has 3 lines so it + makes more sense to copy it than to try and detect the buggyness + of the parent class. + * buildbot/changes/changes.py (Change.branch): doh! Add a class-level attribute to accomodate old Change instances that were pickled before 0.6.5 (where .branch was added for new Changes). From warner at users.sourceforge.net Tue May 24 22:33:02 2005 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 24 May 2005 22:33:02 +0000 Subject: [Buildbot-commits] buildbot/buildbot pbutil.py,1.9,1.10 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4686/buildbot Modified Files: pbutil.py Log Message: Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-225 Creator: Brian Warner fix slave-reconnect on network loss * buildbot/pbutil.py (ReconnectingPBClientFactory): Twisted-1.3 erroneously abandons the connection (in clientConnectionFailed) for non-UserErrors, which means that if we lose the connection due to a network problem or a timeout, we'll never try to reconnect. Fix this by not upcalling to the buggy parent method. Note: twisted-2.0 fixes this, but the function only has 3 lines so it makes more sense to copy it than to try and detect the buggyness of the parent class. Index: pbutil.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/pbutil.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- pbutil.py 22 Apr 2005 21:29:19 -0000 1.9 +++ pbutil.py 24 May 2005 22:33:00 -0000 1.10 @@ -50,8 +50,12 @@ def clientConnectionFailed(self, connector, reason): PBClientFactory.clientConnectionFailed(self, connector, reason) - RCF = protocol.ReconnectingClientFactory - RCF.clientConnectionFailed(self, connector, reason) + # Twisted-1.3 erroneously abandons the connection on non-UserErrors. + # To avoid this bug, don't upcall, and implement the correct version + # of the method here. + if self.continueTrying: + self.connector = connector + self.retry() def clientConnectionLost(self, connector, reason): PBClientFactory.clientConnectionLost(self, connector, reason,