[Buildbot-commits] [Buildbot] #2800: build is not triggered for new branches on gitlab

Buildbot trac trac at buildbot.net
Wed May 14 15:07:18 UTC 2014


#2800: build is not triggered for new branches on gitlab
------------------------+-----------------------
Reporter:  qsorix       |      Owner:
    Type:  enhancement  |     Status:  new
Priority:  minor        |  Milestone:  undecided
 Version:  0.8.8        |   Keywords:
------------------------+-----------------------
 This may not be a bug on buildbot, perhaps the proper fix should be done
 on gitlab.

 I've noticed that when I create a new branch on gitlab, the notification
 from web-hook does not include any commits, so no changes are generated
 and hence no builds happen.

 I've worked around the problem by modifying gitlab's hook. I've pasted the
 code previously imported from github's hook -- this is bad, but I don't
 know github's behaviour in this case -- and added some lines to fake a
 change on new branches.

 I'm reporting it, in case someone else finds it useful. Perhaps someone
 will have enough time to create proper patch and integrate it.

 {{{
         elif re.match(r"^0*$", oldrev):
             log.msg("Branch `%s' created, faking commit" % branch)
             # new branch notifications has no commits, fake one to trigger
 build
             change = {
                 'author': user,
                 'files': [],
                 'comments': 'Branch %s created' % branch,
                 'revision': newrev,
                 'when_timestamp': datetime.datetime.utcnow(),
                 'branch': branch,
                 'revlink': '',
                 'repository': repo_url,
                 'project': project
             }
             changes.append(change)
  }}}

-- 
Ticket URL: <http://trac.buildbot.net/ticket/2800>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list