<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Nur Text Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
span.NurTextZchn
        {mso-style-name:"Nur Text Zchn";
        mso-style-priority:99;
        mso-style-link:"Nur Text";
        font-family:"Calibri","sans-serif";}
span.E-MailFormatvorlage19
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoPlainText"><span lang="EN-US">Hi folks,<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">first of all thanks to the team and contributors for working on Buildbot. I enjoyed deploying it in version 0.8 and really dig the new Web interface of 0.9.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">However, during the port of one of my custom builders I hit a problem concerning changes. I read the documentation many times, dived into the source code and tried many things, but fear I can’t solve this by myself.
 So any help would be really appreciated.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">In order to avoid the X/Y-problem, I’d like to describe my usecase first:<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">I use Buildbot to run pre-merge continuous integration checks on a range of projects backed by Gerrit. A subclassed `GerritChangeSource` reacts on published reviews, adds all these as Buildbot changes to the database
 which triggers a custom builder. This builder now looks at all incoming changes, does some dependency calculations (due to projects with submodules) and triggers builds on multiple schedulers, each with a subset of the incoming changes (and some sourcestamps
 generated due to dependencies). This allows for each published Gerrit change  to be built as stand-alone as possible.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">All these classes (`GerritChangeSource` subclass and the buildstep for the custom builder) were written for Buildbot 0.8 and worked great. With 0.9.14 (after rewriting them according to `Upgrading to Nine`, not so
 much. Since there’s a short and a long version of the problem, I’ll give you both.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">The short version:<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">In version 0.8 each build got all the changes that were added by the connected `ChangeSource` (using `self.build.allChanges()`). In version 0.9.14 this only ever returns one change.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">How can I get all changes the `ChangeSource` added?<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">The long version:<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">I subclass `GerritChangeSource` to receive Buildbot changes from Gerrit. Subclassing is mostly done to have a way of forcing rebuilds for a Gerrit change. Whenever a Gerrit change is published, I can see in the twistd.log
 that the expected number of changes are added to the database. So for two Gerrit changes that are published I see two Buildbot changes added to the database according to twistd.log. There only is one scheduler which reacts on these Gerrit changes (using `util.GerritChangeFilter`
 as `change_filter`). This scheduler only has one connected builder, which has `collapseRequests` set to `False`. This builder is triggered by the `ChangeSource` and its one and only step starts. This custom step implements `buildstep.ShellMixin` and `buildstep.Buildstep`.
 Inside the run method I now try to access all changes added by the ChangeSource for this build. Now here's the problem.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">- `self.build.allChanges()` only ever returns a list of size 1, containing only the latest change.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">- `self.build.requests()` also only ever returns a list of size 1 (and each request only ever has one change in each of the codebases).<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">- `self.build.build_status.getChanges()` only ever returns a list of size 1, containing only the latest change.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">How can I access all changes that were added by the `ChangeSource`? They are sometimes listed on the `Changes` tab in the Web-UI (sometimes the same commit is shown multiple times here), but I cannot seem to get at
 them from inside the buildstep itself.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">Did I miss any vital information? Is there anything I can explain in more detail?<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">Any help in this matter would be greatly appreciated.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">Best Regards<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">Lennart Sauerbeck<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>