s

buildbot fix `skipping build - no important changes' issue


1 background

I use buildbot 0.9.7.

But when I commit some changes about .js files, the nightly build will not
be triggered.

Check the master/twistd.log
I got the following info:

Nightly scheduler <YY-Nightly>: skipping build - No important changes

2 analysis

I read the buildbot doc, and find a clue:

Files
It also has a list of files, which are just the tree-relative filenames of
any files that were added, deleted, or modified for this Change. These
filenames are used by the fileIsImportant function (in the scheduler) to
decide whether it is worth triggering a new build or not.

fileIsImportant
A callable which takes one argument, a Change instance, and returns True if the
change is worth building, and False if it not. Unimportant Changes are accumulated
until the build is triggered by an important change. The default value of None
means that all Changes are important.

onlyImportant
A boolean that, when True, only adds important changes to the buildset as specified
in the fileIsImportant callable. This means that unimportant changes are ignored
the same way a change_filter filters changes. This defaults to False and only
applies when fileIsImportant is given.

The buildbot code path:

/usr/local/lib/python2.7/dist-packages/buildbot
              

3 fix steps

add

fileIsImportant=None,
onlyImportant=False,
              

to schedulers.Nightly. Code as below:

c['schedulers'].append(schedulers.Nightly(
                    name='yy-Nightly',
                    branch=branch_name,
                    change_filter=util.ChangeFilter(branch=branch_name),
                    builderNames=["yyb"],
                    hour=23,
                    minute=00,
                    fileIsImportant=None,
                    onlyImportant=False,
                    onlyIfChanged=True))