From warner at users.sourceforge.net Tue Sep 25 20:07:32 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 25 Sep 2007 20:07:32 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_runner.py, 1.14, 1.15 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27923/buildbot/test Modified Files: test_runner.py Log Message: [project @ implement first phase of new 'buildbot upgrade-master' command] Original author: warner at lothar.com Date: 2007-09-25 20:01:51+00:00 Index: test_runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_runner.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- test_runner.py 2 Jul 2007 17:44:49 -0000 1.14 +++ test_runner.py 25 Sep 2007 20:07:30 -0000 1.15 @@ -80,6 +80,12 @@ def failIfExists(self, filename): self.failIf(os.path.exists(filename), "%s should not exist" % filename) + def setUp(self): + self.cwd = os.getcwd() + + def tearDown(self): + os.chdir(self.cwd) + def testMaster(self): basedir = "test_runner.master" options = runner.MasterOptions() @@ -149,6 +155,63 @@ self.failUnlessEqual(samplecfg, oldsamplecfg, "*should* rewrite master.cfg.sample") + def testUpgradeMaster(self): + # first, create a master and then upgrade it. Nothing should change. + basedir = "test_runner.master2" + options = runner.MasterOptions() + options.parseOptions(["-q", basedir]) + cwd = os.getcwd() + runner.createMaster(options) + os.chdir(cwd) + + files1 = self.record_files(basedir) + + # upgrade it + options = runner.UpgradeMasterOptions() + options.parseOptions([basedir]) + cwd = os.getcwd() + runner.upgradeMaster(options) + os.chdir(cwd) + + files2 = self.record_files(basedir) + self.failUnlessSameFiles(files1, files2) + + # now make it look like the one that 0.7.6 creates: no public_html + for fn in os.listdir(os.path.join(basedir, "public_html")): + os.unlink(os.path.join(basedir, "public_html", fn)) + os.rmdir(os.path.join(basedir, "public_html")) + + # and make sure that upgrading it re-populates public_html + options = runner.UpgradeMasterOptions() + options.parseOptions([basedir]) + cwd = os.getcwd() + runner.upgradeMaster(options) + os.chdir(cwd) + + files3 = self.record_files(basedir) + self.failUnlessSameFiles(files1, files3) + + def failUnlessSameFiles(self, files1, files2): + f1 = set(files1.keys()) + f2 = set(files2.keys()) + msg = "" + if f2 - f1: + msg += "Missing from files1: %s\n" % (list(f2-f1),) + if f1 - f2: + msg += "Missing from files2: %s\n" % (list(f1-f2),) + if msg: + self.fail(msg) + + def record_files(self, basedir): + allfiles = {} + for root, dirs, files in os.walk(basedir): + for f in files: + fn = os.path.join(root, f) + allfiles[fn] = ("FILE", open(fn,"rb").read()) + for d in dirs: + allfiles[os.path.join(root, d)] = ("DIR",) + return allfiles + def testSlave(self): basedir = "test_runner.slave" From warner at users.sourceforge.net Tue Sep 25 20:07:31 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 25 Sep 2007 20:07:31 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.923,1.924 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27923 Modified Files: ChangeLog Log Message: [project @ implement first phase of new 'buildbot upgrade-master' command] Original author: warner at lothar.com Date: 2007-09-25 20:01:51+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.923 retrieving revision 1.924 diff -u -d -r1.923 -r1.924 --- ChangeLog 14 Aug 2007 03:51:44 -0000 1.923 +++ ChangeLog 25 Sep 2007 20:07:29 -0000 1.924 @@ -1,3 +1,12 @@ +2007-09-25 Brian Warner + + * buildbot/scripts/runner.py (upgradeMaster): first phase of the + new 'upgrade-master' command, which will bring an old buildmaster + directory up-to-date. Right now the only thing it does is populate + public_html/ if it wasn't already there. Still to do: check the + other files, add documentation. + * buildbot/test/test_runner.py (Create.testUpgradeMaster): test it + 2007-08-13 Brian Warner * buildbot/changes/changes.py (Change.get_HTML_box): add a tooltip From warner at users.sourceforge.net Tue Sep 25 20:07:32 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 25 Sep 2007 20:07:32 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.55,1.56 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27923/buildbot/scripts Modified Files: runner.py Log Message: [project @ implement first phase of new 'buildbot upgrade-master' command] Original author: warner at lothar.com Date: 2007-09-25 20:01:51+00:00 Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- runner.py 13 Aug 2007 17:22:44 -0000 1.55 +++ runner.py 25 Sep 2007 20:07:29 -0000 1.56 @@ -59,7 +59,7 @@ def __init__(self, config): self.config = config self.basedir = config['basedir'] - self.force = config['force'] + self.force = config.get('force', False) self.quiet = config['quiet'] def mkdir(self): @@ -153,30 +153,73 @@ f.close() os.chmod(target, 0600) - def public_html(self, index_html, buildbot_css, robots_txt): - if os.path.exists("public_html"): - if not self.quiet: - print "public_html/ already exists: not replacing" - return + def public_html(self, index_html, buildbot_css, robots_txt, + repopulate=False): + webdir = os.path.join(self.basedir, "public_html") + if os.path.exists(webdir): + if not repopulate: + if not self.quiet: + print "public_html/ already exists: not replacing" + return + else: + os.mkdir(webdir) if not self.quiet: print "populating public_html/" - os.mkdir("public_html") - target = os.path.join("public_html", "index.html") + target = os.path.join(webdir, "index.html") f = open(target, "wt") f.write(open(index_html, "rt").read()) f.close() - target = os.path.join("public_html", "buildbot.css") + target = os.path.join(webdir, "buildbot.css") f = open(target, "wt") f.write(open(buildbot_css, "rt").read()) f.close() - target = os.path.join("public_html", "robots.txt") + target = os.path.join(webdir, "robots.txt") f = open(target, "wt") f.write(open(robots_txt, "rt").read()) f.close() +class UpgradeMasterOptions(MakerBase): + optFlags = [ + ["replace", "r", "Replace any modified files without confirmation."], + ] + + def getSynopsis(self): + return "Usage: buildbot upgrade-master [options] " + + longdesc = """ + This command takes an existing buildmaster working directory and + adds/modifies the files there to work with the current version of + buildbot. When this command is finished, the buildmaster directory should + look much like a brand-new one created by the 'create-master' command. + + Use this after you've upgraded your buildbot installation and before you + restart the buildmaster to use the new version. + + If you have modified the files in your working directory, this command + will leave them untouched, but will put the new recommended contents in a + .new file (for example, if index.html has been modified, this command + will create index.html.new). You can then look at the new version and + decide how to merge its contents into your modified file. + """ + +def upgradeMaster(config): + basedir = config['basedir'] + m = Maker(config) + m.quiet = True + # check TAC file + # check sample.cfg + # check web files: index.html, classic.css, robots.txt + webdir = os.path.join(basedir, "public_html") + m.public_html(util.sibpath(__file__, "../status/web/index.html"), + util.sibpath(__file__, "../status/web/classic.css"), + util.sibpath(__file__, "../status/web/robots.txt"), + repopulate=True + ) + # check Makefile + class MasterOptions(MakerBase): optFlags = [ ["force", "f", @@ -684,6 +727,8 @@ # the following are all admin commands ['create-master', None, MasterOptions, "Create and populate a directory for a new buildmaster"], + ['upgrade-master', None, UpgradeMasterOptions, + "Upgrade an existing buildmaster directory for the current version"], ['create-slave', None, SlaveOptions, "Create and populate a directory for a new buildslave"], ['start', None, StartOptions, "Start a buildmaster or buildslave"], @@ -746,6 +791,8 @@ if command == "create-master": createMaster(so) + elif command == "upgrade-master": + upgradeMaster(so) elif command == "create-slave": createSlave(so) elif command == "start": From warner at users.sourceforge.net Tue Sep 25 20:39:51 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 25 Sep 2007 20:39:51 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.924,1.925 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8891 Modified Files: ChangeLog Log Message: [project @ test_runner.py: use sets.Set() for python2.3 compatibility] Original author: warner at lothar.com Date: 2007-09-25 20:39:19+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.924 retrieving revision 1.925 diff -u -d -r1.924 -r1.925 --- ChangeLog 25 Sep 2007 20:07:29 -0000 1.924 +++ ChangeLog 25 Sep 2007 20:39:48 -0000 1.925 @@ -6,6 +6,7 @@ public_html/ if it wasn't already there. Still to do: check the other files, add documentation. * buildbot/test/test_runner.py (Create.testUpgradeMaster): test it + (Create.failUnlessSameFiles): use sets.Set() for 2.3 compatibility 2007-08-13 Brian Warner From warner at users.sourceforge.net Tue Sep 25 20:39:51 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 25 Sep 2007 20:39:51 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_runner.py, 1.15, 1.16 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8891/buildbot/test Modified Files: test_runner.py Log Message: [project @ test_runner.py: use sets.Set() for python2.3 compatibility] Original author: warner at lothar.com Date: 2007-09-25 20:39:19+00:00 Index: test_runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_runner.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- test_runner.py 25 Sep 2007 20:07:30 -0000 1.15 +++ test_runner.py 25 Sep 2007 20:39:49 -0000 1.16 @@ -4,6 +4,7 @@ from twisted.trial import unittest from twisted.python import usage import os, shutil, shlex +import sets from buildbot.scripts import runner, tryclient @@ -192,8 +193,8 @@ self.failUnlessSameFiles(files1, files3) def failUnlessSameFiles(self, files1, files2): - f1 = set(files1.keys()) - f2 = set(files2.keys()) + f1 = sets.Set(files1.keys()) + f2 = sets.Set(files2.keys()) msg = "" if f2 - f1: msg += "Missing from files1: %s\n" % (list(f2-f1),) From warner at users.sourceforge.net Tue Sep 25 22:50:33 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 25 Sep 2007 22:50:33 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web base.py, 1.8, 1.9 waterfall.py, 1.17, 1.18 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30075/buildbot/status/web Modified Files: base.py waterfall.py Log Message: [project @ webstatus: make sure we use relative paths for help/welcome pages] Original author: warner at lothar.com Date: 2007-09-25 22:42:45+00:00 Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/base.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- base.py 13 Aug 2007 08:20:51 -0000 1.8 +++ base.py 25 Sep 2007 22:50:31 -0000 1.9 @@ -163,9 +163,10 @@ return request.site.buildbot_service.parent.change_svc def path_to_root(self, request): - segs = len(request.prepath) - if request.prepath and request.prepath[-1] == '': - segs -= 1 + if request.prepath: + segs = len(request.prepath) - 1 + else: + segs = 0 root = "../" * segs return root Index: waterfall.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/waterfall.py,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- waterfall.py 13 Aug 2007 17:22:54 -0000 1.17 +++ waterfall.py 25 Sep 2007 22:50:31 -0000 1.18 @@ -531,11 +531,15 @@ for k in newargs for v in newargs[k] ]) - new_url = req.URLPath() if new_path: - new_url.path = new_path - new_url.query = newquery - return str(new_url) + new_url = new_path + elif req.prepath: + new_url = req.prepath[-1] + else: + new_url = '' + if newquery: + new_url += "?" + newquery + return new_url if timestamps: bottom = timestamps[-1] From warner at users.sourceforge.net Tue Sep 25 22:50:38 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 25 Sep 2007 22:50:38 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.926,1.927 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30094 Modified Files: ChangeLog Log Message: [project @ waterfall: make links more visually distinct, handle unused buildslaves] Original author: warner at lothar.com Date: 2007-09-25 22:45:55+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.926 retrieving revision 1.927 diff -u -d -r1.926 -r1.927 --- ChangeLog 25 Sep 2007 22:50:31 -0000 1.926 +++ ChangeLog 25 Sep 2007 22:50:36 -0000 1.927 @@ -1,5 +1,14 @@ 2007-09-25 Brian Warner + * buildbot/status/web/waterfall.py (HELP): put the View button in + its own section, so it doesn't get visually confused with the + reload-timer section + (WaterfallStatusResource.body): make the '[help]' links more + visually distinct from each other, and add a link to the Welcome + page + * buildbot/status/web/slaves.py (BuildSlavesResource): handle + unused buildslaves without exploding + * buildbot/status/web/waterfall.py (WaterfallStatusResource.body.with_args): don't use req.URLPath, it gives us absolute paths that break proxies From warner at users.sourceforge.net Tue Sep 25 22:50:38 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 25 Sep 2007 22:50:38 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web slaves.py, 1.1, 1.2 waterfall.py, 1.18, 1.19 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30094/buildbot/status/web Modified Files: slaves.py waterfall.py Log Message: [project @ waterfall: make links more visually distinct, handle unused buildslaves] Original author: warner at lothar.com Date: 2007-09-25 22:45:55+00:00 Index: slaves.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/slaves.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- slaves.py 12 Aug 2007 22:23:07 -0000 1.1 +++ slaves.py 25 Sep 2007 22:50:36 -0000 1.2 @@ -31,8 +31,11 @@ data += "
  • %s:\n" % name data += "
      \n" builder_links = ['%s' % (bname, bname) - for bname in used_by_builder[name]] - data += "
    • Used by: %s
    • \n" % ", ".join(builder_links) + for bname in used_by_builder.get(name, [])] + if builder_links: + data += "
    • Used by: %s
    • \n" % ", ".join(builder_links) + else: + data += "
    • Not used by any Builders
    • \n" if slave.isConnected(): data += "
    • Slave is currently connected
    • \n" admin = slave.getAdmin() Index: waterfall.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/waterfall.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- waterfall.py 25 Sep 2007 22:50:31 -0000 1.18 +++ waterfall.py 25 Sep 2007 22:50:36 -0000 1.19 @@ -304,6 +304,7 @@ %(show_reload_input)s +

      Reload Waterfall Page

      @@ -545,15 +546,18 @@ bottom = timestamps[-1] nextpage = with_args(request, ["last_time"], [("last_time", str(int(bottom)))]) - data += 'next page\n' % nextpage + data += '[next page]\n' % nextpage helpurl = self.path_to_root(request) + "waterfall/help" helppage = with_args(request, new_path=helpurl) - data += 'help\n' % helppage + data += '[help]\n' % helppage + + welcomeurl = self.path_to_root(request) + "." + data += '[welcome]\n' % welcomeurl if self.get_reload_time(request) is not None: no_reload_page = with_args(request, remove_args=["reload"]) - data += 'Stop Reloading\n' % no_reload_page + data += '[Stop Reloading]\n' % no_reload_page data += "
      \n" From warner at users.sourceforge.net Tue Sep 25 22:50:42 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 25 Sep 2007 22:50:42 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web base.py,1.9,1.10 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30113/buildbot/status/web Modified Files: base.py Log Message: [project @ buildbot.status.web.base: add comments to path_to_root] Original author: warner at lothar.com Date: 2007-09-25 22:48:15+00:00 Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/base.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- base.py 25 Sep 2007 22:50:31 -0000 1.9 +++ base.py 25 Sep 2007 22:50:40 -0000 1.10 @@ -163,6 +163,10 @@ return request.site.buildbot_service.parent.change_svc def path_to_root(self, request): + # /waterfall : ['waterfall'] -> '' + # /somewhere/lower : ['somewhere', 'lower'] -> '../' + # /somewhere/indexy/ : ['somewhere', 'indexy', ''] -> '../../' + # / : [] -> '' if request.prepath: segs = len(request.prepath) - 1 else: From warner at users.sourceforge.net Tue Sep 25 22:50:33 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 25 Sep 2007 22:50:33 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.925,1.926 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30075 Modified Files: ChangeLog Log Message: [project @ webstatus: make sure we use relative paths for help/welcome pages] Original author: warner at lothar.com Date: 2007-09-25 22:42:45+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.925 retrieving revision 1.926 diff -u -d -r1.925 -r1.926 --- ChangeLog 25 Sep 2007 20:39:48 -0000 1.925 +++ ChangeLog 25 Sep 2007 22:50:31 -0000 1.926 @@ -1,5 +1,12 @@ 2007-09-25 Brian Warner + * buildbot/status/web/waterfall.py + (WaterfallStatusResource.body.with_args): don't use req.URLPath, + it gives us absolute paths that break proxies + * buildbot/status/web/base.py (HtmlResource.path_to_root): fix + this, it was giving bad results when the Waterfall is behind a + reverse proxy. + * buildbot/scripts/runner.py (upgradeMaster): first phase of the new 'upgrade-master' command, which will bring an old buildmaster directory up-to-date. Right now the only thing it does is populate From warner at users.sourceforge.net Tue Sep 25 23:04:31 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 25 Sep 2007 23:04:31 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.927,1.928 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3222 Modified Files: ChangeLog Log Message: [project @ waterfall.py: fix weird compression when show_events=false is used] Original author: warner at lothar.com Date: 2007-09-25 23:03:25+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.927 retrieving revision 1.928 diff -u -d -r1.927 -r1.928 --- ChangeLog 25 Sep 2007 22:50:36 -0000 1.927 +++ ChangeLog 25 Sep 2007 23:04:29 -0000 1.928 @@ -1,5 +1,9 @@ 2007-09-25 Brian Warner + * buildbot/status/web/waterfall.py (Spacer): make this *not* + inherit from builder.Event, so that show_events=false doesn't hide + spacers, since that would make the waterfall weirdly compressed. + * buildbot/status/web/waterfall.py (HELP): put the View button in its own section, so it doesn't get visually confused with the reload-timer section From warner at users.sourceforge.net Tue Sep 25 23:04:31 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Tue, 25 Sep 2007 23:04:31 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web waterfall.py, 1.19, 1.20 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3222/buildbot/status/web Modified Files: waterfall.py Log Message: [project @ waterfall.py: fix weird compression when show_events=false is used] Original author: warner at lothar.com Date: 2007-09-25 23:03:25+00:00 Index: waterfall.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/waterfall.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- waterfall.py 25 Sep 2007 22:50:36 -0000 1.19 +++ waterfall.py 25 Sep 2007 23:04:29 -0000 1.20 @@ -182,11 +182,20 @@ components.registerAdapter(EventBox, builder.Event, IBox) -class Spacer(builder.Event): +class Spacer: + implements(interfaces.IStatusEvent) + def __init__(self, start, finish): self.started = start self.finished = finish + def getTimes(self): + return (self.started, self.finished) + def getText(self): + return [] + def getColor(self): + return None + class SpacerBox(components.Adapter): implements(IBox) @@ -661,6 +670,11 @@ try: while True: e = g.next() + # e might be builder.BuildStepStatus, + # builder.BuildStatus, builder.Event, + # waterfall.Spacer(builder.Event), or changes.Change . + # The showEvents=False flag means we should hide + # builder.Event . if not showEvents and isinstance(e, builder.Event): continue break From warner at users.sourceforge.net Wed Sep 26 06:32:26 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 26 Sep 2007 06:32:26 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web baseweb.py, 1.19, 1.20 index.html, 1.3, 1.4 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15834/buildbot/status/web Modified Files: baseweb.py index.html Log Message: [project @ web: add OneBoxPerBuilder] Original author: warner at lothar.com Date: 2007-09-26 06:31:16+00:00 Index: baseweb.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/baseweb.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- baseweb.py 13 Aug 2007 17:22:49 -0000 1.19 +++ baseweb.py 26 Sep 2007 06:32:24 -0000 1.20 @@ -1,16 +1,16 @@ -import os, sys, time +import os, sys, time, urllib from itertools import count from zope.interface import implements from twisted.python import log from twisted.application import strports, service -from twisted.web import server, distrib, static +from twisted.web import server, distrib, static, html from twisted.spread import pb from buildbot.interfaces import IControl, IStatusReceiver -from buildbot.status.web.base import HtmlResource, css_classes +from buildbot.status.web.base import HtmlResource, css_classes, Box, build_get_class, ICurrentBox from buildbot.status.web.waterfall import WaterfallStatusResource from buildbot.status.web.changes import ChangesResource from buildbot.status.web.builder import BuildersResource @@ -182,6 +182,58 @@ return data +# /one_box_per_builder +# accepts builder=, branch= +class OneBoxPerBuilder(HtmlResource): + """This shows a narrow table with one row per build. The leftmost column + contains the builder name. The next column contains the results of the + most recent build. The right-hand column shows the builder's current + activity. + + builder=: show only builds for this builder. Multiple builder= arguments + can be used to see builds from any builder in the set. + """ + + title = "Latest Build" + + def body(self, req): + status = self.getStatus(req) + + builders = req.args.get("builder", status.getBuilderNames()) + branches = [b for b in req.args.get("branch", []) if b] + + data = "" + + data += "

      Latest builds

      \n" + data += "\n" + for bn in builders: + builder = status.getBuilder(bn) + data += "\n" + data += "\n" % html.escape(bn) + b = builder.getLastFinishedBuild() + if b: + url = "%s/builders/%s/builds/%d" % \ + (self.path_to_root(req), + urllib.quote(bn, safe=''), + b.getNumber()) + try: + label = b.getProperty("got_revision") + except KeyError: + label = None + if not label or len(str(label)) > 20: + label = "#%d" % b.getNumber() + text = ['%s' % (url, label)] + text.extend(b.getText()) + box = Box(text, b.getColor(), + class_="LastBuild %s" % build_get_class(b)) + data += box.td(align="center") + else: + data += "\n" + current_box = ICurrentBox(builder).getBox(status) + data += current_box.td(align="center") + data += "
      %s
      \n" + return data + HEADER = ''' @@ -364,6 +416,7 @@ self.putChild("buildslaves", BuildSlavesResource()) #self.putChild("schedulers", SchedulersResource()) self.putChild("one_line_per_build", OneLinePerBuild()) + self.putChild("one_box_per_builder", OneBoxPerBuilder()) self.putChild("xmlrpc", XMLRPCServer()) self.putChild("about", AboutBuildbot()) Index: index.html =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/index.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- index.html 13 Aug 2007 17:22:49 -0000 1.3 +++ index.html 26 Sep 2007 06:32:24 -0000 1.4 @@ -12,7 +12,11 @@
    • the Waterfall Display will give you a time-oriented summary of recent buildbot activity.
    • -
    • Recent Builds are summarized here.
    • +
    • The Latest Build for each builder is + here.
    • + +
    • Recent Builds are summarized here, one + per line.
    • Buildslave information
    • ChangeSource information.
    • From warner at users.sourceforge.net Wed Sep 26 06:32:26 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 26 Sep 2007 06:32:26 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.928,1.929 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15834 Modified Files: ChangeLog Log Message: [project @ web: add OneBoxPerBuilder] Original author: warner at lothar.com Date: 2007-09-26 06:31:16+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.928 retrieving revision 1.929 diff -u -d -r1.928 -r1.929 --- ChangeLog 25 Sep 2007 23:04:29 -0000 1.928 +++ ChangeLog 26 Sep 2007 06:32:24 -0000 1.929 @@ -1,5 +1,10 @@ 2007-09-25 Brian Warner + * buildbot/status/web/baseweb.py (OneBoxPerBuilder): new status + page, shows a simple table with one row per Builder. Still pretty + ugly, but functional. + * buildbot/status/web/index.html: reference it + * buildbot/status/web/waterfall.py (Spacer): make this *not* inherit from builder.Event, so that show_events=false doesn't hide spacers, since that would make the waterfall weirdly compressed. From warner at users.sourceforge.net Wed Sep 26 06:32:31 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 26 Sep 2007 06:32:31 +0000 Subject: [Buildbot-commits] buildbot/docs buildbot.texinfo,1.119,1.120 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15852/docs Modified Files: buildbot.texinfo Log Message: [project @ docs: provide an example of using WebStatus] Original author: warner at lothar.com Date: 2007-09-26 06:31:41+00:00 Index: buildbot.texinfo =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/buildbot.texinfo,v retrieving revision 1.119 retrieving revision 1.120 diff -u -d -r1.119 -r1.120 --- buildbot.texinfo 13 Aug 2007 17:22:49 -0000 1.119 +++ buildbot.texinfo 26 Sep 2007 06:32:29 -0000 1.120 @@ -5941,6 +5941,11 @@ sample files, which you will probably want to customize for your own project. + at example +from buildbot.status.html import WebStatus +c['status'].append(WebStatus(8080)) + at end example + Certain URL prefixes are handled specially by code within the buildbot. The pages available in these spaces provide various views into the buildbot status, each with a different focus. These pages can be From warner at users.sourceforge.net Wed Sep 26 06:32:31 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 26 Sep 2007 06:32:31 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.929,1.930 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15852 Modified Files: ChangeLog Log Message: [project @ docs: provide an example of using WebStatus] Original author: warner at lothar.com Date: 2007-09-26 06:31:41+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.929 retrieving revision 1.930 diff -u -d -r1.929 -r1.930 --- ChangeLog 26 Sep 2007 06:32:24 -0000 1.929 +++ ChangeLog 26 Sep 2007 06:32:29 -0000 1.930 @@ -1,5 +1,7 @@ 2007-09-25 Brian Warner + * docs/buildbot.texinfo (WebStatus): provide an example + * buildbot/status/web/baseweb.py (OneBoxPerBuilder): new status page, shows a simple table with one row per Builder. Still pretty ugly, but functional. From warner at users.sourceforge.net Wed Sep 26 09:41:13 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 26 Sep 2007 09:41:13 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web base.py,1.10,1.11 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26064/buildbot/status/web Modified Files: base.py Log Message: [project @ web/base.py: fix addSlash to emit relative URLs] Original author: warner at lothar.com Date: 2007-09-26 09:40:03+00:00 Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/base.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- base.py 25 Sep 2007 22:50:40 -0000 1.10 +++ base.py 26 Sep 2007 09:41:11 -0000 1.11 @@ -1,4 +1,5 @@ +import urlparse from zope.interface import Interface from twisted.web import html, resource from buildbot.status import builder @@ -142,7 +143,15 @@ def render(self, request): if self.addSlash and request.prepath[-1] != '': - request.redirect(request.URLPath().child('')) + # this is intended to behave like request.URLPath().child('') + # but we need a relative URL, since we might be living behind a + # reverse proxy + url = request.prePathURL() + scheme, netloc, path, query, fragment = urlparse.urlsplit(url) + new_url = request.prepath[-1] + "/" + if query: + new_url += "?" + query + request.redirect(new_url) return '' data = self.content(request) From warner at users.sourceforge.net Wed Sep 26 09:41:13 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 26 Sep 2007 09:41:13 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.930,1.931 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26064 Modified Files: ChangeLog Log Message: [project @ web/base.py: fix addSlash to emit relative URLs] Original author: warner at lothar.com Date: 2007-09-26 09:40:03+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.930 retrieving revision 1.931 diff -u -d -r1.930 -r1.931 --- ChangeLog 26 Sep 2007 06:32:29 -0000 1.930 +++ ChangeLog 26 Sep 2007 09:41:10 -0000 1.931 @@ -1,5 +1,8 @@ 2007-09-25 Brian Warner + * buildbot/status/web/base.py (HtmlResource.render): fix addSlash + to emit relative URLs instead of using URLPath, + * docs/buildbot.texinfo (WebStatus): provide an example * buildbot/status/web/baseweb.py (OneBoxPerBuilder): new status From warner at users.sourceforge.net Wed Sep 26 09:57:32 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 26 Sep 2007 09:57:32 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.931,1.932 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32237 Modified Files: ChangeLog Log Message: [project @ baseweb.py: fix a URL problem with the build links] Original author: warner at lothar.com Date: 2007-09-26 09:56:51+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.931 retrieving revision 1.932 diff -u -d -r1.931 -r1.932 --- ChangeLog 26 Sep 2007 09:41:10 -0000 1.931 +++ ChangeLog 26 Sep 2007 09:57:30 -0000 1.932 @@ -1,3 +1,8 @@ +2007-09-26 Brian Warner + + * buildbot/status/web/baseweb.py (OneBoxPerBuilder.body): fix URL + problem with the build links + 2007-09-25 Brian Warner * buildbot/status/web/base.py (HtmlResource.render): fix addSlash From warner at users.sourceforge.net Wed Sep 26 09:57:32 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 26 Sep 2007 09:57:32 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web baseweb.py, 1.20, 1.21 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32237/buildbot/status/web Modified Files: baseweb.py Log Message: [project @ baseweb.py: fix a URL problem with the build links] Original author: warner at lothar.com Date: 2007-09-26 09:56:51+00:00 Index: baseweb.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/baseweb.py,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- baseweb.py 26 Sep 2007 06:32:24 -0000 1.20 +++ baseweb.py 26 Sep 2007 09:57:30 -0000 1.21 @@ -212,10 +212,10 @@ data += "%s\n" % html.escape(bn) b = builder.getLastFinishedBuild() if b: - url = "%s/builders/%s/builds/%d" % \ - (self.path_to_root(req), - urllib.quote(bn, safe=''), - b.getNumber()) + url = (self.path_to_root(req) + + "builders/" + + urllib.quote(bn, safe='') + + "/builds/%d" % b.getNumber()) try: label = b.getProperty("got_revision") except KeyError: From warner at users.sourceforge.net Thu Sep 27 22:51:12 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 27 Sep 2007 22:51:12 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web base.py, 1.11, 1.12 build.py, 1.7, 1.8 builder.py, 1.7, 1.8 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18818/buildbot/status/web Modified Files: base.py build.py builder.py Log Message: [project @ web: update HTML titles of many pages] Original author: warner at lothar.com Date: 2007-09-27 19:32:50+00:00 Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/base.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- base.py 26 Sep 2007 09:41:11 -0000 1.11 +++ base.py 27 Sep 2007 22:51:10 -0000 1.12 @@ -133,7 +133,7 @@ class HtmlResource(resource.Resource): # this is a cheap sort of template thingy contentType = "text/html; charset=UTF-8" - title = "Dummy" + title = "Buildbot" addSlash = False # adapted from Nevow def getChild(self, path, request): Index: build.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/build.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- build.py 12 Aug 2007 07:44:06 -0000 1.7 +++ build.py 27 Sep 2007 22:51:10 -0000 1.8 @@ -12,7 +12,6 @@ # builders/$builder/builds/$buildnum class StatusResourceBuild(HtmlResource): - title = "Build" addSlash = True def __init__(self, build_status, build_control, builder_control): @@ -21,6 +20,11 @@ self.build_control = build_control self.builder_control = builder_control + def getTitle(self, request): + return ("Buildbot: %s Build #%d" % + (html.escape(self.builder_status.getName()), + self.build_status.getNumber())) + def body(self, req): b = self.build_status status = self.getStatus(req) Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/builder.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- builder.py 12 Aug 2007 22:22:57 -0000 1.7 +++ builder.py 27 Sep 2007 22:51:10 -0000 1.8 @@ -21,6 +21,9 @@ self.builder_status = builder_status self.builder_control = builder_control + def getTitle(self, request): + return "Buildbot: %s" % html.escape(self.builder_status.getName()) + def build_line(self, build, req): buildnum = build.getNumber() buildurl = "builds/%d" % buildnum From warner at users.sourceforge.net Thu Sep 27 22:51:12 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 27 Sep 2007 22:51:12 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.932,1.933 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18818 Modified Files: ChangeLog Log Message: [project @ web: update HTML titles of many pages] Original author: warner at lothar.com Date: 2007-09-27 19:32:50+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.932 retrieving revision 1.933 diff -u -d -r1.932 -r1.933 --- ChangeLog 26 Sep 2007 09:57:30 -0000 1.932 +++ ChangeLog 27 Sep 2007 22:51:09 -0000 1.933 @@ -1,3 +1,12 @@ +2007-09-27 Brian Warner + + * buildbot/status/web/base.py (HtmlResource.title): change the + default title of all Buildbot-generated page to "Buildbot" + * buildbot/status/web/builder.py (StatusResourceBuilder.getTitle): + change the title to include the Builder name + * buildbot/status/web/build.py (StatusResourceBuild.getTitle): + same, and also show the build number + 2007-09-26 Brian Warner * buildbot/status/web/baseweb.py (OneBoxPerBuilder.body): fix URL From warner at users.sourceforge.net Thu Sep 27 22:51:16 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 27 Sep 2007 22:51:16 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web build.py,1.8,1.9 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18841/buildbot/status/web Modified Files: build.py Log Message: [project @ web: have the 'Rebuild this build' button redirect to the Builder page] Original author: warner at lothar.com Date: 2007-09-27 19:34:38+00:00 Index: build.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/build.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- build.py 27 Sep 2007 22:51:10 -0000 1.8 +++ build.py 27 Sep 2007 22:51:14 -0000 1.9 @@ -190,8 +190,8 @@ def rebuild(self, req): b = self.build_status bc = self.builder_control - log.msg("web rebuild of build %s:%s" % \ - (b.getBuilder().getName(), b.getNumber())) + builder_name = b.getBuilder().getName() + log.msg("web rebuild of build %s:%s" % (builder_name, b.getNumber())) name = req.args.get("username", [""])[0] comments = req.args.get("comments", [""])[0] reason = ("The web-page 'rebuild' button was pressed by " @@ -202,9 +202,21 @@ # TODO: indicate an error else: bc.resubmitBuild(b, reason) - # we're at http://localhost:8080/svn-hello/builds/5/rebuild?[args] and - # we want to go to the top, at http://localhost:8080/ - r = Redirect("../../..") # TODO: no longer correct + # we're at + # http://localhost:8080/builders/NAME/builds/5/rebuild?[args] + # Where should we send them? + # + # Ideally it would be to the per-build page that they just started, + # but we don't know the build number for it yet (besides, it might + # have to wait for a current build to finish). The next-most + # preferred place is somewhere that the user can see tangible + # evidence of their build starting (or to see the reason that it + # didn't start). This could either be the Builder page, or the + # waterfall. + #r = Redirect("../../../..") # this takes us back to the welcome page + #r = Redirect("../../../../waterfall") # or the Waterfall + #r = Redirect("../../../../waterfall?show=%s" % builder_name) + r = Redirect("../..") # the Builder's page d = defer.Deferred() reactor.callLater(1, d.callback, r) return DeferredResource(d) From warner at users.sourceforge.net Thu Sep 27 22:51:16 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 27 Sep 2007 22:51:16 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.933,1.934 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18841 Modified Files: ChangeLog Log Message: [project @ web: have the 'Rebuild this build' button redirect to the Builder page] Original author: warner at lothar.com Date: 2007-09-27 19:34:38+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.933 retrieving revision 1.934 diff -u -d -r1.933 -r1.934 --- ChangeLog 27 Sep 2007 22:51:09 -0000 1.933 +++ ChangeLog 27 Sep 2007 22:51:14 -0000 1.934 @@ -6,6 +6,8 @@ change the title to include the Builder name * buildbot/status/web/build.py (StatusResourceBuild.getTitle): same, and also show the build number + (StatusResourceBuild.rebuild): after using the 'Rebuild' button, + redirect the browser to the Builder page 2007-09-26 Brian Warner From warner at users.sourceforge.net Thu Sep 27 22:51:20 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 27 Sep 2007 22:51:20 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web build.py,1.9,1.10 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18858/buildbot/status/web Modified Files: build.py Log Message: [project @ web.build.StatusResourceBuild: oops, fix silly mistake in getTitle] Original author: warner at lothar.com Date: 2007-09-27 19:43:04+00:00 Index: build.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/build.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- build.py 27 Sep 2007 22:51:14 -0000 1.9 +++ build.py 27 Sep 2007 22:51:18 -0000 1.10 @@ -22,7 +22,7 @@ def getTitle(self, request): return ("Buildbot: %s Build #%d" % - (html.escape(self.builder_status.getName()), + (html.escape(self.build_status.getBuilder().getName()), self.build_status.getNumber())) def body(self, req): From warner at users.sourceforge.net Thu Sep 27 22:51:25 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 27 Sep 2007 22:51:25 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web build.py, 1.10, 1.11 builder.py, 1.8, 1.9 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18873/buildbot/status/web Modified Files: build.py builder.py Log Message: [project @ web: Builder/Build: use a relative link to the welcome page] Original author: warner at lothar.com Date: 2007-09-27 22:39:16+00:00 Index: build.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/build.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- build.py 27 Sep 2007 22:51:18 -0000 1.10 +++ build.py 27 Sep 2007 22:51:23 -0000 1.11 @@ -28,10 +28,9 @@ def body(self, req): b = self.build_status status = self.getStatus(req) - buildbotURL = status.getBuildbotURL() projectName = status.getProjectName() - data = '\n'%(buildbotURL, - projectName) + data = ('\n' + % projectName) # the color in the following line gives python-mode trouble builder_name = b.getBuilder().getName() data += ("

      Builder %s: Build #%d

      \n" Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/builder.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- builder.py 27 Sep 2007 22:51:10 -0000 1.8 +++ builder.py 27 Sep 2007 22:51:23 -0000 1.9 @@ -53,10 +53,9 @@ slaves = b.getSlaves() connected_slaves = [s for s in slaves if s.isConnected()] - buildbotURL = status.getBuildbotURL() projectName = status.getProjectName() - data = "%s\n" % (buildbotURL, projectName) + data = '%s\n' % projectName data += "

      Builder: %s

      \n" % html.escape(b.getName()) From warner at users.sourceforge.net Thu Sep 27 22:51:25 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 27 Sep 2007 22:51:25 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.934,1.935 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18873 Modified Files: ChangeLog Log Message: [project @ web: Builder/Build: use a relative link to the welcome page] Original author: warner at lothar.com Date: 2007-09-27 22:39:16+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.934 retrieving revision 1.935 diff -u -d -r1.934 -r1.935 --- ChangeLog 27 Sep 2007 22:51:14 -0000 1.934 +++ ChangeLog 27 Sep 2007 22:51:23 -0000 1.935 @@ -1,5 +1,10 @@ 2007-09-27 Brian Warner + * buildbot/status/web/build.py (StatusResourceBuild.body): use a + relative URL to the buildbot welcome page, rather than + getBuildbotURL. + * buildbot/status/web/builder.py (StatusResourceBuilder.body): same + * buildbot/status/web/base.py (HtmlResource.title): change the default title of all Buildbot-generated page to "Buildbot" * buildbot/status/web/builder.py (StatusResourceBuilder.getTitle): From warner at users.sourceforge.net Fri Sep 28 09:33:33 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 28 Sep 2007 09:33:33 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.935,1.936 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11817 Modified Files: ChangeLog Log Message: [project @ web: big cleanup of URL generation, to use relative links everywhere] Original author: warner at lothar.com Date: 2007-09-28 09:08:11+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.935 retrieving revision 1.936 diff -u -d -r1.935 -r1.936 --- ChangeLog 27 Sep 2007 22:51:23 -0000 1.935 +++ ChangeLog 28 Sep 2007 09:33:31 -0000 1.936 @@ -1,3 +1,12 @@ +2007-09-28 Brian Warner + + * buildbot/status/web/*: big set of changes to WebStatus, cleaning + up generation of relative URLs. With luck, this should play with + reverse proxies much better now. + * buildbot/test/test_webparts.py: new test for most of the subpages + * buildbot/test/test_web.py (base_config): add enough of a config + to exercise more Waterfall code + 2007-09-27 Brian Warner * buildbot/status/web/build.py (StatusResourceBuild.body): use a From warner at users.sourceforge.net Fri Sep 28 09:33:33 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 28 Sep 2007 09:33:33 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_webparts.py, NONE, 1.1 test_web.py, 1.48, 1.49 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11817/buildbot/test Modified Files: test_web.py Added Files: test_webparts.py Log Message: [project @ web: big cleanup of URL generation, to use relative links everywhere] Original author: warner at lothar.com Date: 2007-09-28 09:08:11+00:00 Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- test_web.py 7 Aug 2007 19:21:40 -0000 1.48 +++ test_web.py 28 Sep 2007 09:33:31 -0000 1.49 @@ -34,11 +34,18 @@ base_config = """ +from buildbot.changes.pb import PBChangeSource from buildbot.status import html +from buildbot.buildslave import BuildSlave +from buildbot.scheduler import Scheduler +from buildbot.process.factory import BuildFactory + BuildmasterConfig = c = { - 'slaves': [], - 'schedulers': [], - 'builders': [], + 'change_source': PBChangeSource(), + 'slaves': [BuildSlave('bot1name', 'bot1passwd')], + 'schedulers': [Scheduler('name', None, 60, ['builder1'])], + 'builders': [{'name': 'builder1', 'slavename': 'bot1name', + 'builddir': 'builder1', 'factory': BuildFactory()}], 'slavePortnum': 0, } """ @@ -108,8 +115,8 @@ class BaseWeb: master = None - def failUnlessIn(self, substr, string): - self.failUnless(string.find(substr) != -1) + def failUnlessIn(self, substr, string, note=None): + self.failUnless(string.find(substr) != -1, note) def tearDown(self): stopHTTPLog() @@ -272,7 +279,11 @@ s = setupBuildStepStatus("test_web.test_urls") s.addURL("coverage", "http://coverage.example.org/target") s.addURL("icon", "http://coverage.example.org/icon.png") - box = waterfall.IBox(s).getBox() + class FakeRequest: + def childLink(self, name): + return name + req = FakeRequest() + box = waterfall.IBox(s).getBox(req) td = box.td() e1 = '[coverage]' self.failUnlessSubstring(e1, td) --- NEW FILE: test_webparts.py --- import os from twisted.trial import unittest from twisted.internet import defer from twisted.web import client from twisted.web.error import Error as WebError from buildbot.slave.commands import rmdirRecursive from buildbot.status import html from test_web import BaseWeb, base_config, ConfiguredMaster from buildbot.scripts import runner class Webparts(BaseWeb, unittest.TestCase): def find_webstatus(self, master): return filter(lambda child: isinstance(child, html.WebStatus), list(master)) def startMaster(self, extraconfig): config = base_config + extraconfig rmdirRecursive("test_webparts") os.mkdir("test_webparts") runner.upgradeMaster({'basedir': "test_webparts", 'quiet': True, }) self.master = m = ConfiguredMaster("test_webparts", config) m.startService() # hack to find out what randomly-assigned port it is listening on port = list(self.find_webstatus(m)[0])[0]._port.getHost().port self.baseurl = "http://localhost:%d/" % port def getAndCheck(self, url, substring, show=False): d = client.getPage(url) def _show_weberror(why): why.trap(WebError) self.fail("error for %s: %s" % (url, why)) d.addErrback(_show_weberror) d.addCallback(self._getAndCheck, substring, show) return d def _getAndCheck(self, page, substring, show): if show: print page self.failUnlessIn(substring, page, "Couldn't find substring '%s' in page:\n%s" % (substring, page)) def testInit(self): extraconfig = """ from twisted.web import static ws = html.WebStatus(http_port=0) c['status'] = [ws] ws.putChild('child.html', static.Data('I am the child', 'text/plain')) """ self.startMaster(extraconfig) d = self.getAndCheck(self.baseurl + "child.html", "I am the child") return d testInit.timeout = 10 def testStatic(self): extraconfig = """ from twisted.web import static ws = html.WebStatus(http_port=0) c['status'] = [ws] ws.putChild('child.html', static.Data('I am the child', 'text/plain')) """ self.startMaster(extraconfig) os.mkdir(os.path.join("test_webparts", "public_html", "subdir")) f = open(os.path.join("test_webparts", "public_html", "foo.html"), "wt") f.write("see me foo\n") f.close() f = open(os.path.join("test_webparts", "public_html", "subdir", "bar.html"), "wt") f.write("see me subdir/bar\n") f.close() d = self.getAndCheck(self.baseurl + "child.html", "I am the child") d.addCallback(lambda res: self.getAndCheck(self.baseurl+"foo.html", "see me foo")) d.addCallback(lambda res: self.getAndCheck(self.baseurl+"subdir/bar.html", "see me subdir/bar")) return d def _check(self, res, suburl, substring, show=False): d = self.getAndCheck(self.baseurl + suburl, substring, show) return d def testPages(self): extraconfig = """ ws = html.WebStatus(http_port=0) c['status'] = [ws] """ self.startMaster(extraconfig) d = defer.succeed(None) d.addCallback(self._check, "", "Welcome to the Buildbot") d.addCallback(self._check, "waterfall", "current activity") d.addCallback(self._check, "about", "Buildbot is a free software") d.addCallback(self._check, "changes", "PBChangeSource listener") d.addCallback(self._check, "buildslaves", "Build Slaves") d.addCallback(self._check, "one_line_per_build", "Last 20 finished builds") d.addCallback(self._check, "one_box_per_builder", "Latest builds") d.addCallback(self._check, "builders", "Builders") d.addCallback(self._check, "builders/builder1", "Builder: builder1") d.addCallback(self._check, "builders/builder1/builds", "") # dummy # TODO: the pages beyond here would be great to test, but that would # require causing a build to complete. #d.addCallback(self._check, "builders/builder1/builds/1", "") #d.addCallback(self._check, "builders/builder1/builds/1/steps", "") #d.addCallback(self._check, # "builders/builder1/builds/1/steps/compile", "") #d.addCallback(self._check, # "builders/builder1/builds/1/steps/compile/logs", "") #d.addCallback(self._check, # "builders/builder1/builds/1/steps/compile/logs/stdio","") #d.addCallback(self._check, # "builders/builder1/builds/1/steps/compile/logs/stdio/text", "") return d From warner at users.sourceforge.net Fri Sep 28 09:33:33 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 28 Sep 2007 09:33:33 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web base.py, 1.12, 1.13 baseweb.py, 1.21, 1.22 build.py, 1.11, 1.12 builder.py, 1.9, 1.10 changes.py, 1.3, 1.4 logs.py, 1.5, 1.6 slaves.py, 1.2, 1.3 step.py, 1.5, 1.6 tests.py, 1.3, 1.4 waterfall.py, 1.20, 1.21 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11817/buildbot/status/web Modified Files: base.py baseweb.py build.py builder.py changes.py logs.py slaves.py step.py tests.py waterfall.py Log Message: [project @ web: big cleanup of URL generation, to use relative links everywhere] Original author: warner at lothar.com Date: 2007-09-28 09:08:11+00:00 Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/base.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- base.py 27 Sep 2007 22:51:10 -0000 1.12 +++ base.py 28 Sep 2007 09:33:31 -0000 1.13 @@ -1,5 +1,5 @@ -import urlparse +import urlparse, urllib from zope.interface import Interface from twisted.web import html, resource from buildbot.status import builder @@ -9,15 +9,22 @@ 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 + def getBox(self, request): + """Return a Box instance, which can produce a cell. + """ class ICurrentBox(Interface): """I represent the 'current activity' box, just above the builder name.""" - pass + def getBox(self, status): + """Return a Box instance, which can produce a cell. + """ class IBox(Interface): """I represent a box in the waterfall display.""" - pass + def getBox(self, request): + """Return a Box instance, which wraps an Event and can produce a + cell. + """ class IHTMLLog(Interface): pass @@ -102,6 +109,31 @@ return "running" return builder.Results[result] +def path_to_root(request): + # /waterfall : ['waterfall'] -> '' + # /somewhere/lower : ['somewhere', 'lower'] -> '../' + # /somewhere/indexy/ : ['somewhere', 'indexy', ''] -> '../../' + # / : [] -> '' + if request.prepath: + segs = len(request.prepath) - 1 + else: + segs = 0 + root = "../" * segs + return root + +def path_to_builder(request, builderstatus): + return (path_to_root(request) + + "builders/" + + urllib.quote(builderstatus.getName(), safe='')) + +def path_to_build(request, buildstatus): + return (path_to_builder(request, buildstatus.getBuilder()) + + "/builds/%d" % buildstatus.getNumber()) + +def path_to_step(request, stepstatus): + return (path_to_build(request, stepstatus.getBuild()) + + "/steps/%s" % urllib.quote(stepstatus.getName(), safe='')) + class Box: # a Box wraps an Event. The Box has HTML parameters that Events # lack, and it has a base URL to which each File's name is relative. @@ -142,10 +174,23 @@ return resource.Resource.getChild(self, path, request) def render(self, request): - if self.addSlash and request.prepath[-1] != '': + + # Our pages no longer require that their URL end in a slash. Instead, + # they all use request.childLink() or some equivalent which takes the + # last path component into account. This clause is left here for + # historical and educational purposes. + if False and self.addSlash and request.prepath[-1] != '': # this is intended to behave like request.URLPath().child('') # but we need a relative URL, since we might be living behind a # reverse proxy + # + # note that the Location: header (as used in redirects) are + # required to have absolute URIs, and my attempt to handle + # reverse-proxies gracefully violates rfc2616. This frequently + # works, but single-component paths sometimes break. The best + # strategy is to avoid these redirects whenever possible by using + # HREFs with trailing slashes, and only use the redirects for + # manually entered URLs. url = request.prePathURL() scheme, netloc, path, query, fragment = urlparse.urlsplit(url) new_url = request.prepath[-1] + "/" @@ -172,16 +217,7 @@ return request.site.buildbot_service.parent.change_svc def path_to_root(self, request): - # /waterfall : ['waterfall'] -> '' - # /somewhere/lower : ['somewhere', 'lower'] -> '../' - # /somewhere/indexy/ : ['somewhere', 'indexy', ''] -> '../../' - # / : [] -> '' - if request.prepath: - segs = len(request.prepath) - 1 - else: - segs = 0 - root = "../" * segs - return root + return path_to_root(request) def getTitle(self, request): return self.title Index: baseweb.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/baseweb.py,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- baseweb.py 26 Sep 2007 09:57:30 -0000 1.21 +++ baseweb.py 28 Sep 2007 09:33:31 -0000 1.22 @@ -292,7 +292,14 @@ Builders it triggers, and list of the Changes that are queued awaiting the tree-stable timer, and controls to accelerate the timer. - /others... + /buildslaves : list all BuildSlaves + /buildslaves/SLAVENAME : describe a single BuildSlave + /one_line_per_build : summarize the last few builds, one line each + /one_line_per_build/BUILDERNAME : same, but only for a single builder + /one_box_per_builder : show the latest build and current activity + /about : describe this buildmaster (Buildbot and support library versions) + /xmlrpc : (not yet implemented) an XMLRPC server with build status + All URLs for pages which are not defined here are used to look for files in BASEDIR/public_html/ , which means that /robots.txt or /buildbot.css @@ -411,7 +418,7 @@ def setupUsualPages(self): #self.putChild("", IndexOrWaterfallRedirection()) self.putChild("waterfall", WaterfallStatusResource()) - self.putChild("builders", BuildersResource()) + self.putChild("builders", BuildersResource()) # has builds/steps/logs self.putChild("changes", ChangesResource()) self.putChild("buildslaves", BuildSlavesResource()) #self.putChild("schedulers", SchedulersResource()) Index: build.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/build.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- build.py 27 Sep 2007 22:51:23 -0000 1.11 +++ build.py 28 Sep 2007 09:33:31 -0000 1.12 @@ -5,12 +5,13 @@ import urllib, time from twisted.python import log -from buildbot.status.web.base import HtmlResource, make_row, css_classes +from buildbot.status.web.base import HtmlResource, make_row, css_classes, \ + path_to_builder from buildbot.status.web.tests import TestsResource from buildbot.status.web.step import StepsResource -# builders/$builder/builds/$buildnum +# /builders/$builder/builds/$buildnum class StatusResourceBuild(HtmlResource): addSlash = True @@ -29,12 +30,13 @@ b = self.build_status status = self.getStatus(req) projectName = status.getProjectName() - data = ('\n' - % projectName) + data = ('\n' + % (self.path_to_root(req), projectName)) # the color in the following line gives python-mode trouble builder_name = b.getBuilder().getName() - data += ("

      Builder %s: Build #%d

      \n" - % (builder_name, b.getNumber())) + data += ("

      Builder %s: Build #%d

      \n" + % (path_to_builder(req, b.getBuilder()), + builder_name, b.getNumber())) if not b.isFinished(): data += "

      Build In Progress

      " @@ -99,6 +101,12 @@ data += "

      Reason:

      \n%s\n" % html.escape(b.getReason()) data += "

      Steps and Logfiles:

      \n" + # TODO: +# urls = self.original.getURLs() +# ex_url_class = "BuildStep external" +# for name, target in urls.items(): +# text.append('[%s]' % +# (target, ex_url_class, html.escape(name))) if b.getLogs(): data += "
        \n" for s in b.getSteps(): @@ -232,6 +240,7 @@ return HtmlResource.getChild(self, path, req) +# /builders/$builder/builds class BuildsResource(HtmlResource): addSlash = True Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/builder.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- builder.py 27 Sep 2007 22:51:23 -0000 1.9 +++ builder.py 28 Sep 2007 09:33:31 -0000 1.10 @@ -12,7 +12,7 @@ from buildbot.status.web.build import BuildsResource -# builders/$builder +# /builders/$builder class StatusResourceBuilder(HtmlResource): addSlash = True @@ -26,7 +26,7 @@ def build_line(self, build, req): buildnum = build.getNumber() - buildurl = "builds/%d" % buildnum + buildurl = req.childLink("builds/%d" % buildnum) data = '#%d ' % (buildurl, buildnum) when = build.getETA() if when is not None: @@ -38,7 +38,7 @@ def build_finished_line(self, build, req): buildnum = build.getNumber() - buildurl = "builds/%d" % buildnum + buildurl = req.childLink("builds/%d" % buildnum) results = build.getResults() text = " ".join(build.getText()) data = '#%d ' % (buildurl, buildnum) @@ -55,7 +55,7 @@ projectName = status.getProjectName() - data = '%s\n' % projectName + data = '%s\n' % (self.path_to_root(req), projectName) data += "

        Builder: %s

        \n" % html.escape(b.getName()) @@ -215,9 +215,28 @@ return HtmlResource.getChild(self, path, req) +# /builders class BuildersResource(HtmlResource): + title = "Builders" addSlash = True + def body(self, req): + s = self.getStatus(req) + data = "" + data += "

        Builders

        \n" + + # TODO: this is really basic. It should be expanded to include a + # brief one-line summary of the builder (perhaps with whatever the + # builder is currently doing) + data += "
          \n" + for bname in s.getBuilderNames(): + data += ('
        1. %s
        2. \n' % + (req.childLink(urllib.quote(bname, safe='')), + urllib.quote(bname, safe=''))) + data += "
        \n" + + return data + def getChild(self, path, req): s = self.getStatus(req) if path in s.getBuilderNames(): Index: changes.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/changes.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- changes.py 1 Aug 2007 22:08:32 -0000 1.3 +++ changes.py 28 Sep 2007 09:33:31 -0000 1.4 @@ -6,7 +6,7 @@ from buildbot.changes.changes import Change from buildbot.status.web.base import HtmlResource, StaticHTML, IBox, Box -# $changes/NN +# /changes/NN class ChangesResource(HtmlResource): def body(self, req): @@ -33,8 +33,8 @@ class ChangeBox(components.Adapter): implements(IBox) - def getBox(self): - url = "changes/%d" % self.original.number + def getBox(self, req): + url = req.childLink("../changes/%d" % self.original.number) text = self.original.get_HTML_box(url) return Box([text], color="white", class_="Change") components.registerAdapter(ChangeBox, Change, IBox) Index: logs.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/logs.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- logs.py 1 Aug 2007 23:30:14 -0000 1.5 +++ logs.py 28 Sep 2007 09:33:31 -0000 1.6 @@ -50,6 +50,8 @@ def finish(self): self.textlog.finished() + +# /builders/$builder/builds/$buildnum/steps/$stepname/logs/$logname 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. Index: slaves.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/slaves.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- slaves.py 25 Sep 2007 22:50:36 -0000 1.2 +++ slaves.py 28 Sep 2007 09:33:31 -0000 1.3 @@ -2,11 +2,11 @@ import time from buildbot.status.web.base import HtmlResource, abbreviate_age -# buildslaves/$slavename +# /buildslaves/$slavename class OneBuildSlaveResource(HtmlResource): - pass + pass # TODO -# buildslaves/ +# /buildslaves/ class BuildSlavesResource(HtmlResource): title = "BuildSlaves" addSlash = True @@ -30,10 +30,12 @@ slave = s.getSlave(name) data += "
      1. %s:\n" % name data += "
          \n" - builder_links = ['%s' % (bname, bname) + builder_links = ['%s' + % (req.childLink("../builders/%s" % bname),bname) for bname in used_by_builder.get(name, [])] if builder_links: - data += "
        • Used by: %s
        • \n" % ", ".join(builder_links) + data += ("
        • Used by Builders: %s
        • \n" % + ", ".join(builder_links)) else: data += "
        • Not used by any Builders
        • \n" if slave.isConnected(): Index: step.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/step.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- step.py 1 Aug 2007 23:30:14 -0000 1.5 +++ step.py 28 Sep 2007 09:33:31 -0000 1.6 @@ -2,10 +2,11 @@ from twisted.web import html import urllib -from buildbot.status.web.base import HtmlResource +from buildbot.status.web.base import HtmlResource, path_to_builder, \ + path_to_build from buildbot.status.web.logs import LogsResource -# builders/$builder/builds/$buildnum/steps/$stepname +# /builders/$builder/builds/$buildnum/steps/$stepname class StatusResourceBuildStep(HtmlResource): title = "Build Step" addSlash = True @@ -21,9 +22,9 @@ builder_name = b.getBuilder().getName() build_num = b.getNumber() data = "" - data += ("

          BuildStep %s:" % - (urllib.quote(builder_name), builder_name)) - data += "#%d" % (build_num, build_num) + data += ('

          BuildStep %s:' % + (path_to_builder(req, b.getBuilder()), builder_name)) + data += '#%d' % (path_to_build(req, b), build_num) data += ":%s

          \n" % s.getName() if s.isFinished(): @@ -69,6 +70,7 @@ +# /builders/$builder/builds/$buildnum/steps class StepsResource(HtmlResource): addSlash = True Index: tests.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/tests.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- tests.py 1 Aug 2007 22:08:32 -0000 1.3 +++ tests.py 28 Sep 2007 09:33:31 -0000 1.4 @@ -4,7 +4,7 @@ from buildbot.status.web.base import HtmlResource -# $builder/builds/NN/tests/TESTNAME +# /builders/$builder/builds/$buildnum/tests/$testname class TestResult(HtmlResource): title = "Test Logs" @@ -26,7 +26,7 @@ return data -# $builder/builds/NN/tests +# /builders/$builder/builds/$buildnum/tests class TestsResource(HtmlResource): title = "Test Results" Index: waterfall.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/waterfall.py,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- waterfall.py 25 Sep 2007 23:04:29 -0000 1.20 +++ waterfall.py 28 Sep 2007 09:33:31 -0000 1.21 @@ -12,7 +12,7 @@ from buildbot.status import builder from buildbot.status.web.base import Box, HtmlResource, IBox, ICurrentBox, \ - ITopBox, td, build_get_class + ITopBox, td, build_get_class, path_to_build, path_to_step @@ -97,14 +97,14 @@ # showing the results of the most recent build implements(IBox) - def getBox(self): + def getBox(self, req): assert interfaces.IBuilderStatus(self.original) b = self.original.getLastFinishedBuild() if not b: return Box(["none"], "white", class_="LastBuild") name = b.getBuilder().getName() number = b.getNumber() - url = "%s/builds/%d" % (name, number) + url = path_to_build(req, b) text = b.getText() # TODO: add logs? # TODO: add link to the per-build page at 'url' @@ -117,11 +117,10 @@ # this provides the yellow "starting line" box for each build implements(IBox) - def getBox(self): + def getBox(self, req): b = self.original - name = b.getBuilder().getName() number = b.getNumber() - url = "builders/%s/builds/%d" % (urllib.quote(name, safe=''), number) + url = path_to_build(req, b) reason = b.getReason() text = ('Build %d' % (html.escape(reason), url, number)) @@ -139,12 +138,8 @@ class StepBox(components.Adapter): implements(IBox) - def getBox(self): - b = self.original.getBuild() - urlbase = "builders/%s/builds/%d/steps/%s" % ( - urllib.quote(b.getBuilder().getName(), safe=''), - b.getNumber(), - urllib.quote(self.original.getName(), safe='')) + def getBox(self, req): + urlbase = path_to_step(req, self.original) text = self.original.getText() if text is None: log.msg("getText() gave None", urlbase) @@ -172,7 +167,7 @@ class EventBox(components.Adapter): implements(IBox) - def getBox(self): + def getBox(self, req): text = self.original.getText() color = self.original.getColor() class_ = "Event" @@ -199,7 +194,7 @@ class SpacerBox(components.Adapter): implements(IBox) - def getBox(self): + def getBox(self, req): #b = Box(["spacer"], "white") b = Box([]) b.spacer = True @@ -483,14 +478,14 @@ if projectName and projectURL: # TODO: this is going to look really ugly - topleft = "%s
          last build" % \ + topleft = '%s
          last build' % \ (projectURL, projectName) else: topleft = "last build" data += ' \n' data += td(topleft, align="right", colspan=2, class_="Project") for b in builders: - box = ITopBox(b).getBox() + box = ITopBox(b).getBox(request) data += box.td(align="center") data += " \n" @@ -504,14 +499,13 @@ data += " \n" TZ = time.tzname[time.daylight] data += td("time (%s)" % TZ, align="center", class_="Time") - name = changeNames[0] - data += td( - "%s" % (urllib.quote(name, safe=''), name), - align="center", class_="Change") + data += td('changes' % request.childLink("../changes"), + align="center", class_="Change") for name in builderNames: safename = urllib.quote(name, safe='') - data += td( "%s" % (safename, name), - align="center", class_="Builder") + data += td('%s' % + (request.childLink("../builders/%s" % safename), name), + align="center", class_="Builder") data += " \n" if phase == 1: @@ -572,11 +566,11 @@ bburl = "http://buildbot.net/?bb-ver=%s" % urllib.quote(version) - data += "Buildbot-%s " % (bburl, version) + data += 'Buildbot-%s ' % (bburl, version) if projectName: data += "working for the " if projectURL: - data += "%s project." % (projectURL, + data += '%s project.' % (projectURL, projectName) else: data += "%s project." % projectName @@ -592,8 +586,7 @@ # build the waterfall display data = "" data += "

          Basic display

          \n" - data += "

          See here" % \ - urllib.quote(request.childLink("waterfall")) + data += '

          See here' % request.childLink("../waterfall") data += " for the waterfall display

          \n" data += '\n' @@ -618,9 +611,9 @@ data += td("Time", align="center") data += td("Changes", align="center") for name in names: - data += td( - "%s" % (urllib.quote(request.childLink(name)), name), - align="center") + data += td('%s' % + (request.childLink("../" + urllib.quote(name)), name), + align="center") data += " \n" # all further rows involve timestamps, commit events, and build events @@ -834,7 +827,7 @@ data += td("") else: e = block[i-offset] - box = IBox(e).getBox() + box = IBox(e).getBox(request) box.parms["show_idle"] = 1 data += box.td(valign="top", align="center") data += " \n" @@ -894,7 +887,7 @@ grid[c+1].append(None) for i in range(len(block)): # so the events are bottom-justified - b = IBox(block[i]).getBox() + b = IBox(block[i]).getBox(request) b.parms['valign'] = "top" b.parms['align'] = "center" grid[c+1].append(b) @@ -906,7 +899,7 @@ assert(len(strip) == gridlen) if strip[-1] == None: if sourceEvents[i-1]: - filler = IBox(sourceEvents[i-1]).getBox() + filler = IBox(sourceEvents[i-1]).getBox(request) else: # this can happen if you delete part of the build history filler = Box(text=["?"], align="center") From warner at users.sourceforge.net Fri Sep 28 09:33:38 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 28 Sep 2007 09:33:38 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_web.py,1.49,1.50 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11849/buildbot/test Modified Files: test_web.py Log Message: [project @ test_web.py: fix test failure caused by FakeRequest being too fake] Original author: warner at lothar.com Date: 2007-09-28 09:32:21+00:00 Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- test_web.py 28 Sep 2007 09:33:31 -0000 1.49 +++ test_web.py 28 Sep 2007 09:33:36 -0000 1.50 @@ -280,6 +280,8 @@ s.addURL("coverage", "http://coverage.example.org/target") s.addURL("icon", "http://coverage.example.org/icon.png") class FakeRequest: + prepath = [] + postpath = [] def childLink(self, name): return name req = FakeRequest() From warner at users.sourceforge.net Fri Sep 28 09:33:38 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 28 Sep 2007 09:33:38 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.936,1.937 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11849 Modified Files: ChangeLog Log Message: [project @ test_web.py: fix test failure caused by FakeRequest being too fake] Original author: warner at lothar.com Date: 2007-09-28 09:32:21+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.936 retrieving revision 1.937 diff -u -d -r1.936 -r1.937 --- ChangeLog 28 Sep 2007 09:33:31 -0000 1.936 +++ ChangeLog 28 Sep 2007 09:33:36 -0000 1.937 @@ -1,5 +1,8 @@ 2007-09-28 Brian Warner + * buildbot/test/test_web.py (WaterfallSteps.test_urls.FakeRequest): + fix a test failure by adding .prepath to this fake object + * buildbot/status/web/*: big set of changes to WebStatus, cleaning up generation of relative URLs. With luck, this should play with reverse proxies much better now. From warner at users.sourceforge.net Fri Sep 28 09:33:42 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 28 Sep 2007 09:33:42 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.937,1.938 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11867 Modified Files: ChangeLog Log Message: [project @ web: make BuildTopBox and OneBoxPerBuilder respect branch= queryargs] Original author: warner at lothar.com Date: 2007-09-28 09:32:42+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.937 retrieving revision 1.938 diff -u -d -r1.937 -r1.938 --- ChangeLog 28 Sep 2007 09:33:36 -0000 1.937 +++ ChangeLog 28 Sep 2007 09:33:40 -0000 1.938 @@ -1,5 +1,10 @@ 2007-09-28 Brian Warner + * buildbot/status/web/baseweb.py (OneBoxPerBuilder): make this page + respect branch= queryargs, by restricting the builds displayed to + those matching the given branch names + * buildbot/status/web/waterfall.py (BuildTopBox): same + * buildbot/test/test_web.py (WaterfallSteps.test_urls.FakeRequest): fix a test failure by adding .prepath to this fake object From warner at users.sourceforge.net Fri Sep 28 09:33:42 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Fri, 28 Sep 2007 09:33:42 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web baseweb.py, 1.22, 1.23 waterfall.py, 1.21, 1.22 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11867/buildbot/status/web Modified Files: baseweb.py waterfall.py Log Message: [project @ web: make BuildTopBox and OneBoxPerBuilder respect branch= queryargs] Original author: warner at lothar.com Date: 2007-09-28 09:32:42+00:00 Index: baseweb.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/baseweb.py,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- baseweb.py 28 Sep 2007 09:33:31 -0000 1.22 +++ baseweb.py 28 Sep 2007 09:33:40 -0000 1.23 @@ -210,8 +210,10 @@ builder = status.getBuilder(bn) data += "\n" data += "\n" % html.escape(bn) - b = builder.getLastFinishedBuild() - if b: + builds = list(builder.generateFinishedBuilds(branches, + num_builds=1)) + if builds: + b = builds[0] url = (self.path_to_root(req) + "builders/" + urllib.quote(bn, safe='') + Index: waterfall.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/waterfall.py,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- waterfall.py 28 Sep 2007 09:33:31 -0000 1.21 +++ waterfall.py 28 Sep 2007 09:33:40 -0000 1.22 @@ -99,14 +99,17 @@ def getBox(self, req): assert interfaces.IBuilderStatus(self.original) - b = self.original.getLastFinishedBuild() - if not b: + branches = [b for b in req.args.get("branch", []) if b] + builds = list(self.original.generateFinishedBuilds(branches, + num_builds=1)) + if not builds: return Box(["none"], "white", class_="LastBuild") + b = builds[0] name = b.getBuilder().getName() number = b.getNumber() url = path_to_build(req, b) text = b.getText() - # TODO: add logs? + # TODO: maybe add logs? # TODO: add link to the per-build page at 'url' c = b.getColor() class_ = build_get_class(b) From warner at users.sourceforge.net Sat Sep 29 01:07:58 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 29 Sep 2007 01:07:58 +0000 Subject: [Buildbot-commits] buildbot/buildbot buildslave.py,1.7,1.8 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25039/buildbot Modified Files: buildslave.py Log Message: [project @ add arg to send email when buildslaves go missing. Closes #64.] Original author: warner at lothar.com Date: 2007-09-29 01:06:11+00:00 Index: buildslave.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/buildslave.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- buildslave.py 12 Aug 2007 23:17:12 -0000 1.7 +++ buildslave.py 29 Sep 2007 01:07:49 -0000 1.8 @@ -1,5 +1,7 @@ import time +from email.Message import Message +from email.Utils import formatdate from zope.interface import implements from twisted.python import log from twisted.internet import defer, reactor @@ -7,6 +9,7 @@ from buildbot.pbutil import NewCredPerspective from buildbot.status.builder import SlaveStatus +from buildbot.status.mail import MailNotifier from buildbot.interfaces import IBuildSlave class BuildSlave(NewCredPerspective, service.MultiService): @@ -14,7 +17,7 @@ There is exactly one for each slave described in the config file (the c['slaves'] list). When buildbots connect in (.attach), they get a reference to this instance. The BotMaster object is stashed as the - .service attribute. + .botmaster attribute. The BotMaster is also our '.parent' Service. I represent a build slave -- a remote machine capable of running builds. I am instantiated by the configuration file, and can be @@ -22,7 +25,8 @@ implements(IBuildSlave) - def __init__(self, name, password, max_builds=None): + def __init__(self, name, password, max_builds=None, + notify_on_missing=[], missing_timeout=3600): """ @param name: botname this machine will supply when it connects @param password: password this machine will supply when @@ -41,6 +45,13 @@ self.slavebuilders = [] self.max_builds = max_builds self.lastMessageReceived = 0 + if isinstance(notify_on_missing, str): + notify_on_missing = [notify_on_missing] + self.notify_on_missing = notify_on_missing + for i in notify_on_missing: + assert isinstance(i, str) + self.missing_timeout = missing_timeout + self.missing_timer = None def update(self, new): """ @@ -78,6 +89,10 @@ @return: a Deferred that fires with a suitable pb.IPerspective to give to the slave (i.e. 'self')""" + if self.missing_timer: + self.missing_timer.cancel() + self.missing_timer = None + if self.slave: # uh-oh, we've got a duplicate slave. The most likely # explanation is that the slave is behind a slow link, thinks we @@ -164,7 +179,52 @@ self.slave_status.setConnected(False) self.botmaster.slaveLost(self) log.msg("BuildSlave.detached(%s)" % self.slavename) + if self.notify_on_missing and self.parent: + self.missing_timer = reactor.callLater(self.missing_timeout, + self._missing_timer_fired) + + def _missing_timer_fired(self): + self.missing_timer = None + # notify people, but only if we're still in the config + if not self.parent: + return + + # first, see if we have a MailNotifier we can use. This gives us a + # fromaddr and a relayhost. + buildmaster = self.botmaster.parent + status = buildmaster.getStatus() + for st in buildmaster.statusTargets: + if isinstance(st, MailNotifier): + break + else: + # if not, they get a default MailNotifier, which always uses SMTP + # to localhost and uses a dummy fromaddr of "buildbot". + log.msg("buildslave-missing msg using default MailNotifier") + st = MailNotifier("buildbot") + # now construct the mail + text = "The Buildbot working for '%s'\n" % status.getProjectName() + text += ("has noticed that the buildslave named %s went away\n" % + self.slavename) + text += "\n" + text += ("It last disconnected at %s (buildmaster-local time)\n" % + time.ctime(time.time() - self.missing_timeout)) # close enough + text += "\n" + text += "The admin on record (as reported by BUILDSLAVE:info/admin)\n" + text += "was '%s'.\n" % self.slave_status.getAdmin() + text += "\n" + text += "Sincerely,\n" + text += " The Buildbot\n" + text += " %s\n" % status.getProjectURL() + m = Message() + m.set_payload(text) + m['Date'] = formatdate(localtime=True) + m['Subject'] = "Buildbot: buildslave %s was lost" % self.slavename + m['From'] = st.fromaddr + recipients = self.notify_on_missing + d = st.sendMessage(m, recipients) + # return the Deferred for testing purposes + return d def disconnect(self): """Forcibly disconnect the slave. From warner at users.sourceforge.net Sat Sep 29 01:07:58 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 29 Sep 2007 01:07:58 +0000 Subject: [Buildbot-commits] buildbot/docs buildbot.texinfo,1.120,1.121 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25039/docs Modified Files: buildbot.texinfo Log Message: [project @ add arg to send email when buildslaves go missing. Closes #64.] Original author: warner at lothar.com Date: 2007-09-29 01:06:11+00:00 Index: buildbot.texinfo =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/buildbot.texinfo,v retrieving revision 1.120 retrieving revision 1.121 diff -u -d -r1.120 -r1.121 --- buildbot.texinfo 26 Sep 2007 06:32:29 -0000 1.120 +++ buildbot.texinfo 29 Sep 2007 01:07:56 -0000 1.121 @@ -140,6 +140,10 @@ * Scheduler Types:: * Build Dependencies:: +Buildslave Specifiers + +* When Buildslaves Go Missing:: + Getting Source Code Changes * Change Sources:: @@ -238,6 +242,7 @@ * HTML Waterfall:: * WebStatus:: +* MailNotifier:: * IRC Bot:: * PBListener:: * Writing New Status Plugins:: @@ -1763,12 +1768,12 @@ @node Email Addresses, IRC Nicknames, Doing Things With Users, Users @subsection Email Addresses -The @code{buildbot.status.mail.MailNotifier} class provides a -status target which can send email about the results of each build. It -accepts a static list of email addresses to which each message should be -delivered, but it can also be configured to send mail to the Build's -Interested Users. To do this, it needs a way to convert User names into -email addresses. +The @code{buildbot.status.mail.MailNotifier} class +(@pxref{MailNotifier}) provides a status target which can send email +about the results of each build. It accepts a static list of email +addresses to which each message should be delivered, but it can also +be configured to send mail to the Build's Interested Users. To do +this, it needs a way to convert User names into email addresses. For many VC systems, the User Name is actually an account name on the system which hosts the repository. As such, turning the name into an @@ -2274,6 +2279,69 @@ This key is accepted for backwards compatibility, but is deprecated as of 0.7.6 and will go away in some future release. + at menu +* When Buildslaves Go Missing:: + at end menu + + at node When Buildslaves Go Missing, , Buildslave Specifiers, Buildslave Specifiers + at subsection When Buildslaves Go Missing + +Sometimes, the buildslaves go away. One very common reason for this is +when the buildslave process is started once (manually) and left +running, but then later the machine reboots and the process is not +automatically restarted. + +If you'd like to have the administrator of the buildslave (or other +people) be notified by email when the buildslave has been missing for +too long, just add the @code{notify_on_missing=} argument to the + at code{BuildSlave} definition: + + at example +c['slaves'] = [BuildSlave('bot-solaris', 'solarispasswd', + notify_on_missing="bob@@example.com"), + ] + at end example + +By default, this will send email when the buildslave has been +disconnected for more than one hour. Only one email per +connection-loss event will be sent. To change the timeout, use + at code{missing_timeout=} and give it a number of seconds (the default +is 3600). + +You can have the buildmaster send email to multiple recipients: just +provide a list of addresses instead of a single one: + + at example +c['slaves'] = [BuildSlave('bot-solaris', 'solarispasswd', + notify_on_missing=["bob@@example.com", + "alice@@example.org"], + missing_timeout=300, # notify after 10 minutes + ), + ] + at end example + +The email sent this way will use a MailNotifier (@pxref{MailNotifier}) +status target, if one is configured. This provides a way for you to +control the ``from'' address of the email, as well as the relayhost +(aka ``smarthost'') to use as an SMTP server. If no MailNotifier is +configured on this buildmaster, the buildslave-missing emails will be +sent using a default configuration. + +Note that if you want to have a MailNotifier for buildslave-missing +emails but not for regular build emails, just create one with +builders=[], as follows: + + at example +from buildbot.status import mail +m = mail.MailNotifier(fromaddr="buildbot@@localhost", builders=[], + relayhost="smtp.example.org") +c['status'].append(m) +c['slaves'] = [BuildSlave('bot-solaris', 'solarispasswd', + notify_on_missing="bob@@example.com"), + ] + at end example + + @node Defining Builders, Defining Status Targets, Buildslave Specifiers, Configuration @section Defining Builders @@ -5825,6 +5893,7 @@ @menu * HTML Waterfall:: * WebStatus:: +* MailNotifier:: * IRC Bot:: * PBListener:: * Writing New Status Plugins:: @@ -5918,7 +5987,7 @@ @end table - at node WebStatus, IRC Bot, HTML Waterfall, Status Delivery + at node WebStatus, MailNotifier, HTML Waterfall, Status Delivery @section WebStatus @cindex WebStatus @@ -6138,7 +6207,129 @@ @end table - at node IRC Bot, PBListener, WebStatus, Status Delivery + at node MailNotifier, IRC Bot, WebStatus, Status Delivery + at section MailNotifier + + at cindex email + at cindex mail + at stindex buildbot.status.mail.MailNotifier + +The buildbot can also send email when builds finish. The most common +use of this is to tell developers when their change has caused the +build to fail. It is also quite common to send a message to a mailing +list (usually named ``builds'' or similar) about every build. + +The @code{MailNotifier} status target is used to accomplish this. You +configure it by specifying who mail should be sent to, under what +circumstances mail should be sent, and how to deliver the mail. It can +be configured to only send out mail for certain builders, and only +send messages when the build fails, or when the builder transitions +from success to failure. It can also be configured to include various +build logs in each message. + + +By default, the message will be sent to the Interested Users list +(@pxref{Doing Things With Users}), which includes all developers who +made changes in the build. You can add additional recipients with the +extraRecipients argument. + +Each MailNotifier sends mail to a single set of recipients. To send +different kinds of mail to different recipients, use multiple +MailNotifiers. + +The following simple example will send an email upon the completion of +each build, to just those developers whose Changes were included in +the build. The email contains a description of the Build, its results, +and URLs where more information can be obtained. + + at example +from buildbot.status.mail import MailNotifier +mn = MailNotifier(fromaddr="buildbot@@example.org", lookup="example.org") +c['status'].append(mn) + at end example + +To get a simple one-message-per-build (say, for a mailing list), use +the following form instead. This form does not send mail to individual +developers (and thus does not need the @code{lookup=} argument, +explained below), instead it only ever sends mail to the ``extra +recipients'' named in the arguments: + + at example +mn = MailNotifier(fromaddr="buildbot@@example.org", + sendToInterestedUsers=False, + extraRecipients=['listaddr@@example.org']) + at end example + + at heading MailNotifier arguments + + at table @code + at item fromaddr +The email address to be used in the 'From' header. + + at item sendToInterestedUsers +(boolean). If True (the default), send mail to all of the Interested +Users. If False, only send mail to the extraRecipients list. + + at item extraRecipients +(tuple of strings). A list of email addresses to which messages should +be sent (in addition to the InterestedUsers list, which includes any +developers who made Changes that went into this build). It is a good +idea to create a small mailing list and deliver to that, then let +subscribers come and go as they please. + + at item subject +(string). A string to be used as the subject line of the message. + at code{%(builder)s} will be replaced with the name of the builder which +provoked the message. + + at item mode +(string). Default to 'all'. One of: + at table @code + at item all +Send mail about all builds, bothpassing and failing + at item failing +Only send mail about builds which fail + at item problem +Only send mail about a build which failed when the previous build has passed. +If your builds usually pass, then this will only send mail when a problem +occurs. + at end table + + at item builders +(list of strings). A list of builder names for which mail should be +sent. Defaults to None (send mail for all builds). Use either builders +or categories, but not both. + + at item categories +(list of strings). A list of category names to serve status +information for. Defaults to None (all categories). Use either +builders or categories, but not both. + + at item addLogs +(boolean). If True, include all build logs as attachments to the +messages. These can be quite large. This can also be set to a list of +log names, to send a subset of the logs. Defaults to False. + + at item relayhost +(string). The host to which the outbound SMTP connection should be +made. Defaults to 'localhost' + + at item lookup +(implementor of @code{IEmailLookup}). Object which provides +IEmailLookup, which is responsible for mapping User names (which come +from the VC system) into valid email addresses. If not provided, the +notifier will only be able to send mail to the addresses in the +extraRecipients list. Most of the time you can use a simple Domain +instance. As a shortcut, you can pass as string: this will be treated +as if you had provided Domain(str). For example, +lookup='twistedmatrix.com' will allow mail to be sent to all +developers whose SVN usernames match their twistedmatrix.com account +names. See buildbot/status/mail.py for more details. + + at end table + + + at node IRC Bot, PBListener, MailNotifier, Status Delivery @section IRC Bot @cindex IRC @@ -6248,8 +6439,8 @@ display) never need to subscribe to anything: they are idle until someone asks a question, then wake up and extract the information they need to answer it, then they go back to sleep. Plugins which need to -act spontaneously when builds complete (like the Mail plugin) need to -subscribe to hear about new builds. +act spontaneously when builds complete (like the MailNotifier plugin) +need to subscribe to hear about new builds. If the status plugin needs to run network services (like the HTTP server used by the Waterfall plugin), they can be attached as Service @@ -7039,7 +7230,6 @@ @printindex st @c TODO: undocumented targets - at stindex buildbot.status.mail.MailNotifier @node Index of master.cfg keys, Index, Index of Useful Classes, Top @unnumbered Index of master.cfg keys From warner at users.sourceforge.net Sat Sep 29 01:07:58 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 29 Sep 2007 01:07:58 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_slaves.py, 1.14, 1.15 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25039/buildbot/test Modified Files: test_slaves.py Log Message: [project @ add arg to send email when buildslaves go missing. Closes #64.] Original author: warner at lothar.com Date: 2007-09-29 01:06:11+00:00 Index: test_slaves.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_slaves.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- test_slaves.py 7 Aug 2007 20:23:46 -0000 1.14 +++ test_slaves.py 29 Sep 2007 01:07:56 -0000 1.15 @@ -8,6 +8,7 @@ from buildbot.sourcestamp import SourceStamp from buildbot.process.base import BuildRequest from buildbot.status.builder import SUCCESS +from buildbot.status import mail from buildbot.slave import bot config_1 = """ @@ -452,6 +453,22 @@ """ +config_mail_missing = config_1 + """ +c['slaves'] = [BuildSlave('bot1', 'sekrit', notify_on_missing='admin', + missing_timeout=1)] +c['builders'] = [ + {'name': 'dummy', 'slavenames': ['bot1'], + 'builddir': 'b1', 'factory': f1}, + ] +c['projectName'] = 'myproject' +c['projectURL'] = 'myURL' +""" + +class FakeMailer(mail.MailNotifier): + def sendMessage(self, m, recipients): + self.messages.append((m,recipients)) + return defer.succeed(None) + class BuildSlave(RunMixin, unittest.TestCase): def test_track_builders(self): self.master.loadConfig(config_multi_builders) @@ -470,3 +487,47 @@ d.addCallback(_check) return d + def test_mail_on_missing(self): + self.master.loadConfig(config_mail_missing) + self.master.readConfig = True + self.master.startService() + fm = FakeMailer("buildbot at example.org") + fm.messages = [] + fm.setServiceParent(self.master) + self.master.statusTargets.append(fm) + + d = self.connectSlave() + d.addCallback(self.stall, 1) + d.addCallback(lambda res: self.shutdownSlave("bot1", "dummy")) + def _not_yet(res): + self.failIf(fm.messages) + d.addCallback(_not_yet) + # we reconnect right away, so the timer shouldn't fire + d.addCallback(lambda res: self.connectSlave()) + d.addCallback(self.stall, 3) + d.addCallback(_not_yet) + d.addCallback(lambda res: self.shutdownSlave("bot1", "dummy")) + d.addCallback(_not_yet) + # now we let it sit disconnected for long enough for the timer to + # fire + d.addCallback(self.stall, 3) + def _check(res): + self.failUnlessEqual(len(fm.messages), 1) + msg,recips = fm.messages[0] + self.failUnlessEqual(recips, ["admin"]) + body = msg.as_string() + self.failUnlessIn("Subject: Buildbot: buildslave bot1 was lost", + body) + self.failUnlessIn("From: buildbot at example.org", body) + self.failUnlessIn("working for 'myproject'", body) + self.failUnlessIn("has noticed that the buildslave named bot1 went away", + body) + self.failUnlessIn("was 'one'", body) + self.failUnlessIn("myURL", body) + d.addCallback(_check) + return d + + def stall(self, result, delay=1): + d = defer.Deferred() + reactor.callLater(delay, d.callback, result) + return d From warner at users.sourceforge.net Sat Sep 29 01:07:56 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 29 Sep 2007 01:07:56 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.938,1.939 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25039 Modified Files: ChangeLog Log Message: [project @ add arg to send email when buildslaves go missing. Closes #64.] Original author: warner at lothar.com Date: 2007-09-29 01:06:11+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.938 retrieving revision 1.939 diff -u -d -r1.938 -r1.939 --- ChangeLog 28 Sep 2007 09:33:40 -0000 1.938 +++ ChangeLog 29 Sep 2007 01:07:48 -0000 1.939 @@ -1,5 +1,14 @@ 2007-09-28 Brian Warner + * buildbot/buildslave.py (BuildSlave): add notify_on_missing= + argument, to send email about buildslaves which are disconnected + for more than an hour. Closes #64. + * buildbot/test/test_slaves.py (BuildSlave.test_mail_on_missing): + test it + * docs/buildbot.texinfo (When Buildslaves Go Missing): document it + (MailNotifier): add docs for this too + + * buildbot/status/web/baseweb.py (OneBoxPerBuilder): make this page respect branch= queryargs, by restricting the builds displayed to those matching the given branch names From warner at users.sourceforge.net Sat Sep 29 01:08:30 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 29 Sep 2007 01:08:30 +0000 Subject: [Buildbot-commits] buildbot .darcs-boring,1.2,1.3 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25434 Modified Files: .darcs-boring Log Message: [project @ minor .darcs-boring update, for generated .info-NN files] Original author: warner at lothar.com Date: 2007-09-29 01:07:13+00:00 Index: .darcs-boring =================================================================== RCS file: /cvsroot/buildbot/buildbot/.darcs-boring,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- .darcs-boring 31 Jul 2006 08:31:32 -0000 1.2 +++ .darcs-boring 29 Sep 2007 01:08:28 -0000 1.3 @@ -41,6 +41,7 @@ # tree-local stuff ^docs/buildbot\.html$ ^docs/buildbot\.info$ +^docs/buildbot\.info- ^docs/buildbot\.ps$ ^docs/images/.*\.png$ ^docs/images/.*\.eps$ From warner at users.sourceforge.net Sat Sep 29 20:47:25 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 29 Sep 2007 20:47:25 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.939,1.940 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22011 Modified Files: ChangeLog Log Message: [project @ bonsaipoller: apply bugfixes from the mozilla folks. Closes #61.] Original author: warner at lothar.com Date: 2007-09-29 20:46:34+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.939 retrieving revision 1.940 diff -u -d -r1.939 -r1.940 --- ChangeLog 29 Sep 2007 01:07:48 -0000 1.939 +++ ChangeLog 29 Sep 2007 20:47:23 -0000 1.940 @@ -1,3 +1,10 @@ +2007-09-29 Brian Warner + + * buildbot/changes/bonsaipoller.py: apply changes from the Mozilla + team, to fix some bugs and avoid the use of blocking urlopen(). + closes #61. + * buildbot/test/test_bonsaipoller.py: same + 2007-09-28 Brian Warner * buildbot/buildslave.py (BuildSlave): add notify_on_missing= From warner at users.sourceforge.net Sat Sep 29 20:47:26 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 29 Sep 2007 20:47:26 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_bonsaipoller.py, 1.2, 1.3 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22011/buildbot/test Modified Files: test_bonsaipoller.py Log Message: [project @ bonsaipoller: apply bugfixes from the mozilla folks. Closes #61.] Original author: warner at lothar.com Date: 2007-09-29 20:46:34+00:00 Index: test_bonsaipoller.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_bonsaipoller.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- test_bonsaipoller.py 24 Nov 2006 07:19:33 -0000 1.2 +++ test_bonsaipoller.py 29 Sep 2007 20:47:24 -0000 1.3 @@ -4,7 +4,6 @@ from buildbot.changes.bonsaipoller import FileNode, CiNode, BonsaiResult, \ BonsaiParser, BonsaiPoller, InvalidResultError, EmptyResult -from StringIO import StringIO from copy import deepcopy import re @@ -116,7 +115,7 @@ class TestBonsaiPoller(unittest.TestCase): def testFullyFormedResult(self): - br = BonsaiParser(StringIO(goodUnparsedResult)) + br = BonsaiParser(goodUnparsedResult) result = br.getData() # make sure the result is a BonsaiResult self.failUnless(isinstance(result, BonsaiResult)) @@ -126,49 +125,49 @@ def testBadUnparsedResult(self): try: - BonsaiParser(StringIO(badUnparsedResult)) + BonsaiParser(badUnparsedResult) self.fail(badResultMsgs["badUnparsedResult"]) except InvalidResultError: pass def testInvalidDateResult(self): try: - BonsaiParser(StringIO(invalidDateResult)) + BonsaiParser(invalidDateResult) self.fail(badResultMsgs["invalidDateResult"]) except InvalidResultError: pass def testMissingRevisionResult(self): try: - BonsaiParser(StringIO(missingRevisionResult)) + BonsaiParser(missingRevisionResult) self.fail(badResultMsgs["missingRevisionResult"]) except InvalidResultError: pass def testMissingFilenameResult(self): try: - BonsaiParser(StringIO(missingFilenameResult)) + BonsaiParser(missingFilenameResult) self.fail(badResultMsgs["missingFilenameResult"]) except InvalidResultError: pass def testDuplicateLogResult(self): try: - BonsaiParser(StringIO(duplicateLogResult)) + BonsaiParser(duplicateLogResult) self.fail(badResultMsgs["duplicateLogResult"]) except InvalidResultError: pass def testDuplicateFilesResult(self): try: - BonsaiParser(StringIO(duplicateFilesResult)) + BonsaiParser(duplicateFilesResult) self.fail(badResultMsgs["duplicateFilesResult"]) except InvalidResultError: pass def testMissingCiResult(self): try: - BonsaiParser(StringIO(missingCiResult)) + BonsaiParser(missingCiResult) self.fail(badResultMsgs["missingCiResult"]) except EmptyResult: pass @@ -177,6 +176,6 @@ "Make sure a change is not submitted if the BonsaiParser fails" poller = FakeBonsaiPoller() lastChangeBefore = poller.lastChange - poller._process_changes(StringIO(badUnparsedResult)) + poller._process_changes(badUnparsedResult) # self.lastChange will not be updated if the change was not submitted self.failUnlessEqual(lastChangeBefore, poller.lastChange) From warner at users.sourceforge.net Sat Sep 29 20:47:26 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 29 Sep 2007 20:47:26 +0000 Subject: [Buildbot-commits] buildbot/buildbot/changes bonsaipoller.py, 1.5, 1.6 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/changes In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22011/buildbot/changes Modified Files: bonsaipoller.py Log Message: [project @ bonsaipoller: apply bugfixes from the mozilla folks. Closes #61.] Original author: warner at lothar.com Date: 2007-09-29 20:46:34+00:00 Index: bonsaipoller.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/bonsaipoller.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- bonsaipoller.py 31 Jan 2007 00:45:58 -0000 1.5 +++ bonsaipoller.py 29 Sep 2007 20:47:23 -0000 1.6 @@ -1,10 +1,10 @@ import time -from urllib import urlopen from xml.dom import minidom from twisted.python import log, failure -from twisted.internet import defer, reactor +from twisted.internet import reactor from twisted.internet.task import LoopingCall +from twisted.web.client import getPage from buildbot.changes import base, changes @@ -64,14 +64,12 @@ class BonsaiParser: """I parse the XML result from a bonsai cvsquery.""" - def __init__(self, bonsaiQuery): + def __init__(self, data): try: # this is a fix for non-ascii characters - # readlines() + join is being used because read() is not guaranteed - # to work. because bonsai does not give us an encoding to work with + # because bonsai does not give us an encoding to work with # it impossible to be 100% sure what to decode it as but latin1 covers # the broadest base - data = "".join(bonsaiQuery.readlines()) data = data.decode("latin1") data = data.encode("ascii", "replace") self.dom = minidom.parseString(data) @@ -148,7 +146,10 @@ elif len(logs) > 1: raise InvalidResultError("Multiple logs present") - return logs[0].firstChild.data + # catch empty check-in comments + if logs[0].firstChild: + return logs[0].firstChild.data + return '' def _getWho(self): """Returns the e-mail address of the commiter""" @@ -284,10 +285,9 @@ self.lastPoll = time.time() # get the page, in XML format - return defer.maybeDeferred(urlopen, url) + return getPage(url, timeout=self.pollInterval) def _process_changes(self, query): - files = [] try: bp = BonsaiParser(query) result = bp.getData() @@ -298,8 +298,8 @@ return for cinode in result.nodes: - for file in cinode.files: - files.append(file.filename+' (revision '+file.revision+')') + files = [file.filename + ' (revision '+file.revision+')' + for file in cinode.files] c = changes.Change(who = cinode.who, files = files, comments = cinode.log, From warner at users.sourceforge.net Sat Sep 29 21:23:14 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 29 Sep 2007 21:23:14 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts logwatcher.py, 1.1, 1.2 reconfig.py, 1.2, 1.3 runner.py, 1.56, 1.57 startup.py, 1.5, 1.6 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3687/buildbot/scripts Modified Files: logwatcher.py reconfig.py runner.py startup.py Log Message: [project @ runner: increase start/stop timeout to 10 seconds, for #68] Original author: warner at lothar.com Date: 2007-09-29 21:22:30+00:00 Index: logwatcher.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/logwatcher.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- logwatcher.py 25 Nov 2006 07:57:32 -0000 1.1 +++ logwatcher.py 29 Sep 2007 21:23:12 -0000 1.2 @@ -18,7 +18,7 @@ class LogWatcher(LineOnlyReceiver): POLL_INTERVAL = 0.1 - TIMEOUT_DELAY = 5.0 + TIMEOUT_DELAY = 10.0 delimiter = os.linesep def __init__(self, logfile): @@ -31,7 +31,7 @@ def start(self): # return a Deferred that fires when the reconfig process has # finished. It errbacks with TimeoutError if the finish line has not - # been seen within 5 seconds, and with ReconfigError if the error + # been seen within 10 seconds, and with ReconfigError if the error # line was seen. If the logfile could not be opened, it errbacks with # an IOError. self.running = True Index: reconfig.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/reconfig.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- reconfig.py 25 Nov 2006 07:57:32 -0000 1.2 +++ reconfig.py 29 Sep 2007 21:23:12 -0000 1.3 @@ -20,7 +20,7 @@ # keep reading twistd.log. Display all messages between "loading # configuration from ..." and "configuration update complete" or # "I will keep using the previous config file instead.", or until - # 5 seconds have elapsed. + # 10 seconds have elapsed. self.sent_signal = False lw = LogWatcher("twistd.log") Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- runner.py 25 Sep 2007 20:07:29 -0000 1.56 +++ runner.py 29 Sep 2007 21:23:12 -0000 1.57 @@ -377,8 +377,8 @@ 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 + while timer < 10: + # poll once per second until twistd.pid goes away, up to 10 seconds try: os.kill(pid, 0) except OSError: Index: startup.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/startup.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- startup.py 1 Aug 2007 20:31:53 -0000 1.5 +++ startup.py 29 Sep 2007 21:23:12 -0000 1.6 @@ -25,13 +25,13 @@ ReconfigError, BuildslaveTimeoutError, BuildSlaveDetectedError if why.check(BuildmasterTimeoutError): print """ -The buildmaster took more than 5 seconds to start, so we were unable to +The buildmaster took more than 10 seconds to start, so we were unable to confirm that it started correctly. Please 'tail twistd.log' and look for a line that says 'configuration update complete' to verify correct startup. """ elif why.check(BuildslaveTimeoutError): print """ -The buildslave took more than 5 seconds to start and/or connect to the +The buildslave took more than 10 seconds to start and/or connect to the buildmaster, so we were unable to confirm that it started and connected correctly. Please 'tail twistd.log' and look for a line that says 'message from master: attached' to verify correct startup. If you see a bunch of From warner at users.sourceforge.net Sat Sep 29 21:23:14 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 29 Sep 2007 21:23:14 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.940,1.941 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3687 Modified Files: ChangeLog Log Message: [project @ runner: increase start/stop timeout to 10 seconds, for #68] Original author: warner at lothar.com Date: 2007-09-29 21:22:30+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.940 retrieving revision 1.941 diff -u -d -r1.940 -r1.941 --- ChangeLog 29 Sep 2007 20:47:23 -0000 1.940 +++ ChangeLog 29 Sep 2007 21:23:12 -0000 1.941 @@ -1,5 +1,13 @@ 2007-09-29 Brian Warner + * buildbot/scripts/runner.py (stop): increase the timeout from 5 + seconds to 10, to give heavily loaded machines a better chance to + finish shutting down. Addresses (partially) #68. + * buildbot/scripts/logwatcher.py (LogWatcher.TIMEOUT_DELAY): same, + on startup + * buildbot/scripts/reconfig.py (Reconfigurator.run): same + * buildbot/scripts/startup.py (Follower._failure): update message + * buildbot/changes/bonsaipoller.py: apply changes from the Mozilla team, to fix some bugs and avoid the use of blocking urlopen(). closes #61. From warner at users.sourceforge.net Sat Sep 29 22:39:24 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 29 Sep 2007 22:39:24 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status tinderbox.py,1.5,1.6 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv371/buildbot/status Modified Files: tinderbox.py Log Message: [project @ TinderboxMailNotifier: respect 'builders' arg. Closes #89.] Original author: warner at lothar.com Date: 2007-09-29 22:38:48+00:00 Index: tinderbox.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/tinderbox.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- tinderbox.py 12 Dec 2006 03:24:03 -0000 1.5 +++ tinderbox.py 29 Sep 2007 22:39:22 -0000 1.6 @@ -94,6 +94,12 @@ self.logCompression = logCompression def buildStarted(self, name, build): + builder = build.getBuilder() + if self.builders is not None and name not in self.builders: + return # ignore this Build + if self.categories is not None and \ + builder.category not in self.categories: + return # ignore this build self.buildMessage(name, build, "building") def buildMessage(self, name, build, results): From warner at users.sourceforge.net Sat Sep 29 22:39:24 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 29 Sep 2007 22:39:24 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.941,1.942 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv371 Modified Files: ChangeLog Log Message: [project @ TinderboxMailNotifier: respect 'builders' arg. Closes #89.] Original author: warner at lothar.com Date: 2007-09-29 22:38:48+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.941 retrieving revision 1.942 diff -u -d -r1.941 -r1.942 --- ChangeLog 29 Sep 2007 21:23:12 -0000 1.941 +++ ChangeLog 29 Sep 2007 22:39:22 -0000 1.942 @@ -1,5 +1,8 @@ 2007-09-29 Brian Warner + * buildbot/status/tinderbox.py (TinderboxMailNotifier.buildStarted): + respect 'builders' arg, from Ben Hearsum. Closes #89. + * buildbot/scripts/runner.py (stop): increase the timeout from 5 seconds to 10, to give heavily loaded machines a better chance to finish shutting down. Addresses (partially) #68. From warner at users.sourceforge.net Sat Sep 29 22:51:42 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 29 Sep 2007 22:51:42 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.942,1.943 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5090 Modified Files: ChangeLog Log Message: [project @ bonsaipoller: tolerate empty log messages. Closes #90.] Original author: warner at lothar.com Date: 2007-09-29 22:51:06+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.942 retrieving revision 1.943 diff -u -d -r1.942 -r1.943 --- ChangeLog 29 Sep 2007 22:39:22 -0000 1.942 +++ ChangeLog 29 Sep 2007 22:51:40 -0000 1.943 @@ -1,5 +1,11 @@ 2007-09-29 Brian Warner + * buildbot/changes/bonsaipoller.py (BonsaiParser): "Make + bonsaipoller ignore funkyness in xml output for empy log + messages", from Axel Hecht. Closes #90. + * buildbot/test/test_bonsaipoller.py + (TestBonsaiPoller.testMergeEmptyLogMsg): same + * buildbot/status/tinderbox.py (TinderboxMailNotifier.buildStarted): respect 'builders' arg, from Ben Hearsum. Closes #89. From warner at users.sourceforge.net Sat Sep 29 22:51:42 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 29 Sep 2007 22:51:42 +0000 Subject: [Buildbot-commits] buildbot/buildbot/changes bonsaipoller.py, 1.6, 1.7 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/changes In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5090/buildbot/changes Modified Files: bonsaipoller.py Log Message: [project @ bonsaipoller: tolerate empty log messages. Closes #90.] Original author: warner at lothar.com Date: 2007-09-29 22:51:06+00:00 Index: bonsaipoller.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/bonsaipoller.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- bonsaipoller.py 29 Sep 2007 20:47:23 -0000 1.6 +++ bonsaipoller.py 29 Sep 2007 22:51:40 -0000 1.7 @@ -100,8 +100,16 @@ pass except InvalidResultError: raise - nodes.append(CiNode(self._getLog(), self._getWho(), - self._getDate(), files)) + cinode = CiNode(self._getLog(), self._getWho(), + self._getDate(), files) + # hack around bonsai xml output bug for empty check-in comments + if not cinode.log and nodes and \ + not nodes[-1].log and \ + cinode.who == nodes[-1].who and \ + cinode.date == nodes[-1].date: + nodes[-1].files += cinode.files + else: + nodes.append(cinode) except NoMoreCiNodes: pass From warner at users.sourceforge.net Sat Sep 29 22:51:42 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 29 Sep 2007 22:51:42 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_bonsaipoller.py, 1.3, 1.4 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5090/buildbot/test Modified Files: test_bonsaipoller.py Log Message: [project @ bonsaipoller: tolerate empty log messages. Closes #90.] Original author: warner at lothar.com Date: 2007-09-29 22:51:06+00:00 Index: test_bonsaipoller.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_bonsaipoller.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- test_bonsaipoller.py 29 Sep 2007 20:47:24 -0000 1.3 +++ test_bonsaipoller.py 29 Sep 2007 22:51:40 -0000 1.4 @@ -109,6 +109,37 @@ "BonsaiParser did not raise an exception when there was no tags" } +noCheckinMsgResult = """\ + + + + + + first/file.ext + + + + + + second/file.ext + + + + + + third/file.ext + + + +""" + +noCheckinMsgRef = [dict(filename="first/file.ext", + revision="1.1"), + dict(filename="second/file.ext", + revision="1.2"), + dict(filename="third/file.ext", + revision="1.3")] + class FakeBonsaiPoller(BonsaiPoller): def __init__(self): BonsaiPoller.__init__(self, "fake url", "fake module", "fake branch") @@ -179,3 +210,16 @@ poller._process_changes(badUnparsedResult) # self.lastChange will not be updated if the change was not submitted self.failUnlessEqual(lastChangeBefore, poller.lastChange) + + def testMergeEmptyLogMsg(self): + """Ensure that BonsaiPoller works around the bonsai xml output + issue when the check-in comment is empty""" + bp = BonsaiParser(noCheckinMsgResult) + result = bp.getData() + self.failUnlessEqual(len(result.nodes), 1) + self.failUnlessEqual(result.nodes[0].who, "johndoe at domain.tld") + self.failUnlessEqual(result.nodes[0].date, 12345678) + self.failUnlessEqual(result.nodes[0].log, "") + for file, ref in zip(result.nodes[0].files, noCheckinMsgRef): + self.failUnlessEqual(file.filename, ref['filename']) + self.failUnlessEqual(file.revision, ref['revision']) From warner at users.sourceforge.net Sat Sep 29 22:58:17 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 29 Sep 2007 22:58:17 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status tinderbox.py,1.6,1.7 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7750/buildbot/status Modified Files: tinderbox.py Log Message: [project @ tinderbox: add errorparser= arg to TinderboxMailNotifier. Closes #94.] Original author: warner at lothar.com Date: 2007-09-29 22:57:41+00:00 Index: tinderbox.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/tinderbox.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- tinderbox.py 29 Sep 2007 22:39:22 -0000 1.6 +++ tinderbox.py 29 Sep 2007 22:58:15 -0000 1.7 @@ -33,12 +33,12 @@ compare_attrs = ["extraRecipients", "fromaddr", "categories", "builders", "addLogs", "relayhost", "subject", "binaryURL", "tree", - "logCompression"] + "logCompression", "errorparser"] def __init__(self, fromaddr, tree, extraRecipients, categories=None, builders=None, relayhost="localhost", subject="buildbot %(result)s in %(builder)s", binaryURL="", - logCompression=""): + logCompression="", errorparser="unix"): """ @type fromaddr: string @param fromaddr: the email address to be used in the 'From' header. @@ -82,6 +82,11 @@ @param logCompression: The type of compression to use on the log. Valid options are"bzip2" and "gzip". gzip is only known to work on Python 2.4 and above. + + @type errorparser: string + @param errorparser: The error parser that the Tinderbox server + should use when scanning the log file. + Default is "unix". """ mail.MailNotifier.__init__(self, fromaddr, categories=categories, @@ -92,6 +97,7 @@ self.tree = tree self.binaryURL = binaryURL self.logCompression = logCompression + self.errorparser = errorparser def buildStarted(self, name, build): builder = build.getBuilder() @@ -130,7 +136,7 @@ text += "\n"; text += "%s build: %s\n" % (t, name) - text += "%s errorparser: unix\n" % t # always use the unix errorparser + text += "%s errorparser: %s\n" % (t, self.errorparser) # if the build just started... if results == "building": From warner at users.sourceforge.net Sat Sep 29 22:58:17 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sat, 29 Sep 2007 22:58:17 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.943,1.944 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7750 Modified Files: ChangeLog Log Message: [project @ tinderbox: add errorparser= arg to TinderboxMailNotifier. Closes #94.] Original author: warner at lothar.com Date: 2007-09-29 22:57:41+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.943 retrieving revision 1.944 diff -u -d -r1.943 -r1.944 --- ChangeLog 29 Sep 2007 22:51:40 -0000 1.943 +++ ChangeLog 29 Sep 2007 22:58:15 -0000 1.944 @@ -1,5 +1,9 @@ 2007-09-29 Brian Warner + * buildbot/status/tinderbox.py (TinderboxMailNotifier): allow + this to specify an errorparser. From Ted Mielczarek and the + mozilla crew. Closes #94. + * buildbot/changes/bonsaipoller.py (BonsaiParser): "Make bonsaipoller ignore funkyness in xml output for empy log messages", from Axel Hecht. Closes #90. From warner at users.sourceforge.net Sun Sep 30 01:04:14 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 01:04:14 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_webparts.py, 1.1, 1.2 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25055/buildbot/test Modified Files: test_webparts.py Log Message: [project @ test_webparts: make sure WebStatus works after a reload] Original author: warner at lothar.com Date: 2007-09-30 01:03:46+00:00 Index: test_webparts.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_webparts.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- test_webparts.py 28 Sep 2007 09:33:31 -0000 1.1 +++ test_webparts.py 30 Sep 2007 01:04:12 -0000 1.2 @@ -28,6 +28,16 @@ port = list(self.find_webstatus(m)[0])[0]._port.getHost().port self.baseurl = "http://localhost:%d/" % port + def reconfigMaster(self, extraconfig): + config = base_config + extraconfig + d = self.master.loadConfig(config) + def _done(res): + m = self.master + port = list(self.find_webstatus(m)[0])[0]._port.getHost().port + self.baseurl = "http://localhost:%d/" % port + d.addCallback(_done) + return d + def getAndCheck(self, url, substring, show=False): d = client.getPage(url) def _show_weberror(why): @@ -92,6 +102,17 @@ """ self.startMaster(extraconfig) d = defer.succeed(None) + d.addCallback(self._do_page_tests) + extraconfig2 = """ +ws = html.WebStatus(http_port=0, allowForce=True) +c['status'] = [ws] +""" + d.addCallback(lambda res: self.reconfigMaster(extraconfig2)) + d.addCallback(self._do_page_tests) + return d + + def _do_page_tests(self, res): + d = defer.succeed(None) d.addCallback(self._check, "", "Welcome to the Buildbot") d.addCallback(self._check, "waterfall", "current activity") d.addCallback(self._check, "about", "Buildbot is a free software") From warner at users.sourceforge.net Sun Sep 30 01:04:14 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 01:04:14 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web baseweb.py, 1.23, 1.24 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25055/buildbot/status/web Modified Files: baseweb.py Log Message: [project @ test_webparts: make sure WebStatus works after a reload] Original author: warner at lothar.com Date: 2007-09-30 01:03:46+00:00 Index: baseweb.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/baseweb.py,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- baseweb.py 28 Sep 2007 09:33:40 -0000 1.23 +++ baseweb.py 30 Sep 2007 01:04:12 -0000 1.24 @@ -409,6 +409,15 @@ self.footer = FOOTER self.template_values = {} + # TODO: browsers will cache connections, and if we've recently + # reloaded the config file, a browser might still be talking to the + # previous Site, which will work for some things, but will break when + # they try to reach through our .parent attribute (usually via + # HtmlResource.getStatus(), which does + # request.site.buildbot_service.parent). I don't know of a good way + # to deal with this.. maybe the Site has some list of current + # connections which we can crawl through and terminate? + if self.http_port is not None: s = strports.service(self.http_port, self.site) s.setServiceParent(self) @@ -431,11 +440,13 @@ def __repr__(self): if self.http_port is None: - return "" % self.distrib_port + return "" % (self.distrib_port, + hex(id(self))) if self.distrib_port is None: - return "" % self.http_port - return "" % (self.http_port, - self.distrib_port) + return "" % (self.http_port, + hex(id(self))) + return ("" % + (self.http_port, self.distrib_port, hex(id(self)))) def setServiceParent(self, parent): service.MultiService.setServiceParent(self, parent) From warner at users.sourceforge.net Sun Sep 30 01:04:14 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 01:04:14 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.944,1.945 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25055 Modified Files: ChangeLog Log Message: [project @ test_webparts: make sure WebStatus works after a reload] Original author: warner at lothar.com Date: 2007-09-30 01:03:46+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.944 retrieving revision 1.945 diff -u -d -r1.944 -r1.945 --- ChangeLog 29 Sep 2007 22:58:15 -0000 1.944 +++ ChangeLog 30 Sep 2007 01:04:12 -0000 1.945 @@ -1,5 +1,13 @@ 2007-09-29 Brian Warner + * buildbot/test/test_webparts.py (Webparts.testPages): reload the + WebStatus, make sure all pages are still retrievable. I thought + this would exercise a bug, but it turns out that it was firefox + caching connections (and continuing to talk to the old WebStatus + even though I'd loaded a new one). + * buildbot/status/web/baseweb.py (WebStatus): add some comments + (WebStatus.__repr__): include id() in the repr + * buildbot/status/tinderbox.py (TinderboxMailNotifier): allow this to specify an errorparser. From Ted Mielczarek and the mozilla crew. Closes #94. From warner at users.sourceforge.net Sun Sep 30 01:53:24 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 01:53:24 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.945,1.946 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12764 Modified Files: ChangeLog Log Message: [project @ web: track HTTPChannels, so we can kill them at reconfig time. Closes #102] Original author: warner at lothar.com Date: 2007-09-30 01:52:54+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.945 retrieving revision 1.946 diff -u -d -r1.945 -r1.946 --- ChangeLog 30 Sep 2007 01:04:12 -0000 1.945 +++ ChangeLog 30 Sep 2007 01:53:22 -0000 1.946 @@ -1,5 +1,12 @@ 2007-09-29 Brian Warner + * buildbot/status/web/base.py (HtmlResource.render): keep track of + HTTPChannels, so we can shut them down at reconfig time (when the + WebStatus goes away). Closes #102. + * buildbot/status/web/baseweb.py (WebStatus.__init__): same + (WebStatus.registerChannel): same + (WebStatus.stopService): do .loseConnection() here + * buildbot/test/test_webparts.py (Webparts.testPages): reload the WebStatus, make sure all pages are still retrievable. I thought this would exercise a bug, but it turns out that it was firefox From warner at users.sourceforge.net Sun Sep 30 01:53:24 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 01:53:24 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web base.py, 1.13, 1.14 baseweb.py, 1.24, 1.25 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12764/buildbot/status/web Modified Files: base.py baseweb.py Log Message: [project @ web: track HTTPChannels, so we can kill them at reconfig time. Closes #102] Original author: warner at lothar.com Date: 2007-09-30 01:52:54+00:00 Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/base.py,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- base.py 28 Sep 2007 09:33:31 -0000 1.13 +++ base.py 30 Sep 2007 01:53:22 -0000 1.14 @@ -174,6 +174,14 @@ return resource.Resource.getChild(self, path, request) def render(self, request): + # tell the WebStatus about the HTTPChannel that got opened, so they + # can close it if we get reconfigured and the WebStatus goes away. + # They keep a weakref to this, since chances are good that it will be + # closed by the browser or by us before we get reconfigured. See + # ticket #102 for details. + if hasattr(request, "channel"): + # web.distrib.Request has no .channel + request.site.buildbot_service.registerChannel(request.channel) # Our pages no longer require that their URL end in a slash. Instead, # they all use request.childLink() or some equivalent which takes the Index: baseweb.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/baseweb.py,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- baseweb.py 30 Sep 2007 01:04:12 -0000 1.24 +++ baseweb.py 30 Sep 2007 01:53:22 -0000 1.25 @@ -1,5 +1,5 @@ -import os, sys, time, urllib +import os, sys, time, urllib, weakref from itertools import count from zope.interface import implements @@ -341,7 +341,10 @@ """ # we are not a ComparableMixin, and therefore the webserver will be - # rebuilt every time we reconfig. + # rebuilt every time we reconfig. This is because WebStatus.putChild() + # makes it too difficult to tell whether two instances are the same or + # not (we'd have to do a recursive traversal of all children to discover + # all the changes). def __init__(self, http_port=None, distrib_port=None, allowForce=False): """Run a web server that provides Buildbot status. @@ -409,14 +412,9 @@ self.footer = FOOTER self.template_values = {} - # TODO: browsers will cache connections, and if we've recently - # reloaded the config file, a browser might still be talking to the - # previous Site, which will work for some things, but will break when - # they try to reach through our .parent attribute (usually via - # HtmlResource.getStatus(), which does - # request.site.buildbot_service.parent). I don't know of a good way - # to deal with this.. maybe the Site has some list of current - # connections which we can crawl through and terminate? + # keep track of cached connections so we can break them when we shut + # down. See ticket #102 for more details. + self.channels = weakref.WeakKeyDictionary() if self.http_port is not None: s = strports.service(self.http_port, self.site) @@ -470,6 +468,19 @@ """This behaves a lot like root.putChild() . """ self.childrenToBeAdded[name] = child_resource + def registerChannel(self, channel): + self.channels[channel] = 1 # weakrefs + + def stopService(self): + for channel in self.channels: + try: + channel.transport.loseConnection() + except: + log.msg("WebStatus.stopService: error while disconnecting" + " leftover clients") + log.err() + return service.MultiService.stopService(self) + def getStatus(self): return self.parent.getStatus() def getControl(self): From warner at users.sourceforge.net Sun Sep 30 02:02:12 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 02:02:12 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.946,1.947 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16607 Modified Files: ChangeLog Log Message: [project @ examples: bring them up to date or get rid of them. Closes #79.] Original author: warner at lothar.com Date: 2007-09-30 02:01:26+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.946 retrieving revision 1.947 diff -u -d -r1.946 -r1.947 --- ChangeLog 30 Sep 2007 01:53:22 -0000 1.946 +++ ChangeLog 30 Sep 2007 02:02:10 -0000 1.947 @@ -1,5 +1,13 @@ 2007-09-29 Brian Warner + * buildbot/scripts/sample.cfg: use buildstep instances in + f.addStep, to demonstrate the (correct) modern usage. + * docs/examples/hello.cfg: bring this up to date. Closes #79. + * docs/examples/twisted_master.cfg: add a big warning about how + old this is + * docs/examples/glib_master.cfg: delete this one entirely, it is + ancient and not a very useful example anyways + * buildbot/status/web/base.py (HtmlResource.render): keep track of HTTPChannels, so we can shut them down at reconfig time (when the WebStatus goes away). Closes #102. From warner at users.sourceforge.net Sun Sep 30 02:02:12 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 02:02:12 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts sample.cfg,1.17,1.18 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16607/buildbot/scripts Modified Files: sample.cfg Log Message: [project @ examples: bring them up to date or get rid of them. Closes #79.] Original author: warner at lothar.com Date: 2007-09-30 02:01:26+00:00 Index: sample.cfg =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/sample.cfg,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- sample.cfg 7 Aug 2007 23:41:06 -0000 1.17 +++ sample.cfg 30 Sep 2007 02:02:10 -0000 1.18 @@ -100,11 +100,9 @@ from buildbot.steps.shell import Compile from buildbot.steps.python_twisted import Trial f1 = factory.BuildFactory() -f1.addStep(CVS, - cvsroot=cvsroot, cvsmodule=cvsmodule, login="", - mode="copy") -f1.addStep(Compile, command=["./setup.py", "build"]) -f1.addStep(Trial, testpath=".") +f1.addStep(CVS(cvsroot=cvsroot, cvsmodule=cvsmodule, login="", mode="copy")) +f1.addStep(Compile(command=["python", "./setup.py", "build"])) +f1.addStep(Trial(testpath=".")) b1 = {'name': "buildbot-full", 'slavename': "bot1name", @@ -123,7 +121,7 @@ c['status'] = [] from buildbot.status import html -c['status'].append(html.Waterfall(http_port=8010)) +c['status'].append(html.WebStatus(http_port=8010)) # from buildbot.status import mail # c['status'].append(mail.MailNotifier(fromaddr="buildbot at localhost", From warner at users.sourceforge.net Sun Sep 30 02:02:13 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 02:02:13 +0000 Subject: [Buildbot-commits] buildbot/docs/examples hello.cfg, 1.10, 1.11 twisted_master.cfg, 1.47, 1.48 Message-ID: Update of /cvsroot/buildbot/buildbot/docs/examples In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16607/docs/examples Modified Files: hello.cfg twisted_master.cfg Log Message: [project @ examples: bring them up to date or get rid of them. Closes #79.] Original author: warner at lothar.com Date: 2007-09-30 02:01:26+00:00 Index: hello.cfg =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/examples/hello.cfg,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- hello.cfg 22 Sep 2006 05:46:28 -0000 1.10 +++ hello.cfg 30 Sep 2007 02:02:10 -0000 1.11 @@ -1,91 +1,79 @@ #! /usr/bin/python from buildbot import master +from buildbot.buildslave import BuildSlave from buildbot.process import factory from buildbot.steps.source import CVS, SVN, Darcs, Arch from buildbot.steps.shell import Configure, Compile, Test from buildbot.status import html, client from buildbot.changes.pb import PBChangeSource -s = factory.s BuildmasterConfig = c = {} -c['bots'] = [["bot1", "sekrit"]] +c['slaves'] = [BuildSlave("bot1", "sekrit")] -c['sources'] = [] -c['sources'].append(PBChangeSource(prefix="trunk")) +c['change_source'] = PBChangeSource(prefix="trunk") c['builders'] = [] -if 1: - steps = [ - s(CVS, - cvsroot="/usr/home/warner/stuff/Projects/BuildBot/demo/Repository", - cvsmodule="hello", - mode="clobber", - checkoutDelay=6, - alwaysUseLatest=True, - ), - s(Configure), - s(Compile), - s(Test, command=["make", "check"]), - ] +if True: + f = factory.BuildFactory() + f.addStep(CVS(cvsroot="/usr/home/warner/stuff/Projects/BuildBot/demo/Repository", + cvsmodule="hello", + mode="clobber", + checkoutDelay=6, + alwaysUseLatest=True, + )) + f.addStep(Configure()) + f.addStep(Compile()) + f.addStep(Test(command=["make", "check"])) b1 = {"name": "cvs-hello", "slavename": "bot1", "builddir": "cvs-hello", - "factory": factory.BuildFactory(steps), + "factory": f, } c['builders'].append(b1) -if 1: +if True: svnrep="file:///usr/home/warner/stuff/Projects/BuildBot/demo/SVN-Repository" - steps = [ - s(SVN, - svnurl=svnrep+"/hello", - mode="update", - ), - s(Configure), - s(Compile), - s(Test, command=["make", "check"]), - ] + f = factory.BuildFactory() + f.addStep(SVN(svnurl=svnrep+"/hello", mode="update")) + f.addStep(Configure()) + f.addStep(Compile()), + f.addStep(Test(command=["make", "check"])) b1 = {"name": "svn-hello", "slavename": "bot1", "builddir": "svn-hello", - "factory": factory.BuildFactory(steps), + "factory": f, } c['builders'].append(b1) -if 1: - steps = [ - s(Darcs, - repourl="http://localhost/~warner/hello-darcs", - mode="copy", - ), - s(Configure, command=["/bin/sh", "./configure"]), - s(Compile), - s(Test, command=["make", "check"]), - ] +if True: + f = factory.BuildFactory() + f.addStep(Darcs(repourl="http://localhost/~warner/hello-darcs", + mode="copy")) + f.addStep(Configure(command=["/bin/sh", "./configure"])) + f.addStep(Compile()) + f.addStep(Test(command=["make", "check"])) b1 = {"name": "darcs-hello", "slavename": "bot1", "builddir": "darcs-hello", - "factory": factory.BuildFactory(steps), + "factory": f, } c['builders'].append(b1) -if 1: - steps = [ - s(Arch, - url="http://localhost/~warner/hello-arch", - version="gnu-hello--release--2.1.1", - mode="copy", - ), - s(Configure), - s(Compile), - s(Test, command=["make", "check"]), - ] +if True: + f = factory.BuildFactory() + f.addStep(Arch(url="http://localhost/~warner/hello-arch", + version="gnu-hello--release--2.1.1", + mode="copy", + )) + f.addStep(Configure(command=["/bin/sh", "./configure"])) + f.addStep(Compile()) + f.addStep(Test(command=["make", "check"])) b1 = {"name": "arch-hello", "slavename": "bot1", "builddir": "arch-hello", - "factory": factory.BuildFactory(steps), + "factory": f, } c['builders'].append(b1) @@ -98,7 +86,7 @@ c['debugPassword'] = "asdf" c['manhole'] = master.Manhole(9900, "username", "password") -c['status'] = [html.Waterfall(http_port=8080), +c['status'] = [html.WebStatus(http_port=8080), client.PBListener(port=8008), ] Index: twisted_master.cfg =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/examples/twisted_master.cfg,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- twisted_master.cfg 24 Nov 2006 20:46:08 -0000 1.47 +++ twisted_master.cfg 30 Sep 2007 02:02:10 -0000 1.48 @@ -1,5 +1,10 @@ #! /usr/bin/python +# NOTE: this configuration file is from the buildbot-0.7.5 era or earlier. It +# has not been brought up-to-date with the standards of buildbot-0.7.6 . For +# examples of modern usage, please see hello.cfg, or the sample.cfg which is +# installed when you run 'buildbot create-master'. + # This configuration file is described in $BUILDBOT/docs/config.xhtml # This is used (with online=True) to run the Twisted Buildbot at From warner at users.sourceforge.net Sun Sep 30 02:36:36 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 02:36:36 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.947,1.948 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31070 Modified Files: ChangeLog Log Message: [project @ Mercurial: use last change to compute source revision. Closes #103.] Original author: warner at lothar.com Date: 2007-09-30 02:36:07+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.947 retrieving revision 1.948 diff -u -d -r1.947 -r1.948 --- ChangeLog 30 Sep 2007 02:02:10 -0000 1.947 +++ ChangeLog 30 Sep 2007 02:36:34 -0000 1.948 @@ -1,5 +1,9 @@ 2007-09-29 Brian Warner + * buildbot/steps/source.py (Mercurial.computeSourceRevision): take + the revision id from the last change in our list, since that's the + best we can do without knowing the full ancestry graph. Closes #103. + * buildbot/scripts/sample.cfg: use buildstep instances in f.addStep, to demonstrate the (correct) modern usage. * docs/examples/hello.cfg: bring this up to date. Closes #79. From warner at users.sourceforge.net Sun Sep 30 02:36:36 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 02:36:36 +0000 Subject: [Buildbot-commits] buildbot/buildbot/steps source.py,1.7,1.8 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/steps In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31070/buildbot/steps Modified Files: source.py Log Message: [project @ Mercurial: use last change to compute source revision. Closes #103.] Original author: warner at lothar.com Date: 2007-09-30 02:36:07+00:00 Index: source.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/steps/source.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- source.py 3 Jul 2007 19:17:49 -0000 1.7 +++ source.py 30 Sep 2007 02:36:34 -0000 1.8 @@ -890,6 +890,15 @@ cmd = LoggedRemoteCommand("hg", self.args) self.startCommand(cmd) + def computeSourceRevision(self, changes): + if not changes: + return None + # without knowing the revision ancestry graph, we can't sort the + # changes at all. So for now, assume they were given to us in sorted + # order, and just pay attention to the last one. See ticket #103 for + # more details. + return changes[-1].revision + class P4(Source): """ P4 is a class for accessing perforce revision control""" From warner at users.sourceforge.net Sun Sep 30 07:14:24 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 07:14:24 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.948,1.949 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16016 Modified Files: ChangeLog Log Message: [project @ upgrade-master: check master.cfg for problems, add docs] Original author: warner at lothar.com Date: 2007-09-30 07:13:39+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.948 retrieving revision 1.949 diff -u -d -r1.948 -r1.949 --- ChangeLog 30 Sep 2007 02:36:34 -0000 1.948 +++ ChangeLog 30 Sep 2007 07:14:22 -0000 1.949 @@ -1,3 +1,12 @@ +2007-09-30 Brian Warner + + * buildbot/scripts/runner.py (upgradeMaster): improvements: write + new copies of files (to .new) when those files already exist, + check the master.cfg file for errors (and give DeprecationWarnings + a chance to be displayed). + * buildbot/test/test_runner.py: add more tests + * docs/buildbot.texinfo (Upgrading an Existing Buildmaster): docs + 2007-09-29 Brian Warner * buildbot/steps/source.py (Mercurial.computeSourceRevision): take From warner at users.sourceforge.net Sun Sep 30 07:14:25 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 07:14:25 +0000 Subject: [Buildbot-commits] buildbot/docs buildbot.texinfo,1.121,1.122 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16016/docs Modified Files: buildbot.texinfo Log Message: [project @ upgrade-master: check master.cfg for problems, add docs] Original author: warner at lothar.com Date: 2007-09-30 07:13:39+00:00 Index: buildbot.texinfo =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/buildbot.texinfo,v retrieving revision 1.121 retrieving revision 1.122 diff -u -d -r1.121 -r1.122 --- buildbot.texinfo 29 Sep 2007 01:07:56 -0000 1.121 +++ buildbot.texinfo 30 Sep 2007 07:14:23 -0000 1.122 @@ -83,6 +83,7 @@ * Requirements:: * Installing the code:: * Creating a buildmaster:: +* Upgrading an Existing Buildmaster:: * Creating a buildslave:: * Launching the daemons:: * Logfiles:: @@ -600,6 +601,7 @@ * Requirements:: * Installing the code:: * Creating a buildmaster:: +* Upgrading an Existing Buildmaster:: * Creating a buildslave:: * Launching the daemons:: * Logfiles:: @@ -718,7 +720,7 @@ @code{PYTHONPATH}. - at node Creating a buildmaster, Creating a buildslave, Installing the code, Installation + at node Creating a buildmaster, Upgrading an Existing Buildmaster, Installing the code, Installation @section Creating a buildmaster As you learned earlier (@pxref{System Architecture}), the buildmaster @@ -770,8 +772,41 @@ installed. This can be used as the basis for customized daemon startup, @xref{Launching the daemons}. + at node Upgrading an Existing Buildmaster, Creating a buildslave, Creating a buildmaster, Installation + at section Upgrading an Existing Buildmaster - at node Creating a buildslave, Launching the daemons, Creating a buildmaster, Installation +If you have just installed a new version of the Buildbot code, and you +have buildmasters that were created using an older version, you'll +need to upgrade these buildmasters before you can use them. The +upgrade process adds and modifies files in the buildmaster's base +directory to make it compatible with the new code. + + at example +buildbot upgrade-master @var{basedir} + at end example + +This command will also scan your @file{master.cfg} file for +incompatbilities (by loading it and printing any errors or deprecation +warnings that occur). Each buildbot release tries to be compatible +with configurations that worked cleanly (i.e. without deprecation +warnings) on the previous release: any functions or classes that are +to be removed will first be deprecated in a release, to give users a +chance to start using their replacement. + +The 0.7.6 release introduced the @file{public_html/} directory, which +contains @file{index.html} and other files served by the + at code{WebStatus} and @code{Waterfall} status displays. The + at code{upgrade-master} command will create these files if they do not +already exist. It will not modify existing copies, but it will write a +new copy in e.g. @file{index.html.new} if the new version differs from +the version that already exists. + +The @code{upgrade-master} command is idempotent. It is safe to run it +multiple times. After each upgrade of the buildbot code, you should +use @code{upgrade-master} on all your buildmasters. + + + at node Creating a buildslave, Launching the daemons, Upgrading an Existing Buildmaster, Installation @section Creating a buildslave Typically, you will be adding a buildslave to an existing buildmaster, From warner at users.sourceforge.net Sun Sep 30 07:14:24 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 07:14:24 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.57,1.58 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16016/buildbot/scripts Modified Files: runner.py Log Message: [project @ upgrade-master: check master.cfg for problems, add docs] Original author: warner at lothar.com Date: 2007-09-30 07:13:39+00:00 Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- runner.py 29 Sep 2007 21:23:12 -0000 1.57 +++ runner.py 30 Sep 2007 07:14:22 -0000 1.58 @@ -153,14 +153,12 @@ f.close() os.chmod(target, 0600) - def public_html(self, index_html, buildbot_css, robots_txt, - repopulate=False): + def public_html(self, index_html, buildbot_css, robots_txt): webdir = os.path.join(self.basedir, "public_html") if os.path.exists(webdir): - if not repopulate: - if not self.quiet: - print "public_html/ already exists: not replacing" - return + if not self.quiet: + print "public_html/ already exists: not replacing" + return else: os.mkdir(webdir) if not self.quiet: @@ -180,6 +178,83 @@ f.write(open(robots_txt, "rt").read()) f.close() + def populate_if_missing(self, target, source, overwrite=False): + new_contents = open(source, "rt").read() + if os.path.exists(target): + old_contents = open(target, "rt").read() + if old_contents != new_contents: + if overwrite: + if not self.quiet: + print "%s has old/modified contents" % target + print " overwriting it with new contents" + open(target, "wt").write(new_contents) + else: + if not self.quiet: + print "%s has old/modified contents" % target + print " writing new contents to %s.new" % target + open(target + ".new", "wt").write(new_contents) + # otherwise, it's up to date + else: + if not self.quiet: + print "populating %s" % target + open(target, "wt").write(new_contents) + + def upgrade_public_html(self, index_html, buildbot_css, robots_txt): + webdir = os.path.join(self.basedir, "public_html") + if not os.path.exists(webdir): + if not self.quiet: + print "populating public_html/" + os.mkdir(webdir) + self.populate_if_missing(os.path.join(webdir, "index.html"), + index_html) + self.populate_if_missing(os.path.join(webdir, "buildbot.css"), + buildbot_css) + self.populate_if_missing(os.path.join(webdir, "robots.txt"), + robots_txt) + + def check_master_cfg(self): + from buildbot.master import BuildMaster + from twisted.python import log, failure + + master_cfg = os.path.join(self.basedir, "master.cfg") + if not os.path.exists(master_cfg): + if not self.quiet: + print "No master.cfg found" + return 1 + + # side-effects of loading the config file: + + # for each Builder defined in c['builders'], if the status directory + # didn't already exist, it will be created, and the + # $BUILDERNAME/builder pickle might be created (with a single + # "builder created" event). + + m = BuildMaster(self.basedir) + # we need to route log.msg to stdout, so any problems can be seen + # there. But if everything goes well, I'd rather not clutter stdout + # with log messages. So instead we add a logObserver which gathers + # messages and only displays them if something goes wrong. + messages = [] + log.addObserver(messages.append) + try: + # this will raise an exception if there's something wrong with + # the config file. Note that this BuildMaster instance is never + # started, so it won't actually do anything with the + # configuration. + m.loadConfig(open(master_cfg, "r")) + except: + f = failure.Failure() + if not self.quiet: + print + for m in messages: + print "".join(m['message']) + print f + print + print "An error was detected in the master.cfg file." + print "Please correct the problem and run 'buildbot upgrade-master' again." + print + return 1 + return 0 class UpgradeMasterOptions(MakerBase): optFlags = [ @@ -208,17 +283,23 @@ def upgradeMaster(config): basedir = config['basedir'] m = Maker(config) - m.quiet = True - # check TAC file - # check sample.cfg + # TODO: check Makefile + # TODO: check TAC file # check web files: index.html, classic.css, robots.txt webdir = os.path.join(basedir, "public_html") - m.public_html(util.sibpath(__file__, "../status/web/index.html"), - util.sibpath(__file__, "../status/web/classic.css"), - util.sibpath(__file__, "../status/web/robots.txt"), - repopulate=True - ) - # check Makefile + m.upgrade_public_html(util.sibpath(__file__, "../status/web/index.html"), + util.sibpath(__file__, "../status/web/classic.css"), + util.sibpath(__file__, "../status/web/robots.txt"), + ) + m.populate_if_missing(os.path.join(basedir, "master.cfg.sample"), + util.sibpath(__file__, "sample.cfg"), + overwrite=True) + rc = m.check_master_cfg() + if rc: + return rc + if not config['quiet']: + print "upgrade complete" + class MasterOptions(MakerBase): optFlags = [ From warner at users.sourceforge.net Sun Sep 30 07:14:25 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 07:14:25 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_runner.py, 1.16, 1.17 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16016/buildbot/test Modified Files: test_runner.py Log Message: [project @ upgrade-master: check master.cfg for problems, add docs] Original author: warner at lothar.com Date: 2007-09-30 07:13:39+00:00 Index: test_runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_runner.py,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- test_runner.py 25 Sep 2007 20:39:49 -0000 1.16 +++ test_runner.py 30 Sep 2007 07:14:22 -0000 1.17 @@ -157,7 +157,8 @@ "*should* rewrite master.cfg.sample") def testUpgradeMaster(self): - # first, create a master and then upgrade it. Nothing should change. + # first, create a master, run it briefly, then upgrade it. Nothing + # should change. basedir = "test_runner.master2" options = runner.MasterOptions() options.parseOptions(["-q", basedir]) @@ -165,11 +166,20 @@ runner.createMaster(options) os.chdir(cwd) + f = open(os.path.join(basedir, "master.cfg"), "w") + f.write(open(os.path.join(basedir, "master.cfg.sample"), "r").read()) + f.close() + + # the upgrade process (specifically the verify-master.cfg step) will + # create any builder status directories that weren't already created. + # Create those ahead of time. + os.mkdir(os.path.join(basedir, "full")) + files1 = self.record_files(basedir) # upgrade it options = runner.UpgradeMasterOptions() - options.parseOptions([basedir]) + options.parseOptions(["--quiet", basedir]) cwd = os.getcwd() runner.upgradeMaster(options) os.chdir(cwd) @@ -177,14 +187,14 @@ files2 = self.record_files(basedir) self.failUnlessSameFiles(files1, files2) - # now make it look like the one that 0.7.6 creates: no public_html + # now make it look like the one that 0.7.5 creates: no public_html for fn in os.listdir(os.path.join(basedir, "public_html")): os.unlink(os.path.join(basedir, "public_html", fn)) os.rmdir(os.path.join(basedir, "public_html")) # and make sure that upgrading it re-populates public_html options = runner.UpgradeMasterOptions() - options.parseOptions([basedir]) + options.parseOptions(["-q", basedir]) cwd = os.getcwd() runner.upgradeMaster(options) os.chdir(cwd) @@ -192,6 +202,23 @@ files3 = self.record_files(basedir) self.failUnlessSameFiles(files1, files3) + # now induce an error in master.cfg and make sure that upgrade + # notices it. + f = open(os.path.join(basedir, "master.cfg"), "a") + f.write("raise RuntimeError('catch me please')\n") + f.close() + + options = runner.UpgradeMasterOptions() + options.parseOptions(["-q", basedir]) + cwd = os.getcwd() + rc = runner.upgradeMaster(options) + os.chdir(cwd) + self.failUnless(rc != 0, rc) + # TODO: change the way runner.py works to let us pass in a stderr + # filehandle, and use a StringIO to capture its output, and make sure + # the right error messages appear therein. + + def failUnlessSameFiles(self, files1, files2): f1 = sets.Set(files1.keys()) f2 = sets.Set(files2.keys()) From warner at users.sourceforge.net Sun Sep 30 07:24:43 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 07:24:43 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.84,1.85 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19973/buildbot/slave Modified Files: commands.py Log Message: [project @ svn: ignore the trailing 'M' that indicates a modified file] Original author: warner at lothar.com Date: 2007-09-30 07:22:20+00:00 Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 --- commands.py 7 Aug 2007 23:50:40 -0000 1.84 +++ commands.py 30 Sep 2007 07:24:40 -0000 1.85 @@ -1511,6 +1511,9 @@ d = c.start() def _parse(res): r = c.stdout.strip() + # Support for removing svnversion indicator for 'modified' + if r[-1] == 'M': + r = r[:-1] got_version = None try: got_version = int(r) From warner at users.sourceforge.net Sun Sep 30 07:24:42 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 07:24:42 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.949,1.950 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19973 Modified Files: ChangeLog Log Message: [project @ svn: ignore the trailing 'M' that indicates a modified file] Original author: warner at lothar.com Date: 2007-09-30 07:22:20+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.949 retrieving revision 1.950 diff -u -d -r1.949 -r1.950 --- ChangeLog 30 Sep 2007 07:14:22 -0000 1.949 +++ ChangeLog 30 Sep 2007 07:24:40 -0000 1.950 @@ -1,5 +1,11 @@ 2007-09-30 Brian Warner + * buildbot/slave/commands.py (SVN.parseGotRevision._parse): remove + the trailing "M" indicator that tells us this is a modified file. + This should help with mode="update" builds that modify files + in-place. Thanks to "Oz" (chris at santacruzgames.com) for the + patch. + * buildbot/scripts/runner.py (upgradeMaster): improvements: write new copies of files (to .new) when those files already exist, check the master.cfg file for errors (and give DeprecationWarnings From warner at users.sourceforge.net Sun Sep 30 08:30:25 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 08:30:25 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.950,1.951 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14518 Modified Files: ChangeLog Log Message: [project @ docs: update docs on WebStatus, deprecate/deemphasize Waterfall] Original author: warner at lothar.com Date: 2007-09-30 08:28:57+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.950 retrieving revision 1.951 diff -u -d -r1.950 -r1.951 --- ChangeLog 30 Sep 2007 07:24:40 -0000 1.950 +++ ChangeLog 30 Sep 2007 08:30:22 -0000 1.951 @@ -1,5 +1,7 @@ 2007-09-30 Brian Warner + * docs/buildbot.texinfo (WebStatus): update docs + * buildbot/slave/commands.py (SVN.parseGotRevision._parse): remove the trailing "M" indicator that tells us this is a modified file. This should help with mode="update" builds that modify files From warner at users.sourceforge.net Sun Sep 30 08:30:25 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 08:30:25 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web slaves.py,1.3,1.4 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14518/buildbot/status/web Modified Files: slaves.py Log Message: [project @ docs: update docs on WebStatus, deprecate/deemphasize Waterfall] Original author: warner at lothar.com Date: 2007-09-30 08:28:57+00:00 Index: slaves.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/slaves.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- slaves.py 28 Sep 2007 09:33:31 -0000 1.3 +++ slaves.py 30 Sep 2007 08:30:23 -0000 1.4 @@ -6,7 +6,7 @@ class OneBuildSlaveResource(HtmlResource): pass # TODO -# /buildslaves/ +# /buildslaves class BuildSlavesResource(HtmlResource): title = "BuildSlaves" addSlash = True From warner at users.sourceforge.net Sun Sep 30 08:30:26 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 08:30:26 +0000 Subject: [Buildbot-commits] buildbot/docs buildbot.texinfo,1.122,1.123 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14518/docs Modified Files: buildbot.texinfo Log Message: [project @ docs: update docs on WebStatus, deprecate/deemphasize Waterfall] Original author: warner at lothar.com Date: 2007-09-30 08:28:57+00:00 Index: buildbot.texinfo =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/buildbot.texinfo,v retrieving revision 1.122 retrieving revision 1.123 diff -u -d -r1.122 -r1.123 --- buildbot.texinfo 30 Sep 2007 07:14:23 -0000 1.122 +++ buildbot.texinfo 30 Sep 2007 08:30:23 -0000 1.123 @@ -241,7 +241,6 @@ Status Delivery -* HTML Waterfall:: * WebStatus:: * MailNotifier:: * IRC Bot:: @@ -250,8 +249,10 @@ WebStatus +* WebStatus Configuration Parameters:: * Buildbot Web Resources:: * XMLRPC server:: +* HTML Waterfall:: Command-line tool @@ -5909,11 +5910,11 @@ @node Status Delivery, Command-line tool, Build Process, Top @chapter Status Delivery -More details are available in the docstrings for each class, use - at code{pydoc buildbot.status.html.Waterfall} to see them. Most status -delivery objects take a @code{categories=} argument, which can contain -a list of ``category'' names: in this case, it will only show status -for Builders that are in one of the named categories. +More details are available in the docstrings for each class, use a +command like @code{pydoc buildbot.status.html.WebStatus} to see them. +Most status delivery objects take a @code{categories=} argument, which +can contain a list of ``category'' names: in this case, it will only +show status for Builders that are in one of the named categories. (implementor's note: each of these objects should be a service.MultiService which will be attached to the BuildMaster object @@ -5926,7 +5927,6 @@ @file{buildbot/interfaces.py} for full details.) @menu -* HTML Waterfall:: * WebStatus:: * MailNotifier:: * IRC Bot:: @@ -5939,26 +5939,90 @@ @c DOCUMENT THIS - at node HTML Waterfall, WebStatus, Status Delivery, Status Delivery - at section HTML Waterfall - at cindex Waterfall - at stindex buildbot.status.html.Waterfall + at node WebStatus, MailNotifier, Status Delivery, Status Delivery + at section WebStatus + + at cindex WebStatus + at stindex buildbot.status.web.baseweb.WebStatus + +The @code{buildbot.status.html.WebStatus} status target runs a small +web server inside the buildmaster. You can point a browser at this web +server and retrieve information about every build the buildbot knows +about, as well as find out what the buildbot is currently working on. + +The first page you will see is the ``Welcome Page'', which contains +links to all the other useful pages. This page is simply served from +the @file{public_html/index.html} file in the buildmaster's base +directory, where it is created by the @command{buildbot create-master} +command along with the rest of the buildmaster. + +The most complex resource provided by @code{WebStatus} is the +``Waterfall Display'', which shows a time-based chart of events. This +somewhat-busy display provides detailed information about all steps of +all recent builds, and provides hyperlinks to look at individual build +logs and source changes. By simply reloading this page on a regular +basis, you will see a complete description of everything the buildbot +is currently working on. +There are also pages with more specialized information. For example, +there is a page which shows the last 20 builds performed by the +buildbot, one line each. Each line is a link to detailed information +about that build. By adding query arguments to the URL used to reach +this page, you can narrow the display to builds that involved certain +branches, or which ran on certain Builders. These pages are described +in great detail below. + + +When the buildmaster is created, a subdirectory named + at file{public_html/} is created in its base directory. @code{WebStatus} +will serve files from this directory: for example, when a user points +their browser at the buildbot's @code{WebStatus} URL, they will see +the contents of the @file{public_html/index.html} file. Likewise, + at file{public_html/robots.txt}, @file{public_html/buildbot.css}, and + at file{public_html/favicon.ico} are all useful things to have in there. +The first time a buildmaster is created, the @file{public_html} +directory is populated with some sample files, which you will probably +want to customize for your own project. These files are all static: +the buildbot does not modify them in any way as it serves them to HTTP +clients. @example -from buildbot.status import html -w = html.Waterfall(http_port=8080) -c['status'].append(w) +from buildbot.status.html import WebStatus +c['status'].append(WebStatus(8080)) @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 provides a strports specification for the port that the web server -should listen on. This can be a simple port number, or a string like +In addition, if you are familiar with twisted.web @emph{Resource +Trees}, you can write code to add additional pages at places inside +this web space. Just use @code{webstatus.putChild} to place these +resources. + +The following section describes the special URLs and the status views +they provide. + + + at menu +* WebStatus Configuration Parameters:: +* Buildbot Web Resources:: +* XMLRPC server:: +* HTML Waterfall:: + at end menu + + at node WebStatus Configuration Parameters, Buildbot Web Resources, WebStatus, WebStatus + at subsection WebStatus Configuration Parameters + +The most common way to run a @code{WebStatus} is on a regular TCP +port. To do this, just pass in the TCP port number when you create the + at code{WebStatus} instance; this is called the @code{http_port} argument: + + at example +from buildbot.status.html import WebStatus +c['status'].append(WebStatus(8080)) + at end example + +The @code{http_port} argument is actually a ``strports specification'' +for the port that the web server should listen on. This can be a +simple port number, or a string like @code{tcp:8080:interface=127.0.0.1} (to limit connections to the loopback interface, and therefore to clients running on the same host)@footnote{It may even be possible to provide SSL access by using @@ -5986,92 +6050,18 @@ appear at @code{http://host/buildbot/}, and the right virtual host setup can even place it at @code{http://buildbot.host/} . -Other arguments: - - at table @code - at item allowForce -If set to True (the default), then the web page will provide a ``Force -Build'' button that allows visitors to manually trigger builds. This -is useful for developers to re-run builds that have failed because of -intermittent problems in the test suite, or because of libraries that -were not installed at the time of the previous build. You may not wish -to allow strangers to cause a build to run: in that case, set this to -False to remove these buttons. - - at item favicon -If set to a string, this will be interpreted as a filename containing -a ``favicon'': a small image that contains an icon for the web site. -This is returned to browsers that request the @code{favicon.ico} file, -and should point to a .png or .ico image file. The default value uses -the buildbot/buildbot.png image (a small hex nut) contained in the -buildbot distribution. You can set this to None to avoid using a -favicon at all. - - at item robots_txt -If set to a string, this will be interpreted as a filename containing -the contents of ``robots.txt''. Many search engine spiders request -this file before indexing the site. Setting it to a file which -contains: - at example -User-agent: * -Disallow: / - at end example -will prevent most search engines from trawling the (voluminous) -generated status pages. - - at end table - - - at node WebStatus, MailNotifier, HTML Waterfall, Status Delivery - at section WebStatus - - at cindex WebStatus - at stindex buildbot.status.web.baseweb.WebStatus - -The Waterfall object is actually a subset of the views available with -the more generalized @code{WebStatus} target. When you use - at code{WebStatus}, you can put HTML files, CSS stylesheets, robots.txt, -and other resources in a @file{public_html/} directory for use by the -built-in webserver. - -When the buildmaster is created, a subdirectory named - at file{public_html/} is created in its base directory. @code{WebStatus} -will serve files from this directory: for example, when a user points -their browser at the buildbot's @code{WebStatus} URL, they will see -the contents of the @file{public_html/index.html} file. Likewise, - at file{public_html/robots.txt} and @file{public_html/buildbot.css} are -useful things to have in there. The first time a buildmaster is -created, the @file{public_html} directory is populated with some -sample files, which you will probably want to customize for your own -project. - - at example -from buildbot.status.html import WebStatus -c['status'].append(WebStatus(8080)) - at end example - -Certain URL prefixes are handled specially by code within the -buildbot. The pages available in these spaces provide various views into -the buildbot status, each with a different focus. These pages can be -configured further by adding query arguments, for example to restrict -the page to only display certain Builders, or limit it to builds of a -specific branch. - -In addition, if you are familiar with twisted.web @emph{Resource -Trees}, you can write code to add additional pages at places inside -this web space. Just use @code{webstatus.putChild} to place these -resources. - -The following section describes the special URLs and the status views -they provide. +The other @code{WebStatus} argument is @code{allowForce}. If set to +True, then the web page will provide a ``Force Build'' button that +allows visitors to manually trigger builds. This is useful for +developers to re-run builds that have failed because of intermittent +problems in the test suite, or because of libraries that were not +installed at the time of the previous build. You may not wish to allow +strangers to cause a build to run: in that case, set this to False to +remove these buttons. The default value is False. - at menu -* Buildbot Web Resources:: -* XMLRPC server:: - at end menu - at node Buildbot Web Resources, XMLRPC server, WebStatus, WebStatus + at node Buildbot Web Resources, XMLRPC server, WebStatus Configuration Parameters, WebStatus @subsection Buildbot Web Resources Certain URLs are ``magic'', and the pages they serve are created by @@ -6143,11 +6133,11 @@ @file{/changes} for access to information about source code changes, etc. - at item /builders/$BUILDERNAME/ + at item /builders/$BUILDERNAME This describes the given Builder, and provides buttons to force a build. - at item /builders/$BUILDERNAME/builds/$BUILDNUM/ + at item /builders/$BUILDERNAME/builds/$BUILDNUM This describes a specific Build. @@ -6167,6 +6157,22 @@ settings were like. This maybe be useful for saving to disk and feeding to tools like 'grep'. + at item /changes + +This provides a brief description of the ChangeSource in use +(@pxref{Change Sources}). + + at item /changes/NN + +This shows detailed information about the numbered Change: who was the +author, what files were changed, what revision number was represented, +etc. + + at item /buildslaves + +This summarizes each BuildSlave, including which Builders are +configured to use it, whether the buildslave is currently connected or +not, and host information retrieved from the buildslave itself. @item /one_line_per_build @@ -6183,30 +6189,32 @@ restrict the list. In addition, a @code{numbuilds=} argument will control how many lines are displayed (20 by default). - at item /slave_status_timeline + at item /one_box_per_builder -This provides a chronological display of configuration and operational -events: master startup/shutdown, slave connect/disconnect, and -config-file changes. When a config-file reload is abandoned because of -an error in the config file, the error is displayed on this page. +This page shows a small table, with one box for each Builder, +containing the results of the most recent Build. It does not show the +individual steps, or the current status. This is a simple summary of +buildbot status: if this page is green, then all tests are passing. -This page does not show any builds. +As with @code{/one_line_per_build}, this page will also honor + at code{builder=} and @code{branch=} arguments. + at item /about - at item /last_build +This page gives a brief summary of the Buildbot itself: software +version, versions of some libraries that the Buildbot depends upon, +etc. It also contains a link to the buildbot.net home page. -This shows one box per Builder, showing the results of the most recent -complete build. It does not show the individual steps, or the current -status. + at item /slave_status_timeline -There are some options to limit the boxes displayed: +(note: this page has not yet been implemented) - at itemize @bullet - at item -branches: only show builds of specific branches - at item only show specific builders - at end itemize +This provides a chronological display of configuration and operational +events: master startup/shutdown, slave connect/disconnect, and +config-file changes. When a config-file reload is abandoned because of +an error in the config file, the error is displayed on this page. +This page does not show any builds. @item /last_build/$BUILDERNAME/status.png @@ -6229,7 +6237,7 @@ @end table - at node XMLRPC server, , Buildbot Web Resources, WebStatus + at node XMLRPC server, HTML Waterfall, Buildbot Web Resources, WebStatus @subsection XMLRPC server When using WebStatus, the buildbot runs an XML-RPC server at @@ -6238,9 +6246,56 @@ using this interface. @table @code + at item getAllBuildsInInterval(start, stop) + +Return a list of builds that have completed after the 'start' +timestamp and before the 'stop' timestamp. This looks at all Builders. + +The timestamps are integers, interpreted as standard unix timestamps +(seconds since epoch). + +Each Build is returned as a tuple in the form: @code{(buildername, +buildnumber, build_end, branchname, revision, results, text)} + +The buildnumber is an integer. 'build_end' is an integer (seconds +since epoch) specifying when the build finished. + +The branchname is a string, which may be an empty string to indicate +None (i.e. the default branch). The revision is a string whose meaning +is specific to the VC system in use, and comes from the 'got_revision' +build property. The results are expressed as a string, one of +('success', 'warnings', 'failure', 'exception'). The text is a list of +short strings that ought to be joined by spaces and include slightly +more data about the results of the build. + + at item getBuild(builder_name, build_number) + +Return information about a specific build. + +This returns a dictionary (aka ``struct'' in XMLRPC terms) with +complete information about the build. It does not include the contents +of the log files, but it has just about everything else. @end table + at node HTML Waterfall, , XMLRPC server, WebStatus + at subsection HTML Waterfall + + at cindex Waterfall + at stindex buildbot.status.html.Waterfall + +The @code{Waterfall} status target, deprecated as of 0.7.6, is a +subset of the regular @code{WebStatus} resource (@pxref{WebStatus}). +This section (and the @code{Waterfall} class itself) will be removed +from a future release. + + at example +from buildbot.status import html +w = html.Waterfall(http_port=8080) +c['status'].append(w) + at end example + + @node MailNotifier, IRC Bot, WebStatus, Status Delivery @section MailNotifier From warner at users.sourceforge.net Sun Sep 30 09:23:59 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 09:23:59 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web base.py, 1.14, 1.15 baseweb.py, 1.25, 1.26 builder.py, 1.10, 1.11 classic.css, 1.1, 1.2 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2518/buildbot/status/web Modified Files: base.py baseweb.py builder.py classic.css Log Message: [project @ web: refactor OneLineMixin, add some CSS] Original author: warner at lothar.com Date: 2007-09-30 08:57:37+00:00 Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/base.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- base.py 30 Sep 2007 01:53:22 -0000 1.14 +++ base.py 30 Sep 2007 09:23:57 -0000 1.15 @@ -1,5 +1,5 @@ -import urlparse, urllib +import urlparse, urllib, time from zope.interface import Interface from twisted.web import html, resource from buildbot.status import builder @@ -294,3 +294,42 @@ if age < 2*MONTH: return "about %s ago" % plural("week", "weeks", age / WEEK) return "a long time ago" + + +class OneLineMixin: + LINE_TIME_FORMAT = "%b %d %H:%M" + + def make_line(self, req, build, include_builder=True): + builder_name = build.getBuilder().getName() + results = build.getResults() + try: + rev = build.getProperty("got_revision") + if rev is None: + rev = "??" + except KeyError: + rev = "??" + if len(rev) > 20: + rev = "version is too-long" + root = self.path_to_root(req) + values = {'class': css_classes[results], + 'builder_name': builder_name, + 'buildnum': build.getNumber(), + 'results': css_classes[results], + 'buildurl': (root + + "builders/%s/builds/%d" % (builder_name, + build.getNumber())), + 'builderurl': (root + "builders/%s" % builder_name), + 'rev': rev, + 'time': time.strftime(self.LINE_TIME_FORMAT, + time.localtime(build.getTimes()[0])), + } + + fmt_pieces = ['(%(time)s)', + 'rev=[%(rev)s]', + '%(results)s', + ] + if include_builder: + fmt_pieces.append('%(builder_name)s') + fmt_pieces.append('#%(buildnum)d:') + data = " ".join(fmt_pieces) % values + return data Index: baseweb.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/baseweb.py,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- baseweb.py 30 Sep 2007 01:53:22 -0000 1.25 +++ baseweb.py 30 Sep 2007 09:23:57 -0000 1.26 @@ -1,5 +1,5 @@ -import os, sys, time, urllib, weakref +import os, sys, urllib, weakref from itertools import count from zope.interface import implements @@ -10,7 +10,8 @@ from buildbot.interfaces import IControl, IStatusReceiver -from buildbot.status.web.base import HtmlResource, css_classes, Box, build_get_class, ICurrentBox +from buildbot.status.web.base import HtmlResource, Box, \ + build_get_class, ICurrentBox, OneLineMixin from buildbot.status.web.waterfall import WaterfallStatusResource from buildbot.status.web.changes import ChangesResource from buildbot.status.web.builder import BuildersResource @@ -64,43 +65,6 @@ return [e[2] for e in events[-numbuilds:]] -class OneLineMixin: - LINE_TIME_FORMAT = "%b %d %H:%M" - - def make_line(self, req, build): - builder_name = build.getBuilder().getName() - results = build.getResults() - try: - rev = build.getProperty("got_revision") - if rev is None: - rev = "??" - except KeyError: - rev = "??" - if len(rev) > 20: - rev = "version is too-long" - root = self.path_to_root(req) - values = {'class': css_classes[results], - 'builder_name': builder_name, - 'buildnum': build.getNumber(), - 'results': css_classes[results], - 'buildurl': (root + - "builders/%s/builds/%d" % (builder_name, - build.getNumber())), - 'builderurl': (root + "builders/%s" % builder_name), - 'rev': rev, - 'time': time.strftime(self.LINE_TIME_FORMAT, - time.localtime(build.getTimes()[0])), - } - - fmt = ('(%(time)s) ' - '%(builder_name)s ' - 'rev=[%(rev)s] ' - '#%(buildnum)d: ' - '%(results)s ' - ) - data = fmt % values - return data - # /one_line_per_build # accepts builder=, branch=, numbuilds= class OneLinePerBuild(HtmlResource, OneLineMixin): @@ -134,7 +98,8 @@ data = "" # really this is "up to %d builds" - data += "

          Last %d finished builds

          \n" % numbuilds + data += "

          Last %d finished builds: %s

          \n" % \ + (numbuilds, " ".join(branches)) if builders: data += ("

          of builders: %s

          \n" % (", ".join(builders))) data += "
            \n" @@ -204,12 +169,12 @@ data = "" - data += "

            Latest builds

            \n" + data += "

            Latest builds: %s

            \n" % " ".join(branches) data += "
          %s
          \n" for bn in builders: builder = status.getBuilder(bn) data += "\n" - data += "\n" % html.escape(bn) + data += '\n' % html.escape(bn) builds = list(builder.generateFinishedBuilds(branches, num_builds=1)) if builds: @@ -227,10 +192,10 @@ text = ['%s' % (url, label)] text.extend(b.getText()) box = Box(text, b.getColor(), - class_="LastBuild %s" % build_get_class(b)) + class_="LastBuild box %s" % build_get_class(b)) data += box.td(align="center") else: - data += "\n" + data += '\n' current_box = ICurrentBox(builder).getBox(status) data += current_box.td(align="center") data += "
          %s%sno build
          \n" Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/builder.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- builder.py 28 Sep 2007 09:33:31 -0000 1.10 +++ builder.py 30 Sep 2007 09:23:57 -0000 1.11 @@ -6,14 +6,14 @@ import re, urllib, time from twisted.python import log from buildbot import interfaces -from buildbot.status.web.base import HtmlResource, make_row, css_classes +from buildbot.status.web.base import HtmlResource, make_row, OneLineMixin from buildbot.process.base import BuildRequest from buildbot.sourcestamp import SourceStamp from buildbot.status.web.build import BuildsResource # /builders/$builder -class StatusResourceBuilder(HtmlResource): +class StatusResourceBuilder(HtmlResource, OneLineMixin): addSlash = True def __init__(self, builder_status, builder_control): @@ -36,15 +36,6 @@ data += "[%s]" % build.getCurrentStep().getName() return data - def build_finished_line(self, build, req): - buildnum = build.getNumber() - buildurl = req.childLink("builds/%d" % buildnum) - results = build.getResults() - text = " ".join(build.getText()) - data = '#%d ' % (buildurl, buildnum) - data += '%s' % (css_classes[results], text) - return data - def body(self, req): b = self.builder_status control = self.builder_control @@ -77,7 +68,7 @@ data += "

          Recent Builds:

          \n" data += "
            \n" for i,build in enumerate(b.generateFinishedBuilds(num_builds=5)): - data += "
          • " + self.build_finished_line(build, req) + "
          • \n" + data += "
          • " + self.make_line(req, build, False) + "
          • \n" if i == 0: data += "
            \n" # separator # TODO: or empty list? Index: classic.css =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/classic.css,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- classic.css 27 Feb 2007 23:07:16 -0000 1.1 +++ classic.css 30 Sep 2007 09:23:57 -0000 1.2 @@ -7,6 +7,10 @@ border-right: 1px solid; } +td.box { + border: 1px solid; +} + /* Activity states */ .offline { background-color: red; From warner at users.sourceforge.net Sun Sep 30 09:23:59 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 09:23:59 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.951,1.952 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2518 Modified Files: ChangeLog Log Message: [project @ web: refactor OneLineMixin, add some CSS] Original author: warner at lothar.com Date: 2007-09-30 08:57:37+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.951 retrieving revision 1.952 diff -u -d -r1.951 -r1.952 --- ChangeLog 30 Sep 2007 08:30:22 -0000 1.951 +++ ChangeLog 30 Sep 2007 09:23:57 -0000 1.952 @@ -1,5 +1,13 @@ 2007-09-30 Brian Warner + * buildbot/status/web/base.py (OneLineMixin): refactor, move this + from builder.py, use it on the Builder page too + * buildbot/status/web/builder.py (StatusResourceBuilder): same + * buildbot/status/web/baseweb.py (OneLinePerBuild): display branch + names, add some CSS classes + * buildbot/status/web/classic.css (td.box): new class, for + OneBoxPerBuild + * docs/buildbot.texinfo (WebStatus): update docs * buildbot/slave/commands.py (SVN.parseGotRevision._parse): remove From warner at users.sourceforge.net Sun Sep 30 09:24:05 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 09:24:05 +0000 Subject: [Buildbot-commits] buildbot/docs buildbot.texinfo,1.123,1.124 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2538/docs Modified Files: buildbot.texinfo Log Message: [project @ web: handle branch=trunk usefully] Original author: warner at lothar.com Date: 2007-09-30 09:23:10+00:00 Index: buildbot.texinfo =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/buildbot.texinfo,v retrieving revision 1.123 retrieving revision 1.124 diff -u -d -r1.123 -r1.124 --- buildbot.texinfo 30 Sep 2007 08:30:23 -0000 1.123 +++ buildbot.texinfo 30 Sep 2007 09:24:03 -0000 1.124 @@ -6083,16 +6083,13 @@ The @code{branch=} query argument can be used on some pages. This filters the information displayed by that page down to only the builds -or changes which involved the given branch. Multiple @code{branch=} -arguments can be used to examine multiple branches at once (so -appending @code{?branch=foo&branch=bar} to the URL will show builds -involving either branch). No @code{branch=} arguments means to show -builds and changes for all branches. - -Note that branch-handling still needs to be cleaned up: in particular -there is currently no way to refer to the default (or ``trunk'') -branch using @code{branch=} arguments. This will be improved in a -future release. +or changes which involved the given branch. Use @code{branch=trunk} to +reference the trunk: if you aren't intentionally using branches, +you're probably using trunk. Multiple @code{branch=} arguments can be +used to examine multiple branches at once (so appending + at code{?branch=foo&branch=bar} to the URL will show builds involving +either branch). No @code{branch=} arguments means to show builds and +changes for all branches. Some pages may include the Builder name or the build number in the main part of the URL itself. For example, a page that describes Build From warner at users.sourceforge.net Sun Sep 30 09:24:05 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 09:24:05 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web base.py, 1.15, 1.16 baseweb.py, 1.26, 1.27 waterfall.py, 1.22, 1.23 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2538/buildbot/status/web Modified Files: base.py baseweb.py waterfall.py Log Message: [project @ web: handle branch=trunk usefully] Original author: warner at lothar.com Date: 2007-09-30 09:23:10+00:00 Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/base.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- base.py 30 Sep 2007 09:23:57 -0000 1.15 +++ base.py 30 Sep 2007 09:24:03 -0000 1.16 @@ -333,3 +333,10 @@ fmt_pieces.append('#%(buildnum)d:') data = " ".join(fmt_pieces) % values return data + +def map_branches(branches): + # when the query args say "trunk", present that to things like + # IBuilderStatus.generateFinishedBuilds as None, since that's the + # convention in use. In the long run we should clean this up better, + # maybe with Branch objects or something. + return [b != "trunk" and b or None for b in branches] Index: baseweb.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/baseweb.py,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- baseweb.py 30 Sep 2007 09:23:57 -0000 1.26 +++ baseweb.py 30 Sep 2007 09:24:03 -0000 1.27 @@ -11,7 +11,7 @@ from buildbot.interfaces import IControl, IStatusReceiver from buildbot.status.web.base import HtmlResource, Box, \ - build_get_class, ICurrentBox, OneLineMixin + build_get_class, ICurrentBox, OneLineMixin, map_branches from buildbot.status.web.waterfall import WaterfallStatusResource from buildbot.status.web.changes import ChangesResource from buildbot.status.web.builder import BuildersResource @@ -93,13 +93,14 @@ builders = req.args.get("builder", []) branches = [b for b in req.args.get("branch", []) if b] - g = status.generateFinishedBuilds(builders, branches, numbuilds) + g = status.generateFinishedBuilds(builders, map_branches(branches), + numbuilds) data = "" # really this is "up to %d builds" data += "

            Last %d finished builds: %s

            \n" % \ - (numbuilds, " ".join(branches)) + (numbuilds, ", ".join(branches)) if builders: data += ("

            of builders: %s

            \n" % (", ".join(builders))) data += "
              \n" @@ -131,11 +132,12 @@ branches = [b for b in req.args.get("branch", []) if b] # walk backwards through all builds of a single builder - g = self.builder.generateFinishedBuilds(branches, numbuilds) + g = self.builder.generateFinishedBuilds(map_branches(branches), + numbuilds) data = "" - data += ("

              Last %d builds of builder: %s

              \n" % - (numbuilds, self.builder_name)) + data += ("

              Last %d builds of builder %s: %s

              \n" % + (numbuilds, self.builder_name, ", ".join(branches))) data += "
                \n" got = 0 for build in g: @@ -169,13 +171,13 @@ data = "" - data += "

                Latest builds: %s

                \n" % " ".join(branches) + data += "

                Latest builds: %s

                \n" % ", ".join(branches) data += "\n" for bn in builders: builder = status.getBuilder(bn) data += "\n" data += '\n' % html.escape(bn) - builds = list(builder.generateFinishedBuilds(branches, + builds = list(builder.generateFinishedBuilds(map_branches(branches), num_builds=1)) if builds: b = builds[0] Index: waterfall.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/waterfall.py,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- waterfall.py 28 Sep 2007 09:33:40 -0000 1.22 +++ waterfall.py 30 Sep 2007 09:24:03 -0000 1.23 @@ -12,7 +12,7 @@ from buildbot.status import builder from buildbot.status.web.base import Box, HtmlResource, IBox, ICurrentBox, \ - ITopBox, td, build_get_class, path_to_build, path_to_step + ITopBox, td, build_get_class, path_to_build, path_to_step, map_branches @@ -100,8 +100,9 @@ def getBox(self, req): assert interfaces.IBuilderStatus(self.original) branches = [b for b in req.args.get("branch", []) if b] - builds = list(self.original.generateFinishedBuilds(branches, - num_builds=1)) + builder = self.original + builds = list(builder.generateFinishedBuilds(map_branches(branches), + num_builds=1)) if not builds: return Box(["none"], "white", class_="LastBuild") b = builds[0] @@ -638,6 +639,7 @@ if request.args.get("show_events", ["true"])[0].lower() == "true": showEvents = True filterBranches = [b for b in request.args.get("branch", []) if b] + filterBranches = map_branches(filterBranches) maxTime = int(request.args.get("last_time", [util.now()])[0]) if "show_time" in request.args: minTime = maxTime - int(request.args["show_time"][0]) From warner at users.sourceforge.net Sun Sep 30 09:24:05 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 09:24:05 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.952,1.953 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2538 Modified Files: ChangeLog Log Message: [project @ web: handle branch=trunk usefully] Original author: warner at lothar.com Date: 2007-09-30 09:23:10+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.952 retrieving revision 1.953 diff -u -d -r1.952 -r1.953 --- ChangeLog 30 Sep 2007 09:23:57 -0000 1.952 +++ ChangeLog 30 Sep 2007 09:24:03 -0000 1.953 @@ -1,7 +1,21 @@ 2007-09-30 Brian Warner + * buildbot/status/web/base.py (map_branches): when referring to + branches through WebStatus (i.e. by appending ?branch=FOO query + arguments to the URL), make "trunk" mean trunk, by mapping it to + None before passing it to generateFinishedBuilds() and the like. + * buildbot/status/web/baseweb.py (OneLinePerBuild.body): same + (OneBoxPerBuilder.body): same, also improve display of branches in + the HTML a bit + * buildbot/status/web/waterfall.py (BuildTopBox.getBox): same + (WaterfallStatusResource.buildGrid): same. Note that this filters + Changes as well as Builds. + * docs/buildbot.texinfo (Buildbot Web Resources): remove the + caveat about trunk branches, now that it's fixed + * buildbot/status/web/base.py (OneLineMixin): refactor, move this from builder.py, use it on the Builder page too + * buildbot/status/web/builder.py (StatusResourceBuilder): same * buildbot/status/web/baseweb.py (OneLinePerBuild): display branch names, add some CSS classes From warner at users.sourceforge.net Sun Sep 30 18:03:16 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 18:03:16 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts runner.py,1.58,1.59 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32672/buildbot/scripts Modified Files: runner.py Log Message: [project @ upgrade-master: add basedir to sys.path, for helper classes] Original author: warner at lothar.com Date: 2007-09-30 18:02:47+00:00 Index: runner.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- runner.py 30 Sep 2007 07:14:22 -0000 1.58 +++ runner.py 30 Sep 2007 18:03:14 -0000 1.59 @@ -229,6 +229,14 @@ # $BUILDERNAME/builder pickle might be created (with a single # "builder created" event). + # we put basedir in front of sys.path, because that's how the + # buildmaster itself will run, and it is quite common to have the + # buildmaster import helper classes from other .py files in its + # basedir. + + if sys.path[0] != self.basedir: + sys.path.insert(0, self.basedir) + m = BuildMaster(self.basedir) # we need to route log.msg to stdout, so any problems can be seen # there. But if everything goes well, I'd rather not clutter stdout From warner at users.sourceforge.net Sun Sep 30 18:03:16 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 18:03:16 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.953,1.954 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32672 Modified Files: ChangeLog Log Message: [project @ upgrade-master: add basedir to sys.path, for helper classes] Original author: warner at lothar.com Date: 2007-09-30 18:02:47+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.953 retrieving revision 1.954 diff -u -d -r1.953 -r1.954 --- ChangeLog 30 Sep 2007 09:24:03 -0000 1.953 +++ ChangeLog 30 Sep 2007 18:03:14 -0000 1.954 @@ -1,5 +1,11 @@ 2007-09-30 Brian Warner + * buildbot/scripts/runner.py (Maker.check_master_cfg): prepend + basedir to sys.path, to mimic what a real buildmaster would have + access to, since it is common for master.cfg to import helper + classes from .py files in the buildmaster directory, and we want + config-file checking to accomodate this. + * buildbot/status/web/base.py (map_branches): when referring to branches through WebStatus (i.e. by appending ?branch=FOO query arguments to the URL), make "trunk" mean trunk, by mapping it to From warner at users.sourceforge.net Sun Sep 30 18:20:58 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 18:20:58 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.954,1.955 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6879 Modified Files: ChangeLog Log Message: [project @ web: stringify got_revision before use, SVN still provides an int] Original author: warner at lothar.com Date: 2007-09-30 18:20:26+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.954 retrieving revision 1.955 diff -u -d -r1.954 -r1.955 --- ChangeLog 30 Sep 2007 18:03:14 -0000 1.954 +++ ChangeLog 30 Sep 2007 18:20:56 -0000 1.955 @@ -1,5 +1,13 @@ 2007-09-30 Brian Warner + * buildbot/status/web/base.py (OneLineMixin.make_line): stringify + our got_revision before checking its length: SVN (at least) still + reports numeric values for this. + * buildbot/status/web/build.py (StatusResourceBuild.body): same + * buildbot/status/web/xmlrpc.py + (XMLRPCServer.xmlrpc_getAllBuildsInInterval): same, also stop + serving a completely fake revision + * buildbot/scripts/runner.py (Maker.check_master_cfg): prepend basedir to sys.path, to mimic what a real buildmaster would have access to, since it is common for master.cfg to import helper From warner at users.sourceforge.net Sun Sep 30 18:20:58 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 18:20:58 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web base.py, 1.16, 1.17 build.py, 1.12, 1.13 xmlrpc.py, 1.1, 1.2 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6879/buildbot/status/web Modified Files: base.py build.py xmlrpc.py Log Message: [project @ web: stringify got_revision before use, SVN still provides an int] Original author: warner at lothar.com Date: 2007-09-30 18:20:26+00:00 Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/base.py,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- base.py 30 Sep 2007 09:24:03 -0000 1.16 +++ base.py 30 Sep 2007 18:20:56 -0000 1.17 @@ -308,6 +308,7 @@ rev = "??" except KeyError: rev = "??" + rev = str(rev) if len(rev) > 20: rev = "version is too-long" root = self.path_to_root(req) Index: build.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/build.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- build.py 28 Sep 2007 09:33:31 -0000 1.12 +++ build.py 30 Sep 2007 18:20:56 -0000 1.13 @@ -90,6 +90,7 @@ except KeyError: pass if got_revision: + got_revision = str(got_revision) if len(got_revision) > 40: got_revision = "[revision string too long]" data += "
              • Got Revision: %s
              • \n" % got_revision Index: xmlrpc.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/xmlrpc.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- xmlrpc.py 12 Aug 2007 18:34:43 -0000 1.1 +++ xmlrpc.py 30 Sep 2007 18:20:56 -0000 1.2 @@ -69,7 +69,7 @@ revision = build.getProperty("got_revision") except KeyError: revision = "" - revision = "fake-rev" + revision = str(revision) answer = (builder_name, build.getNumber(), From warner at users.sourceforge.net Sun Sep 30 18:48:14 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 18:48:14 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.955,1.956 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17815 Modified Files: ChangeLog Log Message: [project @ limit the number of builds we examine in generateFinishedBuilds] Original author: warner at lothar.com Date: 2007-09-30 18:47:26+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.955 retrieving revision 1.956 diff -u -d -r1.955 -r1.956 --- ChangeLog 30 Sep 2007 18:20:56 -0000 1.955 +++ ChangeLog 30 Sep 2007 18:48:12 -0000 1.956 @@ -1,5 +1,14 @@ 2007-09-30 Brian Warner + * buildbot/interfaces.py (IStatus.generateFinishedBuilds): add a + 'max_search=' argument, to limit the number of builds that are + examined while trying to find ones that match the other criteria. + This helps to limit the work we do, since otherwise we might have + to trawl through all history. + (IBuilderStatus.generateFinishedBuilds): same + * buildbot/status/builder.py (Status.generateFinishedBuilds): same + (BuilderStatus.generateFinishedBuilds): same + * buildbot/status/web/base.py (OneLineMixin.make_line): stringify our got_revision before checking its length: SVN (at least) still reports numeric values for this. From warner at users.sourceforge.net Sun Sep 30 18:48:15 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 18:48:15 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status builder.py, 1.102, 1.103 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17815/buildbot/status Modified Files: builder.py Log Message: [project @ limit the number of builds we examine in generateFinishedBuilds] Original author: warner at lothar.com Date: 2007-09-30 18:47:26+00:00 Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v retrieving revision 1.102 retrieving revision 1.103 diff -u -d -r1.102 -r1.103 --- builder.py 12 Aug 2007 22:22:51 -0000 1.102 +++ builder.py 30 Sep 2007 18:48:13 -0000 1.103 @@ -1469,11 +1469,14 @@ def generateFinishedBuilds(self, branches=[], num_builds=None, max_buildnum=None, - finished_before=None): + finished_before=None, + max_search=200): got = 0 for Nb in itertools.count(1): if Nb > self.nextBuildNumber: break + if Nb > max_search: + break build = self.getBuild(-Nb) if build is None: continue @@ -1881,7 +1884,8 @@ return self.activeBuildSets[:] def generateFinishedBuilds(self, builders=[], branches=[], - num_builds=None, finished_before=None): + num_builds=None, finished_before=None, + max_search=200): def want_builder(bn): if builders: @@ -1898,7 +1902,8 @@ for bn in builder_names: b = self.getBuilder(bn) g = b.generateFinishedBuilds(branches, - finished_before=finished_before) + finished_before=finished_before, + max_search=max_search) sources.append(g) # next_build the next build from each source From warner at users.sourceforge.net Sun Sep 30 18:48:15 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 18:48:15 +0000 Subject: [Buildbot-commits] buildbot/buildbot interfaces.py,1.63,1.64 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17815/buildbot Modified Files: interfaces.py Log Message: [project @ limit the number of builds we examine in generateFinishedBuilds] Original author: warner at lothar.com Date: 2007-09-30 18:47:26+00:00 Index: interfaces.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/interfaces.py,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- interfaces.py 12 Aug 2007 23:17:12 -0000 1.63 +++ interfaces.py 30 Sep 2007 18:48:12 -0000 1.64 @@ -159,7 +159,8 @@ """Return a list of active (non-finished) IBuildSetStatus objects.""" def generateFinishedBuilds(builders=[], branches=[], - num_builds=None, finished_before=None): + num_builds=None, finished_before=None, + max_search=200): """Return a generator that will produce IBuildStatus objects each time you invoke its .next() method, starting with the most recent finished build and working backwards. @@ -181,6 +182,14 @@ @type finished_before: int: a timestamp, seconds since the epoch @param finished_before: if provided, do not produce any builds that finished after the given timestamp. + + @type max_search: int + @param max_search: this method may have to examine a lot of builds + to find some that match the search parameters, + especially if there aren't any matching builds. + This argument imposes a hard limit on the number + of builds that will be examined within any given + Builder. """ def subscribe(receiver): @@ -348,7 +357,8 @@ def generateFinishedBuilds(branches=[], num_builds=None, - max_buildnum=None, finished_before=None + max_buildnum=None, finished_before=None, + max_search=200, ): """Return a generator that will produce IBuildStatus objects each time you invoke its .next() method, starting with the most recent @@ -378,6 +388,13 @@ @type finished_before: int: a timestamp, seconds since the epoch @param finished_before: if provided, do not produce any builds that finished after the given timestamp. + + @type max_search: int + @param max_search: this method may have to examine a lot of builds + to find some that match the search parameters, + especially if there aren't any matching builds. + This argument imposes a hard limit on the number + of builds that will be examined. """ def subscribe(receiver): From warner at users.sourceforge.net Sun Sep 30 19:00:39 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 19:00:39 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.956,1.957 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22614 Modified Files: ChangeLog Log Message: [project @ web.OneLineMixin: add build's getText to each line] Original author: warner at lothar.com Date: 2007-09-30 18:59:21+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.956 retrieving revision 1.957 diff -u -d -r1.956 -r1.957 --- ChangeLog 30 Sep 2007 18:48:12 -0000 1.956 +++ ChangeLog 30 Sep 2007 19:00:37 -0000 1.957 @@ -1,5 +1,9 @@ 2007-09-30 Brian Warner + * buildbot/status/web/base.py (OneLineMixin.make_line): add the + build's text to the end of the line, without a CSS class so it + remains uncolored. + * buildbot/interfaces.py (IStatus.generateFinishedBuilds): add a 'max_search=' argument, to limit the number of builds that are examined while trying to find ones that match the other criteria. From warner at users.sourceforge.net Sun Sep 30 19:00:39 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 19:00:39 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web base.py,1.17,1.18 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22614/buildbot/status/web Modified Files: base.py Log Message: [project @ web.OneLineMixin: add build's getText to each line] Original author: warner at lothar.com Date: 2007-09-30 18:59:21+00:00 Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/base.py,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- base.py 30 Sep 2007 18:20:56 -0000 1.17 +++ base.py 30 Sep 2007 19:00:37 -0000 1.18 @@ -302,6 +302,7 @@ def make_line(self, req, build, include_builder=True): builder_name = build.getBuilder().getName() results = build.getResults() + text = build.getText() try: rev = build.getProperty("got_revision") if rev is None: @@ -316,6 +317,7 @@ 'builder_name': builder_name, 'buildnum': build.getNumber(), 'results': css_classes[results], + 'text': " ".join(build.getText()), 'buildurl': (root + "builders/%s/builds/%d" % (builder_name, build.getNumber())), @@ -332,6 +334,7 @@ if include_builder: fmt_pieces.append('%(builder_name)s') fmt_pieces.append('#%(buildnum)d:') + fmt_pieces.append('%(text)s') data = " ".join(fmt_pieces) % values return data From warner at users.sourceforge.net Sun Sep 30 19:06:26 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 19:06:26 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web waterfall.py, 1.23, 1.24 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24953/buildbot/status/web Modified Files: waterfall.py Log Message: [project @ waterfall: make the welcome link point at index.html, so users of the old Waterfall can reach it] Original author: warner at lothar.com Date: 2007-09-30 19:06:01+00:00 Index: waterfall.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/waterfall.py,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- waterfall.py 30 Sep 2007 09:24:03 -0000 1.23 +++ waterfall.py 30 Sep 2007 19:06:24 -0000 1.24 @@ -559,7 +559,7 @@ helppage = with_args(request, new_path=helpurl) data += '[help]\n' % helppage - welcomeurl = self.path_to_root(request) + "." + welcomeurl = self.path_to_root(request) + "index.html" data += '[welcome]\n' % welcomeurl if self.get_reload_time(request) is not None: From warner at users.sourceforge.net Sun Sep 30 19:06:26 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 19:06:26 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.957,1.958 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24953 Modified Files: ChangeLog Log Message: [project @ waterfall: make the welcome link point at index.html, so users of the old Waterfall can reach it] Original author: warner at lothar.com Date: 2007-09-30 19:06:01+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.957 retrieving revision 1.958 diff -u -d -r1.957 -r1.958 --- ChangeLog 30 Sep 2007 19:00:37 -0000 1.957 +++ ChangeLog 30 Sep 2007 19:06:24 -0000 1.958 @@ -1,5 +1,10 @@ 2007-09-30 Brian Warner + * buildbot/status/web/waterfall.py (WaterfallStatusResource): + point the 'welcome' link explicitly at index.html, rather than + '.', so that old Waterfall users can reach it and discover all the + new pages. + * buildbot/status/web/base.py (OneLineMixin.make_line): add the build's text to the end of the line, without a CSS class so it remains uncolored. From warner at users.sourceforge.net Sun Sep 30 19:12:50 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 19:12:50 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web base.py,1.18,1.19 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27398/buildbot/status/web Modified Files: base.py Log Message: [project @ web map_branches: map 'trunk' to ['trunk',None], since some VC systems really do use 'trunk'] Original author: warner at lothar.com Date: 2007-09-30 19:12:11+00:00 Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/base.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- base.py 30 Sep 2007 19:00:37 -0000 1.18 +++ base.py 30 Sep 2007 19:12:48 -0000 1.19 @@ -341,6 +341,9 @@ def map_branches(branches): # when the query args say "trunk", present that to things like # IBuilderStatus.generateFinishedBuilds as None, since that's the - # convention in use. In the long run we should clean this up better, + # convention in use. But also include 'trunk', because some VC systems + # refer to it that way. In the long run we should clean this up better, # maybe with Branch objects or something. - return [b != "trunk" and b or None for b in branches] + if "trunk" in branches: + return branches + [None] + return branches From warner at users.sourceforge.net Sun Sep 30 19:12:50 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 19:12:50 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.958,1.959 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27398 Modified Files: ChangeLog Log Message: [project @ web map_branches: map 'trunk' to ['trunk',None], since some VC systems really do use 'trunk'] Original author: warner at lothar.com Date: 2007-09-30 19:12:11+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.958 retrieving revision 1.959 diff -u -d -r1.958 -r1.959 --- ChangeLog 30 Sep 2007 19:06:24 -0000 1.958 +++ ChangeLog 30 Sep 2007 19:12:47 -0000 1.959 @@ -1,5 +1,9 @@ 2007-09-30 Brian Warner + * buildbot/status/web/base.py (map_branches): when we see 'trunk', + include both 'trunk' and None in the output list, since some VC + systems (SVN, frequently) refer to trunk as 'trunk'. + * buildbot/status/web/waterfall.py (WaterfallStatusResource): point the 'welcome' link explicitly at index.html, rather than '.', so that old Waterfall users can reach it and discover all the From warner at users.sourceforge.net Sun Sep 30 19:42:26 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 19:42:26 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.959,1.960 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6673 Modified Files: ChangeLog Log Message: [project @ update robots.txt, document it a bit better] Original author: warner at lothar.com Date: 2007-09-30 19:41:34+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.959 retrieving revision 1.960 diff -u -d -r1.959 -r1.960 --- ChangeLog 30 Sep 2007 19:12:47 -0000 1.959 +++ ChangeLog 30 Sep 2007 19:42:24 -0000 1.960 @@ -1,5 +1,9 @@ 2007-09-30 Brian Warner + * docs/buildbot.texinfo (WebStatus): explain robots.txt a bit more + * buildbot/status/web/robots.txt (Disallow): update to cover all + dynamically-generated pages + * buildbot/status/web/base.py (map_branches): when we see 'trunk', include both 'trunk' and None in the output list, since some VC systems (SVN, frequently) refer to trunk as 'trunk'. From warner at users.sourceforge.net Sun Sep 30 19:42:26 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 19:42:26 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web robots.txt, 1.1, 1.2 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6673/buildbot/status/web Modified Files: robots.txt Log Message: [project @ update robots.txt, document it a bit better] Original author: warner at lothar.com Date: 2007-09-30 19:41:34+00:00 Index: robots.txt =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/robots.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- robots.txt 13 Aug 2007 17:22:43 -0000 1.1 +++ robots.txt 30 Sep 2007 19:42:24 -0000 1.2 @@ -2,6 +2,8 @@ Disallow: /waterfall Disallow: /builders Disallow: /changes -Disallow: /schedulers Disallow: /buildslaves +Disallow: /schedulers Disallow: /one_line_per_build +Disallow: /one_box_per_builder +Disallow: /xmlrpc From warner at users.sourceforge.net Sun Sep 30 19:42:27 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 19:42:27 +0000 Subject: [Buildbot-commits] buildbot/docs buildbot.texinfo,1.124,1.125 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6673/docs Modified Files: buildbot.texinfo Log Message: [project @ update robots.txt, document it a bit better] Original author: warner at lothar.com Date: 2007-09-30 19:41:34+00:00 Index: buildbot.texinfo =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/buildbot.texinfo,v retrieving revision 1.124 retrieving revision 1.125 diff -u -d -r1.124 -r1.125 --- buildbot.texinfo 30 Sep 2007 09:24:03 -0000 1.124 +++ buildbot.texinfo 30 Sep 2007 19:42:24 -0000 1.125 @@ -5992,6 +5992,14 @@ c['status'].append(WebStatus(8080)) @end example +Note that the initial robots.txt file has Disallow lines for all of +the dynamically-generated buildbot pages, to discourage web spiders +and search engines from consuming a lot of CPU time as they crawl +through the entire history of your buildbot. If you are running the +buildbot behind a reverse proxy, you'll probably need to put the +robots.txt file somewhere else (at the top level of the parent web +server), and replace the URL prefixes in it with more suitable values. + In addition, if you are familiar with twisted.web @emph{Resource Trees}, you can write code to add additional pages at places inside this web space. Just use @code{webstatus.putChild} to place these From warner at users.sourceforge.net Sun Sep 30 19:52:47 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 19:52:47 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.960,1.961 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10604 Modified Files: ChangeLog Log Message: [project @ Waterfall: defer to public_html/buildbot.css, to fix CSS breakage] Original author: warner at lothar.com Date: 2007-09-30 19:52:19+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.960 retrieving revision 1.961 diff -u -d -r1.960 -r1.961 --- ChangeLog 30 Sep 2007 19:42:24 -0000 1.960 +++ ChangeLog 30 Sep 2007 19:52:45 -0000 1.961 @@ -1,5 +1,17 @@ 2007-09-30 Brian Warner + * buildbot/status/web/baseweb.py (Waterfall.__init__): if an old + Waterfall is running in an upgraded master (which is the usual + case for folks who have followed the instructions to run + 'upgrade-master' but who have not yet resolved all the + DeprecationWarnings), prefer the buildbot.css from public_html/ + rather than the one passed in on the buildbot= argument. + Otherwise, the resulting pages don't quite use CSS right.. + sometimes it works, sometimes it doesn't, and I don't know why. + Sites that are using custom CSS will see the default CSS until + they modify public_html/buildbot.css to include their + customizations. + * docs/buildbot.texinfo (WebStatus): explain robots.txt a bit more * buildbot/status/web/robots.txt (Disallow): update to cover all dynamically-generated pages From warner at users.sourceforge.net Sun Sep 30 19:52:47 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 19:52:47 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web baseweb.py, 1.27, 1.28 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10604/buildbot/status/web Modified Files: baseweb.py Log Message: [project @ Waterfall: defer to public_html/buildbot.css, to fix CSS breakage] Original author: warner at lothar.com Date: 2007-09-30 19:52:19+00:00 Index: baseweb.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/baseweb.py,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- baseweb.py 30 Sep 2007 09:24:03 -0000 1.27 +++ baseweb.py 30 Sep 2007 19:52:45 -0000 1.28 @@ -501,8 +501,12 @@ WebStatus.__init__(self, http_port, distrib_port, allowForce) self.css = css if css: - data = open(css, "rb").read() - self.putChild("buildbot.css", static.Data(data, "text/plain")) + if os.path.exists(os.path.join("public_html", "buildbot.css")): + # they've upgraded, so defer to that copy instead + pass + else: + data = open(css, "rb").read() + self.putChild("buildbot.css", static.Data(data, "text/plain")) self.favicon = favicon self.robots_txt = robots_txt if favicon: From warner at users.sourceforge.net Sun Sep 30 21:16:38 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 21:16:38 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.961,1.962 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10911 Modified Files: ChangeLog Log Message: [project @ hg: log a warning if we must guess at which Change is the most recent] Original author: warner at lothar.com Date: 2007-09-30 20:13:14+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.961 retrieving revision 1.962 diff -u -d -r1.961 -r1.962 --- ChangeLog 30 Sep 2007 19:52:45 -0000 1.961 +++ ChangeLog 30 Sep 2007 21:16:32 -0000 1.962 @@ -1,5 +1,8 @@ 2007-09-30 Brian Warner + * buildbot/steps/source.py (Mercurial.computeSourceRevision): log a + warning if we must invoke the last-change-is-most-recent guess + * buildbot/status/web/baseweb.py (Waterfall.__init__): if an old Waterfall is running in an upgraded master (which is the usual case for folks who have followed the instructions to run From warner at users.sourceforge.net Sun Sep 30 21:16:38 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 21:16:38 +0000 Subject: [Buildbot-commits] buildbot/buildbot/steps source.py,1.8,1.9 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/steps In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10911/buildbot/steps Modified Files: source.py Log Message: [project @ hg: log a warning if we must guess at which Change is the most recent] Original author: warner at lothar.com Date: 2007-09-30 20:13:14+00:00 Index: source.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/steps/source.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- source.py 30 Sep 2007 02:36:34 -0000 1.8 +++ source.py 30 Sep 2007 21:16:32 -0000 1.9 @@ -897,6 +897,10 @@ # changes at all. So for now, assume they were given to us in sorted # order, and just pay attention to the last one. See ticket #103 for # more details. + if len(changes) > 1: + log.msg("Mercurial.computeSourceRevision: warning: " + "there are %d changes here, assuming the last one is " + "the most recent" % len(changes)) return changes[-1].revision From warner at users.sourceforge.net Sun Sep 30 21:16:43 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 21:16:43 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.962,1.963 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10929 Modified Files: ChangeLog Log Message: [project @ waterfall: clip reload time at 15sec min, rather than ignoring short times altogether] Original author: warner at lothar.com Date: 2007-09-30 20:26:14+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.962 retrieving revision 1.963 diff -u -d -r1.962 -r1.963 --- ChangeLog 30 Sep 2007 21:16:32 -0000 1.962 +++ ChangeLog 30 Sep 2007 21:16:41 -0000 1.963 @@ -1,5 +1,10 @@ 2007-09-30 Brian Warner + * buildbot/status/web/waterfall.py + (WaterfallStatusResource.get_reload_time): if the suggest a + reload time of less than 15 seconds, give them 15 seconds instead + of ignoring their request entirely, because that'd be confusing. + * buildbot/steps/source.py (Mercurial.computeSourceRevision): log a warning if we must invoke the last-change-is-most-recent guess From warner at users.sourceforge.net Sun Sep 30 21:16:43 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 21:16:43 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web waterfall.py, 1.24, 1.25 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10929/buildbot/status/web Modified Files: waterfall.py Log Message: [project @ waterfall: clip reload time at 15sec min, rather than ignoring short times altogether] Original author: warner at lothar.com Date: 2007-09-30 20:26:14+00:00 Index: waterfall.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/waterfall.py,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- waterfall.py 30 Sep 2007 19:06:24 -0000 1.24 +++ waterfall.py 30 Sep 2007 21:16:41 -0000 1.25 @@ -429,8 +429,7 @@ if "reload" in request.args: try: reload_time = int(request.args["reload"][0]) - if reload_time > 15: - return reload_time + return max(reload_time, 15) except ValueError: pass return None From warner at users.sourceforge.net Sun Sep 30 21:16:51 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 21:16:51 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.963,1.964 NEWS,1.62,1.63 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10948 Modified Files: ChangeLog NEWS Log Message: [project @ NEWS: update with user-visible changes since the last release] Original author: warner at lothar.com Date: 2007-09-30 21:15:54+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.963 retrieving revision 1.964 diff -u -d -r1.963 -r1.964 --- ChangeLog 30 Sep 2007 21:16:41 -0000 1.963 +++ ChangeLog 30 Sep 2007 21:16:49 -0000 1.964 @@ -1,5 +1,7 @@ 2007-09-30 Brian Warner + * NEWS: update with user-visible changes since the last release + * buildbot/status/web/waterfall.py (WaterfallStatusResource.get_reload_time): if the suggest a reload time of less than 15 seconds, give them 15 seconds instead Index: NEWS =================================================================== RCS file: /cvsroot/buildbot/buildbot/NEWS,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- NEWS 11 Dec 2006 05:21:39 -0000 1.62 +++ NEWS 30 Sep 2007 21:16:49 -0000 1.63 @@ -1,5 +1,213 @@ User visible changes in Buildbot. -*- outline -*- +* Release 0.7.6 (30 Sep 2007) + +** Things You Need To Know + +*** 'buildbot upgrade-master' + +Each time you install a new version of Buildbot, you should run the new +'buildbot upgrade-master' command on each of your pre-existing buildmasters. +This will add files and fix (or at least detect) incompatibilities between +your old config and the new code. + +*** new WebStatus page + +The Waterfall has been replaced by the more general WebStatus display, +described below. WebStatus serves static files from a new public_html/ +directory that lives in the buildmaster's basedir. Files like index.html, +buildbot.css, and robots.txt are served directly from that directory, so any +modifications you wish to make should be made to those files. In particular, +any custom CSS you've written should be copied into public_html/buildbot.css. +The 'upgrade-master' command will populate this directory for you. + +The old Waterfall page is deprecated, but it should continue to work for +another few releases. It is now a subclass of WebStatus which just replaces +the default root URL with another copy of the /waterfall resource. + +*** Minimum Requirements: Python-2.3 and Twisted-2.0 + +We've dropped support for python-2.2 and for Twisted-1.3.0 . + +*** New Buildbot Home Page + +Buildbot has moved to a new Trac instance at http://buildbot.net/ , and all +new bugs and tickets should be filed there. The old sourceforge bugs at +http://buildbot.sf.net/ will slowly be migrated over. Mailing lists are still +managed at sourceforge, and downloads are still available there. + +*** Changed/Deprecated master.cfg Keys and Classes + +c['sources'] (plural) has been replaced by c['change_source'] (singular). + +c['bots'] has been replaced by c['buildslaves'], and it expects a list of +BuildSlave instances instead of tuples. See below for more details. + +The 'freshcvsmail' change source has been deprecated, and will be removed in +the next release. + +The html.Waterfall status target has been deprecated, and replaced by +html.WebStatus . + +** New Features + +*** WebStatus + +The new WebStatus display is a superset of the old Waterfall. It contains a +waterfall as a sub-page, but it also contains pages with more compact +representations of recent build status. The "one_line_per_build" page +contains just that, and "one_box_per_builder" shows just the information from +the top of the waterfall page (last-finished-build and current-activity). + +The initial page (when you hit the root of the web site) is served from +index.html, and provides links to the Waterfall as well as the other pages. + +Most of these pages can be filtered by adding query arguments to the URL. +Adding "?builder=XYZ" will cause the page to only show results for the given +builder. Adding "?builder=XYZ&builder=ABC" will show results for either +builder. "?branch=trunk" will limit the results to builds that involved code +from the trunk. + +The /waterfall page has arguments to hide those annoying "buildslave +connected" messages, to start and and at arbitrary times, and to auto-refresh +at a chosen interval (with a hardcoded minimum of 15 seconds). It also has a +"help" page with forms that will help you add all of these nifty filtering +arguments. + +The recommended practice is to modify the index.html file to include links to +the filtered pages that you find most useful. + +Note that WebStatus defaults to allowForce=False, meaning that the display +will not offer or accept "Force Build" or "Stop Build" controls. (The old +Waterfall defaults to allowForce=True). + +The new WebStatus pages try very hard to use only relative links, making life +better when the Buildbot sits behind an HTTP reverse proxy. + +In addition, there is a rudimentary XMLRPC server run by the WebStatus +object. It only has two methods so far, but it will acquire more in the +future. The first customer of this is a project to add a buildbot plugin to +Trac. + +*** BuildFactory.addStep(Step(args)) + +BuildFactories can be set up either with a complete list of steps, or by +calling the .addStep() method repeatedly. The preferred way to provide a step +is by instantiating it, rather than giving a class/kwargs pair. This gives +the BuildStep class a chance to examine the arguments (and complain about +anything it doesn't like) while the config file is being read and problems +are being logged. For example, the old-style: + + from buildbot.process.factory import BuildFactory, s + steps = [s(CVS, cvsroot="blah", mode="copy"), + s(Compile, command=["make", "all"]), + s(Test, command=["make", "test"]), + ] + f = BuildFactory(steps) + +is now: + + f = BuildFactory() + f.addStep( CVS(cvsroot="blah", mode="copy") ) + f.addStep( Compile(command=["make", "all"]) ) + f.addStep( Test(command=["make", "test"]) ) + +Authors of BuildStep subclasses which override __init__ to add new arguments +must register them with self.addFactoryArguments(**newargs) to make sure that +those classes will work with this new style, otherwise the new arguments will +be lost. + +Using class/kwargs pairs is deprecated, and will be removed in a future +release. + + +*** BuildSlave instances, max_builds=, notify_on_missing= + +Buildslave specification has changed a lot in this release. The old config: + + c['bots'] = [ ("bot1name", "bot1passwd"), + ("bot2name", "bot2passwd") ] + +is now: + + from buildbot.buildslave import BuildSlave + c['slaves'] = [ BuildSlave("bot1name", "bot1passwd"), + BuildSlave("bot2name", "bot2passwd") ] + +This new form gives us the ability to add new controls. The first is +"max_builds=", which imposes a concurrency limit that is like the usual +SlaveLock, but gives the buildmaster the opportunity to find a different +slave to run the build. (the buildslave is chosen before the SlaveLock is +claimed, so pure SlaveLocks don't let you take full advantage of build +farms). + +The other addition is "notify_on_missing=", which accepts an email address +(or list of addresses), and sends a message when the buildslave has been +disconnected for more than an hour (configurable with missing_timeout=). This +may be useful when you expect that the buildslave hosts should be available +most of the time, and want to investigate the reasons that it went offline. + + +** Other Improvements + +The IRC bot has been refactored to make it easier to add instant-messaging +status delivery in the future. The IM plugins are not yet written, though. + +When multiple buildslaves are available for a given build, one of them will +be picked at random. In previous releases, the first one on the list was +always picked. This helps to add a certain measure of load-balancing. More +improvements will be made in the future. + +When the buildslave does a VC checkout step that requires clobbering the +build directory (i.e. in all modes except for 'update'), the buildslave will +first set the permissions on all build files to allow their deletion, before +it attempts to delete them. This should fix some problems in which a build +process left non-user-writable files lying around (frequently a result of +enthusiastic unit tests). + +The BuildStep's workdir= argument can now accept a WithProperties() +specification, allowing greater control over the workdir. + +Support for the 'Bazaar' version control system (/usr/bin/bzr) has been +added, using the buildbot.steps.source.Bzr class. This is a replacement for +the old 'Arch' (/usr/bin/tla and /usr/bin/baz) systems, which are still +supported by Buildbot with the source.Arch and source.Bazaar classes, +respectively. Unfortunately the old baz system claimed the 'Bazaar' classname +early, so the new system must use source.Bzr instead of the desired +source.Bazaar . A future release might change this. + +A rudimentary Gnome Panel applet is provided in contrib/bb_applet.py, which +provides 'buildbot statusgui' -like colored status boxes inside the panel. +Installing it is a bit tricky, though. + +A certain amount of integration with the Bonsai and Tinderbox tools has been +contributed by the Mozilla crew. The goal is to slowly replace tinderbox with +buildbot, one component at a time, and these integration classes allow the +buildbot to accept changes (via email) from Bonsai, run builds, and then +deliver build results (via email) to tinderbox status clients. Work on this +project is ongoing. + +The 'buildbot try' command now accepts a '--diff=foo.patch' argument, to let +you provide a pre-computed patch. This makes it easier to test out patches +that you've looked over for safety, without first applying them to your local +source tree. + +A new Mercurial change source was added, hg_buildbot.py, which runs as an +in-process post-commit hook. This gives us access to much more information +about the change, as well as being much faster. + +The email-based changesource have been refactored, to make it easier to write +new mail parsers. A parser for the SVN "commit-email.pl" script has been +added. + +** Bugs Fixed + +Far too many to count. Please see +http://buildbot.net/trac/query?status=closed&milestone=0.7.6 for a partial +list of tickets closed for this release, and the ChangeLog for a complete +list of all changes since 0.7.5 . + + * Release 0.7.5 (10 Dec 2006) ** Things You Need To Know From warner at users.sourceforge.net Sun Sep 30 21:20:50 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 21:20:50 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.964,1.965 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12573 Modified Files: ChangeLog Log Message: [project @ Waterfall: add a DeprecationWarning, advising users to switch to WebStatus] Original author: warner at lothar.com Date: 2007-09-30 21:20:21+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.964 retrieving revision 1.965 diff -u -d -r1.964 -r1.965 --- ChangeLog 30 Sep 2007 21:16:49 -0000 1.964 +++ ChangeLog 30 Sep 2007 21:20:48 -0000 1.965 @@ -1,5 +1,9 @@ 2007-09-30 Brian Warner + * buildbot/status/web/baseweb.py (Waterfall.__init__): add a + DeprecationWarning for Waterfall, advising users to switch over to + WebStatus instead. + * NEWS: update with user-visible changes since the last release * buildbot/status/web/waterfall.py From warner at users.sourceforge.net Sun Sep 30 21:20:51 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 21:20:51 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web baseweb.py, 1.28, 1.29 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12573/buildbot/status/web Modified Files: baseweb.py Log Message: [project @ Waterfall: add a DeprecationWarning, advising users to switch to WebStatus] Original author: warner at lothar.com Date: 2007-09-30 21:20:21+00:00 Index: baseweb.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/baseweb.py,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- baseweb.py 30 Sep 2007 19:52:45 -0000 1.28 +++ baseweb.py 30 Sep 2007 21:20:48 -0000 1.29 @@ -498,6 +498,12 @@ def __init__(self, http_port=None, distrib_port=None, allowForce=True, categories=None, css=buildbot_css, favicon=buildbot_icon, robots_txt=None): + import warnings + m = ("buildbot.status.html.Waterfall is deprecated as of 0.7.6 " + "and will be removed from a future release. " + "Please use html.WebStatus instead.") + warnings.warn(m, DeprecationWarning) + WebStatus.__init__(self, http_port, distrib_port, allowForce) self.css = css if css: From warner at users.sourceforge.net Sun Sep 30 22:48:43 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 22:48:43 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.965,1.966 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12647 Modified Files: ChangeLog Log Message: [project @ darcs_buildbot.py: refactor to enable import and testing] Original author: warner at lothar.com Date: 2007-09-30 22:47:19+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.965 retrieving revision 1.966 diff -u -d -r1.965 -r1.966 --- ChangeLog 30 Sep 2007 21:20:48 -0000 1.965 +++ ChangeLog 30 Sep 2007 22:48:41 -0000 1.966 @@ -1,5 +1,9 @@ 2007-09-30 Brian Warner + * contrib/darcs_buildbot.py: refactor internals a bit, make it + possible to use as an importable module (to make it easier to + write some unit tests for it) + * buildbot/status/web/baseweb.py (Waterfall.__init__): add a DeprecationWarning for Waterfall, advising users to switch over to WebStatus instead. From warner at users.sourceforge.net Sun Sep 30 22:48:43 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Sun, 30 Sep 2007 22:48:43 +0000 Subject: [Buildbot-commits] buildbot/contrib darcs_buildbot.py,1.5,1.6 Message-ID: Update of /cvsroot/buildbot/buildbot/contrib In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12647/contrib Modified Files: darcs_buildbot.py Log Message: [project @ darcs_buildbot.py: refactor to enable import and testing] Original author: warner at lothar.com Date: 2007-09-30 22:47:19+00:00 Index: darcs_buildbot.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/contrib/darcs_buildbot.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- darcs_buildbot.py 12 Aug 2007 19:42:22 -0000 1.5 +++ darcs_buildbot.py 30 Sep 2007 22:48:41 -0000 1.6 @@ -10,7 +10,8 @@ # # (the second command is necessary to avoid the usual "do you really want to # run this hook" prompt. Note that you cannot have multiple 'apply posthook' -# lines.) +# lines: if you need this, you must create a shell script to run all your +# desired commands, then point the posthook at that shell script.) # # Note that both Buildbot and Darcs must be installed on the repository # machine. You will also need the Python/XML distribution installed (the @@ -73,12 +74,8 @@ -MASTER = sys.argv[1] -LASTCHANGEFILE = ".darcs_buildbot-lastchange" - -def getSomeChanges(count): - out = commands.getoutput("darcs changes --last=%d --xml-output --summary" - % count) +def getChangesFromCommand(cmd, count): + out = commands.getoutput(cmd) try: doc = minidom.parseString(out) except xml.parsers.expat.ExpatError, e: @@ -98,6 +95,13 @@ changes.append(makeChange(p)) return changes +def getSomeChanges(count): + cmd = "darcs changes --last=%d --xml-output --summary" % count + return getChangesFromCommand(cmd, count) + + +LASTCHANGEFILE = ".darcs_buildbot-lastchange" + def findNewChanges(): if os.path.exists(LASTCHANGEFILE): f = open(LASTCHANGEFILE, "r") @@ -123,34 +127,38 @@ lookback)) lookback = 2*lookback -changes = findNewChanges() -s = sendchange.Sender(MASTER, None) +def sendChanges(master): + changes = findNewChanges() + s = sendchange.Sender(master, None) -d = defer.Deferred() -reactor.callLater(0, d.callback, None) + d = defer.Deferred() + reactor.callLater(0, d.callback, None) -if not changes: - print "darcs_buildbot.py: weird, no changes to send" -elif len(changes) == 1: - print "sending 1 change to buildmaster:" -else: - print "sending %d changes to buildmaster:" % len(changes) + if not changes: + print "darcs_buildbot.py: weird, no changes to send" + elif len(changes) == 1: + print "sending 1 change to buildmaster:" + else: + print "sending %d changes to buildmaster:" % len(changes) -def _send(res, c): - branch = None - print " %s" % c['revision'] - return s.send(branch, c['revision'], c['comments'], c['files'], - c['username']) -for c in changes: - d.addCallback(_send, c) + def _send(res, c): + branch = None + print " %s" % c['revision'] + return s.send(branch, c['revision'], c['comments'], c['files'], + c['username']) + for c in changes: + d.addCallback(_send, c) -d.addCallbacks(s.printSuccess, s.printFailure) -d.addBoth(s.stop) -s.run() + d.addCallbacks(s.printSuccess, s.printFailure) + d.addBoth(s.stop) + s.run() -if changes: - lastchange = changes[-1]['revision'] - f = open(LASTCHANGEFILE, "w") - f.write(lastchange) - f.close() + if changes: + lastchange = changes[-1]['revision'] + f = open(LASTCHANGEFILE, "w") + f.write(lastchange) + f.close() +if __name__ == '__main__': + MASTER = sys.argv[1] + sendChanges(MASTER)
                %s