Update: the tool is now easier to use and doesn’t require adding your password as an argument. See this post for more details.
I’m a big fan of the self-serve tool that RelEng provided for people with LDAP access. When I can see a try build going bad, I can cancel all the remaining builds and free up resources, or retrigger completed builds if I want to get extra results. Unfortunately, the server is fairly slow to respond and the UI to perform these actions is clumsy. Luckily, there’s a really simple API available to allow anyone with access to make use of these tools in more traditional (read: non-graphical) means. Allow me to introduce you to a new repo I set up today to make working with the self-serve API easier – self-serve tools.
selfserve.py contains simple wrappers for every API point exposed, and some basic documentation of the values returned by most of the calls.
cancel.py is an example of a really simple tool that can be built on top of the wrappers to allow for bulk cancellation. Here’s what a session looks like:
[jdm@Phaethon self-serve-tools]$ python cancel.py -u "firstname.lastname@example.org" -p my5ecureP4ssword123 -r 306838f27b33 -b try 1: Linux x86-64 tryserver leak test build 2: Linux tryserver build 3: OS X 10.6.2 tryserver build 4: WINNT 5.2 tryserver build 5: Maemo 5 QT tryserver build 6: OS X 10.6.2 tryserver leak test build 7: Maemo 5 GTK tryserver build 8: Android R7 tryserver build 9: Linux tryserver leak test build 10: WINNT 5.2 tryserver leak test build 11: OS X 10.5.2 tryserver leak test build 12: Linux QT tryserver build 13: Linux x86-64 tryserver build 14: all Builds to cancel: 1 3 5 Cancelling Linux x86-64 tryserver leak test build Cancelling OS X 10.6.2 tryserver build Cancelling Maemo 5 QT tryserver build
This is just the first cut, but I’m excited not to have to use the web interface any more. Please feel free to add further documentation, or even new tools! I’m excited to see what other people can build with this.