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:

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.

But strangely enough, if I enter a different (deliberately wrong) password, it doesn’t give that error message at all, but instead after a long timeout:
“Error: couldn’t authenticate: maximum recursion depth exceeded while calling a Python object”

I’m now unable to log into the standard self-serve page; I get continual requests for my authentication details.

The first time I tried the cancel python script I entered the wrong password – so I can only think that it continually retried the wrong password (even though I only entered the incorrect password once) and now has locked me out of my LDAP account?

I’m getting “Error: couldn’t authenticate: HTTP Error 401: Authorization Required” too on windows, although the same username and password work just fine for the web site. It’s a shame too because I have 21 changesets to retrigger builds on that this would make a lot easier.