changeset 348:ef795ebeac00

Updated change log for [milestone:0.5.3].
author cmlenz
date Tue, 18 Apr 2006 10:28:43 +0000
parents 487017b424f6
children a4bc537baa15
files ChangeLog bitten/master.py bitten/queue.py
diffstat 3 files changed, 59 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Version 0.5.3
+(18 April 2006, from 0.5.x branch)
+http://bitten.cmlenz.net/repos/bitten/tags/0.5.3
+
+ * Fix double-escaping of report summaries.
+ * Fix build master error when build log contains no messages.
+
 Version 0.5.2
 (17 January 2006, from 0.5.x branch)
 http://bitten.cmlenz.net/repos/bitten/tags/0.5.2
--- a/bitten/master.py
+++ b/bitten/master.py
@@ -39,7 +39,8 @@
 class Master(beep.Listener):
     """BEEP listener implementation for the build master."""
 
-    def __init__(self, envs, ip, port, adjust_timestamps=False,
+    def __init__(self, envs, ip, port, build_all=False,
+                 adjust_timestamps=False,
                  check_interval=DEFAULT_CHECK_INTERVAL):
         beep.Listener.__init__(self, ip, port)
         self.profiles[OrchestrationProfileHandler.URI] = \
@@ -50,7 +51,7 @@
 
         self.queues = []
         for env in envs:
-            self.queues.append(BuildQueue(env))
+            self.queues.append(BuildQueue(env, build_all=build_all))
 
         self.schedule(self.check_interval, self._enqueue_builds)
 
@@ -386,6 +387,9 @@
     parser.add_option('-i', '--interval', dest='interval', metavar='SECONDS',
                       default=DEFAULT_CHECK_INTERVAL, type='int',
                       help='poll interval for changeset detection')
+    parser.add_option('--build-all', action='store_true', dest='buildall',
+                      help='build older revisions even when a build for a '
+                           'newer revision has already been performed')
     parser.add_option('--timewarp', action='store_true', dest='timewarp',
                       help='adjust timestamps of builds to be near the '
                            'timestamps of the corresponding changesets')
@@ -456,7 +460,8 @@
         log.error('None of the specified environments has support for Bitten')
         sys.exit(2)
 
-    master = Master(envs, host, port, adjust_timestamps=options.timewarp,
+    master = Master(envs, host, port, build_all=options.buildall,
+                    adjust_timestamps=options.timewarp,
                     check_interval=options.interval)
     try:
         master.run(timeout=5.0)
--- a/bitten/queue.py
+++ b/bitten/queue.py
@@ -89,12 +89,14 @@
     need to be built.
     """
 
-    def __init__(self, env):
+    def __init__(self, env, build_all=False):
         """Create the build queue.
         
         @param env: the Trac environment
+        @param build_all: whether older revisions should be built
         """
         self.env = env
+        self.build_all = build_all
         self.slaves = {} # Sets of slave names keyed by target platform ID
 
         # Snapshot managers, keyed by build config name
@@ -118,22 +120,47 @@
         """
         log.debug('Checking for pending builds...')
 
-        for build in Build.select(self.env, status=Build.PENDING):
-
-            # Ignore pending builds for deactived build configs
-            config = BuildConfig.fetch(self.env, name=build.config)
-            if not config.active:
-                continue
+        repos = self.env.get_repository()
+        builds_to_delete = []
+        try:
+            for build in Build.select(self.env, status=Build.PENDING):
 
-            # Find a slave for the build platform that is not already building
-            # something else
-            slaves = self.slaves.get(build.platform, [])
-            for idx, slave in enumerate([name for name in slaves if name
-                                         in available_slaves]):
-                slaves.append(slaves.pop(idx)) # Round robin
-                return build, slave
+                # Ignore pending builds for deactived build configs
+                config = BuildConfig.fetch(self.env, name=build.config)
+                if not config.active:
+                    log.info('Dropping build of configuration "%s" at '
+                             'revision [%s] on %s because the configuration is '
+                             'deactivated', config.name)
+                    builds_to_delete.append(build)
+                    continue
 
-        return None, None
+                # Stay within the revision limits of the build config
+                if (config.min_rev and repos.rev_older_than(build.rev,
+                                                            config.min_rev)) \
+                or (config.max_rev and repos.rev_older_than(config.max_rev,
+                                                            build.rev)):
+                    # This minimum and/or maximum revision has changed since
+                    # this build was enqueued, so drop it
+                    log.info('Dropping build of configuration "%s" at '
+                             'revision [%s] on %s because it is outside of the '
+                             'revision range of the configuration', config.name,
+                             rev, platform.name)
+                    builds_to_delete.append(build)
+                    continue
+
+                # Find a slave for the build platform that is not already building
+                # something else
+                slaves = self.slaves.get(build.platform, [])
+                for idx, slave in enumerate([name for name in slaves if name
+                                             in available_slaves]):
+                    slaves.append(slaves.pop(idx)) # Round robin
+                    return build, slave
+
+            return None, None
+        finally:
+            repos.close()
+            for build in builds_to_delete:
+                build.delete(db=db)
 
     def populate(self):
         """Add a build for the next change on each build configuration to the
@@ -161,6 +188,8 @@
                                       rev_time = repos.get_changeset(rev).date)
                         builds.append(build)
                         break
+                    elif not self.build_all:
+                        break
             for build in builds:
                 build.insert(db=db)
             db.commit()
Copyright (C) 2012-2017 Edgewall Software