Next: , Previous: Data Lifetime, Up: Global Configuration

4.5.6 Merging BuildRequests

By default, buildbot merges BuildRequests that have compatible SourceStamps.

This can be disabled for any particular Builder by passing mergeRequests=False to the BuilderConfig definition, see Builders. For example:

     c['builders'] = [
       BuilderConfig(name='test-i386', slavename='bot-i386', builddir='test-i386',
                     factory=f, mergeRequests=False),

For more precise control, this behaviour can be customized with the buildmaster's c['mergeRequests'] configuration key. This key specifies a function which is called with three arguments: a Builder and two BuildRequest objects. It should return true if the requests can be merged. For example:

     def mergeRequests(builder, req1, req2):
         """Don't merge buildrequest at all"""
         return False
     c['mergeRequests'] = mergeRequests

In many cases, the details of the SourceStamps and BuildRequests are important. In this example, only BuildRequests with the same "reason" are merged; thus developers forcing builds for different reasons will see distinct builds.

     def mergeRequests(builder, req1, req2):
         if req1.source.canBeMergedWith(req2.source) and  req1.reason == req2.reason:
            return True
         return False
     c['mergeRequests'] = mergeRequests

If desired, request merging can be disabled globally by setting c['mergeRequests'] = False instead of a callable function.