#8151 webhook should send more data for CI



I'm a user of sourceforge. Recently, I went about setting up a buildbot for 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, I wrote one. 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 of Sourceforge-specific hacks 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 :-)).



Log in to post a comment.