[OpenAFS-devel] gerrit not triggering buildbot runs

Benjamin Kaduk kaduk@MIT.EDU
Tue, 1 Dec 2015 22:30:31 -0500 (EST)


On Tue, 4 Aug 2015, Jason Edgecombe wrote:

> On 08/04/2015 09:20 PM, Jason Edgecombe wrote:
> > On 08/04/2015 04:27 AM, Stephan Wiesand wrote:
> > > It seems buildbot is not getting triggered by gerrit any more since
> > > yesterday. Can anyone see what's wrong?
> > >
> > > - Stephan
> > >
> > I fixed some ssh keys ans a script that wasn't handling unicode. The builds
> > have been triggered, but the 'git update' step seems to be failing to fetch
> > the git references from gerrit.
> >
> > Example log file:
> > http://buildbot.openafs.org:8010/builders/solaris11_x86-builder/builds/694/steps/git/logs/stdio
>
> After further digging, I think that my scripts may be to blame. I have scripts
> in place to resubmit changes that were missed because of network hiccup. It
> looks like resubmit scripts aren't sending the proper properties to allow
> buildbot to fetch the proper git references. I've disabled the 'resubmit'
> feature until I can investigate further. In the interim, gerrit changes should
> still be built, but some changes may be missed if there is a network outage.

I decided that I would rather track down this issue than rebase and
resubmit the log-rotation stack of patches, and I think I have something
workable in place.

The core logic in buildbot seems to be from the python module
buildbot/steps/source//gerrit.py, where there is the following logic:

    def startVC(self, branch, revision, patch):
        gerrit_branch = None
        if self.build.hasProperty("event.patchSet.ref"):
            gerrit_branch = self.build.getProperty("event.patchSet.ref")
            self.updateSourceProperty("gerrit_branch", gerrit_branch)
        else:
            try:
                change = self.build.getProperty("gerrit_change", '').split('/')
                if len(change) == 2:
                    gerrit_branch = "refs/changes/%2.2d/%d/%d" \
                        % (int(change[0]) % 100, int(change[0]), int(change[1]))
                    self.updateSourceProperty("gerrit_branch", gerrit_branch)
            except:
                pass


We were supplying neither a "patchSet.ref" nor a "gerrit_change" in the
events our script was generating, so nothing ended up happening.  I was
able to get things working by manually constructing the patchSet.ref
(e.g., refs/changes/14/11814/5), but I didn't manage to figure out how to
get a gerrit_change that would be recognized.  (The gerrit_change method
would be preferable since it's less messy logic.)

Anyway, the fake-unverified-stream script is adjusted to generate this
output now (and has a 5-day timeout so as to catch the stack of changes I
was interested in), and buildbot is chewing through the unreviewed
changes.

-Ben