{"id":92,"date":"2011-03-29T23:38:06","date_gmt":"2011-03-30T03:38:06","guid":{"rendered":"http:\/\/www.joshmatthews.net\/blog\/?p=92"},"modified":"2011-06-15T18:50:14","modified_gmt":"2011-06-15T22:50:14","slug":"self-serve-now-in-bulk","status":"publish","type":"post","link":"https:\/\/www.joshmatthews.net\/blog\/2011\/03\/self-serve-now-in-bulk\/","title":{"rendered":"Self-serve, now in bulk"},"content":{"rendered":"<p><strong>Update:<\/strong> the tool is now easier to use and doesn&#8217;t require adding your password as an argument. See <a href=\"http:\/\/www.joshmatthews.net\/blog\/2011\/04\/build-cancellation-from-the-console-gets-some-loving\/\">this post<\/a> for more details.<\/p>\n<p>I&#8217;m a big fan of the <a href=\"https:\/\/build.mozilla.org\/buildapi\/self-serve\/\">self-serve tool<\/a> 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&#8217;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 &#8211; <a href=\"http:\/\/hg.mozilla.org\/users\/josh_joshmatthews.net\/self-serve-tools\/\">self-serve tools<\/a>.  <code>selfserve.py<\/code> contains simple wrappers for every API point exposed, and some basic documentation of the values returned by most of the calls.  <code>cancel.py<\/code> is an example of a really simple tool that can be built on top of the wrappers to allow for bulk cancellation.  Here&#8217;s what a session looks like:<\/p>\n<pre>[jdm@Phaethon self-serve-tools]$ python cancel.py -u \"jmatthews@mozilla.com\" -p my5ecureP4ssword123 -r 306838f27b33 -b try\r\n1: Linux x86-64 tryserver leak test build\r\n2: Linux tryserver build\r\n3: OS X 10.6.2 tryserver build\r\n4: WINNT 5.2 tryserver build\r\n5: Maemo 5 QT tryserver build\r\n6: OS X 10.6.2 tryserver leak test build\r\n7: Maemo 5 GTK tryserver build\r\n8: Android R7 tryserver build\r\n9: Linux tryserver leak test build\r\n10: WINNT 5.2 tryserver leak test build\r\n11: OS X 10.5.2 tryserver leak test build\r\n12: Linux QT tryserver build\r\n13: Linux x86-64 tryserver build\r\n14: all\r\nBuilds to cancel: 1 3 5\r\nCancelling Linux x86-64 tryserver leak test build\r\nCancelling OS X 10.6.2 tryserver build\r\nCancelling Maemo 5 QT tryserver build\r\n<\/pre>\n<p>This is just the first cut, but I&#8217;m excited not to have to use the web interface any more.  Please feel free to add further documentation, or even new tools!  I&#8217;m excited to see what other people can build with this.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update: the tool is now easier to use and doesn&#8217;t require adding your password as an argument. See this post for more details. I&#8217;m a big fan of the self-serve tool that RelEng provided for people with LDAP access. When &hellip; <a href=\"https:\/\/www.joshmatthews.net\/blog\/2011\/03\/self-serve-now-in-bulk\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,15,22],"tags":[],"class_list":["post-92","post","type-post","status-publish","format-standard","hentry","category-code","category-mozilla","category-projects"],"_links":{"self":[{"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/posts\/92","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/comments?post=92"}],"version-history":[{"count":5,"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/posts\/92\/revisions"}],"predecessor-version":[{"id":113,"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/posts\/92\/revisions\/113"}],"wp:attachment":[{"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/media?parent=92"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/categories?post=92"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joshmatthews.net\/blog\/wp-json\/wp\/v2\/tags?post=92"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}