Posts tagged “extensions”.
GSoC Proposal: Signals-based notification API and WebHooks support for ReviewBoard
I’m posting here the full version of my proposal that was accepted for the Google Summer of Code this year. I’ll be blogging mostly about this for the next few months, so it’s good to give some context. I hope it can also be useful to other students when writing their application next year.
Abstract
ReviewBoard’s increasing adoption across many diverse development environments has led to a need for integration with other tools that has outgrown its development capacity and focus, driving a growing need for extensibility. There is already an HTTP API and support for third-party extensions is on the way, but we still need a standard way to support event-based integration with other apps. This project aims to fill that gap by implementing support for WebHooks [1].
Content:
Background
My name is Helder dos Santos Ribeiro, born and living in Brazil. In 2007 I was mentored by Aaron Patterson in the Google Summer of Code, where I successfully built TestGen4Ruby [2], a TestGen4Web-to-FireWatir bridge [3][4], allowing the recording of user actions on a browser and programatic replaying of them on an open Firefox instance. I’ve spoken about it at RubyConf2007 [5].
I’m a Ruby programmer with a lot of experience in web development, being familiar with its main concepts and technologies. I’ve done a lot of freelance work for Europe’s leading local reviews web startup, which was built using Ruby on Rails.
Other work includes professionally writing C applications for embedded Linux platforms using the Enlightenment Foundation Libraries; heavy data processing and visualization using Java for scientific/governmental projects; and a popular Twitter bot for notifying students of the lunch menu at the cafeteria :)
I’m currently studying Computer Engineering at Unicamp (State University of Campinas). Unicamp is considered to have one of the best
Computer Engineering courses in Latin America.
Motivation
ReviewBoard is one very important tool in the development process, helping keep code quality, share knowledge, build team interaction and train new hires. As important as it is, it sits in a much bigger ecosystem in the development process, composed of version control systems, continuous integration/build/staging servers, bug trackers, mailing lists, IRC channels, etc. Integration among these is crucial to allow for increased automation in the process, reducing its overhead so people can focus on the product. Given the myriad of different applications used for each of those roles, it is unrealistic to expect ReviewBoard to provide integration with every single one of them.
Reviewboard’s HTTP API has helped bridge that gap, allowing other applications to interact with it by requesting or adding content. One thing that is missing, though, is a callback mechanism, allowing ReviewBoard to notify other apps based on events that happen within itself. One emerging way of doing this is WebHooks [1]. It uses HTTP to POST JSON payloads to callback URLs, conveying information about the event which can then be handled by the receiving application however it likes. The use of HTTP and JSON are key to its effectiveness, as these are standards understood by most applications and for which many tools and libraries are available.
The goal of this project is to abstract ReviewBoard’s current email notification mechanism into a generic, signals-based event callback API that will be made available to its to-be-released extensions framework; refactor email notifications to plug into that API; and then build support for WebHooks as an extension.
I’m working in a small team of Ruby on Rails developers and have been responsible for organizing and tuning our development process. We’ve been using ReviewBoard daily for the past few months and have grown very fond of it. The idea for this project grew out of our own need for better extensibility and notification. Its completion will have a direct impact on our productivity, so I’m very commited to it.
Deliverables
* Build a common infrastructure for events using signals:
** make it very easy to register new event triggers and listeners;
** allow listeners to listen only to events by a user, a group or all.
* Refactor email notification code (currently hard-coded) using signals;
* Write support for WebHooks as an extension. This includes:
** Admin interface:
*** specify hook URL(s) to POST all events on the site to;
*** control whether user/group-level hooks are allowed;
*** (optional) specify which types of event will be sent.
** User/Group interface:
*** specify hook URL(s) to POST user/group-scoped events to;
*** (optional) specify which types of event will be sent.
** Backend:
*** WebHooks table with proper join tables for users/groups;
*** Specification of JSON format for serialized events;
*** Listen to signals and issue POST requests asynchronously and with retries:
**** Implement using django_webhooks [6], Hookah [7] or custom solution
And, of course, docs, tutorials and whatnot.
Availability
Full disclosure: I live in the Southern Hemisphere, so I don’t have a big summer break to work on this. I’m not taking too many classes this semester, so I’ll start working right after the results come out (including during the community bonding period), which gives me almost 4 months to finish everything. I also have a 1-month winter break in July, so it’s perfectly doable.
Timeline
Weeks 1, 2, 3, 4 (April 20th – May 17th):
* Learn Python and Django (easy with my Ruby/Rails background);
* Study the ReviewBoard codebase and get familiar with its development process;
* Start work on signals infrastructure;
Weeks 5, 6, 7, 8 (May 18th – June 14th):
* Finish signals infrastructure;
* Refactor email notification code to use signals;
* Study which of django_webhooks, hookah or custom solution are the best choice;
Weeks 9, 10, 11, 12 (June 15th – July 12nd):
* Build admin/user/group interfaces and tables to record options;
* Tie options/URLs to listeners with the appropriate scopes without POSTing (just printing the URL);
Weeks 13, 14, 15, 16 (July 13th – August 10th):
* Tie POST issuing code to signal handlers;
* Test, fix, test, fix, test;
* Write documentation, tutorials, blog posts, etc.
References
[1] WebHooks: http://webhooks.org/
[2] TestGen4Ruby: http://code.google.com/p/tg4rb/
[3] TestGen4Web: https://addons.mozilla.org/firefox/addon/1385
[4] FireWatir: http://code.google.com/p/firewatir/
[5] RubyConf Presentation: http://rubyconf2007.confreaks.com/d3t3p1_summer_of_code_firewatir.html
[6] django_webhooks: http://github.com/johnboxall/django_webhooks/tree/master
[7] Hookah: http://blog.webhooks.org/2009/03/02/announcing-hookah-the-web-hook-event-dispatcher/

