[users at bb.net] How to make Buildbot see merge commits?

Chris Spencer chrisspen at gmail.com
Tue Sep 25 18:22:18 UTC 2018


I'm using the fileIsImportant callback to determine if Buildbot should run
the build or not.

My code is for a Python based web-app, so my function looks like:

    def fileIsImportant(change):
        important_extensions = set(['.py', '.js', '.css', '.html'])
        for f in change.files:
            ext = os.path.splitext(f)[-1].lower()
            if ext in important_extensions:
                return True
        return False

This seems to correctly ignore changes that only involve doc files.
However, Buildbot also seems to be ignoring all merges, even if they have
code changes caught by this callback. I hadn't noticed this before, but
looking back, I think Buildbot may always have done this. I've made a few
changes to my Buildbot config in the last week, so I may be wrong. Has the
default in Buildbot always been to ignore merge commits or is it just my
setup?

I'd like Buildbot to run the build after all merge commits to the staging
branch. How do I accomplish this?

These are my current schedulers:

    c['schedulers'] = [
        schedulers.SingleBranchScheduler(
            name="master",
            change_filter=util.ChangeFilter(branch='master'),
            treeStableTimer=300, # seconds to wait before starting build
            fileIsImportant=fileIsImportant,
            builderNames=["runtests"],
        ),
        schedulers.SingleBranchScheduler( # This is separate so it can be
run on a single worker with access to the staging environment, and multiple
workers don't simultaneously try deploying to staging.
            name="staging",
            change_filter=util.ChangeFilter(branch='staging'),
            treeStableTimer=300, # Wait 5 minutes before building.
            fileIsImportant=fileIsImportant,
            builderNames=["runtests_staging"], # This also deploys the
change to the staging environment.
        ),
        schedulers.AnyBranchScheduler(
            name="open",
            change_filter=util.ChangeFilter(branch_fn=lambda b: b not in
['master', 'staging']), # Exclude master and staging
            treeStableTimer=60, # seconds to wait before starting build
            fileIsImportant=fileIsImportant,
            builderNames=["runtests"],
        ),
        schedulers.ForceScheduler(
            name="force",
            buttonName="Use the Force",
            builderNames=["runtests"],
        )
    ]

What am I doing that would cause Buildbot to ignore merge commits? Is there
any possibility that my fileIsImportant callback is causing the problem? Is
the Change object for merge commits contain a different file list than for
normal commits?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/users/attachments/20180925/4962d4e8/attachment.html>


More information about the users mailing list