Self-serve, now in bulk

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 "jmatthews@mozilla.com" -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.

5 Responses to “Self-serve, now in bulk”

  1. […] Planet Mozilla No Comments March 30, 2011 By Giovanni Panasiti in Planet Mozilla Tags: bulk, Interns, Josh, Matthews, Mozilla, Planet, Selfserve « Ubuntu Unity Launcher Integration Updated […]

  2. Not sure if there is a bug tracker for this anywhere, so I’ll pop this here for now.

    After running the script via the mozilla build environment (on Windows) using:
    python cancel.py -u “foo@bar.co.uk”
    then entering my LDAP pasword

    I get:
    “Error: couldn’t authenticate: HTTP Error 401: Authorization Required”

    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”

    Any ideas?

    Thanks :-)

  3. 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?

  4. 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.

  5. Cool script. Sadly I get an error running it. Perhaps this has to do with my ldap/commit user name being different?

    Traceback (most recent call last):
    File “cancel.py”, line 53, in
    multipleAllowed=False)]
    File “/Users/benoitgirard/mozilla/tools/self-serve-tools/utils.py”, line 26, in choose
    if multipleAllowed or choices[0].isdigit():
    AttributeError: ‘int’ object has no attribute ‘isdigit’

Leave a Reply