[users at bb.net] Build has less changes than expected
Lennart Sauerbeck
lennart.sauerbeck at sevencs.com
Mon Dec 18 15:14:40 UTC 2017
Hi folks,
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.
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.
In order to avoid the X/Y-problem, I'd like to describe my usecase first:
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.
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.
The short version:
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.
How can I get all changes the `ChangeSource` added?
The long version:
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.
- `self.build.allChanges()` only ever returns a list of size 1, containing only the latest change.
- `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).
- `self.build.build_status.getChanges()` only ever returns a list of size 1, containing only the latest change.
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.
Did I miss any vital information? Is there anything I can explain in more detail?
Any help in this matter would be greatly appreciated.
Best Regards
Lennart Sauerbeck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/users/attachments/20171218/ff7f36e1/attachment.html>
More information about the users
mailing list