---

** [tickets:#8151] webhook should send more data for CI**

**Status:** open
**Milestone:** unreleased
**Created:** Tue Apr 11, 2017 10:50 AM UTC by John J. Jordan
**Last Updated:** Tue Apr 11, 2017 10:50 AM UTC
**Owner:** nobody


Hello,

I'm a user of sourceforge.  Recently, I went about setting up a 
[buildbot](http://buildbot.net) for [joe-editor](http://sf.net/p/joe-editor).  
Rather than polling for changes, I figured I'd be nice to the SF servers and 
use webhooks (change hooks in buildbot parlance).  As there weren't any 
compatible with Allura, apart from the generic [poller change 
hook](http://docs.buildbot.net/latest/manual/cfg-wwwhooks.html#poller-hook), [I 
wrote 
one](https://bitbucket.org/jjjordan/joe-build/src/8512e5fa535d3bc6e483a85f49db229a474b592d/master/allura.py?at=default&fileviewer=file-view-default).
  I'd like to submit it upstream to buildbot itself, but I'm a little 
unsatisfied with the code.  Specifically, I feel the webhooks do not send 
enough information to populate the data structure that buildbot wants -- and 
that limitation likely applies to other CI systems.

Two bits of information are missing:
- What type of repository is this?
- Where is the repo URL?

For now, the code relies on the user supplying this information -- *and* not 
using more than one change hook with any instance of buildbot.  It also uses a 
[couple](https://bitbucket.org/jjjordan/joe-build/src/8512e5fa535d3bc6e483a85f49db229a474b592d/master/allura.py?at=default&fileviewer=file-view-default#allura.py-154)
 of Sourceforge-specific 
[hacks](https://bitbucket.org/jjjordan/joe-build/src/8512e5fa535d3bc6e483a85f49db229a474b592d/master/allura.py?at=default&fileviewer=file-view-default#allura.py-131)
 to try and determine these values.  They won't work on vanilla Allura.

As a sidenote, I think I can find the answer to what type of repository this is 
by hitting the Allura json api.  The problem is that buildbot runs twisted, and 
I can't fire off an event as this function doesn't give me a reactor (event 
loop).  It's really meant to be a quick transformation.  I also don't want to 
block the entire thread, even if I use caching.  At any rate, I can't find the 
repository.

It's working for my case, and I'm currently happy with it.  But these issues 
would need to be addressed before I'd consider sending this upstream and into 
buildbot proper.  If anything, I hope this is useful to you to see how the 
webhook change is consumed and integrated with build systems (although I'm sure 
you do this internally :-)).

Thanks
-john


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed 
to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is 
a mailing list, you can unsubscribe from the mailing list.

Reply via email to