[Buildbot-devel] How does build request merging work?

Dustin J. Mitchell dustin at v.igoro.us
Mon Mar 21 15:47:29 UTC 2011


On Mon, Mar 21, 2011 at 10:40 AM, David Coppit <david at coppit.org> wrote:
> To confirm my understanding, this query:
> select
>  concat("http://mobile-buildbot/builders/", buildername, '/builds/', number)
> as url,
>  builds.id as build_id,
>  brid as buildrequest_id,
>  buildsets.id as buildset_id,
>  author, revision
> from builds, buildrequests, buildsets, sourcestamp_changes, changes
> where
>  builds.brid = buildrequests.id
>  and buildsets.id = buildrequests.buildsetid
>  and sourcestamp_changes.sourcestampid = buildsets.sourcestampid
>  and changes.changeid = sourcestamp_changes.changeid
>  and buildername = 'foo' and number = 336
>
> Would show how a single buildername+build number pair would map to multiple
> build numbers, build requests, sourcestamps, and ultimately changes.

Not at all - in fact, I'm having a hard time figuring out what you
meant to do.  First, in the URL, you're putting 'number', which is
'changes.number', after the '/builds/' component - that should be a
build number instead.  Second, you're asking how a single
buildername+build number can map to multiple build numbers, which
doesn't really make sense.  Finally, builds aren't in the database
(yet..), so you won't be able to query them via SQL.

>> > If a change comes in, then a try build, then another change, is Buildbot
>> > smart enough to merge the first and third build request?
>>
>> Only if you teach it that with the various merging configuration options.
>
> It looks to me like the merge function is called with two build requests.
> Wouldn't the answer depend on whether it's called for all pairs of pending
> build requests, as opposed to subsequent pairs?

The merge process begins by finding the best build request to start
with (using nextBuild).  It then tries to merge that request with
*all* other requests (using mergeRequests).

Dustin




More information about the devel mailing list