Skip to content

Instantly share code, notes, and snippets.

@dpino
Created March 12, 2019 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpino/aec7d9d8245229a776a80192486ba56f to your computer and use it in GitHub Desktop.
Save dpino/aec7d9d8245229a776a80192486ba56f to your computer and use it in GitHub Desktop.
WPE & GTK WebKit build bots status
#!/usr/bin/env python
import urllib
import json
from urllib2 import urlopen
bots_names = [
"WPE Linux 64-bit Release (Build)",
"WPE Linux 64-bit Debug (Build)",
"GTK Linux 64-bit Release (Build)",
"GTK Linux 64-bit Debug (Build)",
]
def last_build_url(bot_name):
return "https://build.webkit.org/json/builders/%s/builds?select=-2&as_text=1" % urllib.quote(bot_name)
def short_comment(c):
lines = []
for line in c.splitlines():
if line.startswith("Reviewed by"):
break
lines.append(line)
return " ".join(lines)
def commit_message(t):
comments = short_comment(t["comments"])
revision = t["revision"]
at = t["at"]
who = t["who"]
return "r%s: %s(%s, %s)" % (str(revision), comments, at, who)
def build_failed(r):
status = r['text'][0]
return status == 'failed'
def build_bot_message(r):
builderName, number = (r['builderName'], r['number'])
build_url = "https://build.webkit.org/builders/%s/builds/%d" % (urllib.quote(builderName), number)
status = r['text'][0]
msg = ["%s %s (%s)" % (builderName, status, build_url)]
if build_failed(r):
step = r['text'][1]
if step == 'compile':
change = r['sourceStamp']['changes'][0]
msg.append(commit_message(change))
return "\n".join(msg)
def query(url):
try:
response = urlopen(url)
data = response.read().decode("utf-8")
return json.loads(data)
except:
return None
if __name__ == '__main__':
for each in bots_names:
response = query(last_build_url(each))
if response:
print(build_bot_message(response['-2']))
@dpino
Copy link
Author

dpino commented Mar 12, 2019

Example:

$ ./build_bots_status.py
WPE Linux 64-bit Release (Build) build (https://build.webkit.org/builders/WPE%20Linux%2064-bit%20Release%20%28Build%29/builds/19352)
WPE Linux 64-bit Debug (Build) build (https://build.webkit.org/builders/WPE%20Linux%2064-bit%20Debug%20%28Build%29/builds/7973)
GTK Linux 64-bit Release (Build) build (https://build.webkit.org/builders/GTK%20Linux%2064-bit%20Release%20%28Build%29/builds/20146)
GTK Linux 64-bit Debug (Build) build (https://build.webkit.org/builders/GTK%20Linux%2064-bit%20Debug%20%28Build%29/builds/19778)

Example of failure:

WPE Linux 64-bit Release (Build) failed (https://build.webkit.org/builders/WPE%20Linux%2064-bit%20Release%20%28Build%29/builds/19352)
r242791: [Media][MSE] Don't emit timeUpdate after play() if currentTime hasn't changed https://bugs.webkit.org/show_bug.cgi?id=195454 (Tue 12 Mar 2019 04:09:45, eocanha@igalia.com)
WPE Linux 64-bit Debug (Build) failed (https://build.webkit.org/builders/WPE%20Linux%2064-bit%20Debug%20%28Build%29/builds/7973)
r242791: [Media][MSE] Don't emit timeUpdate after play() if currentTime hasn't changed https://bugs.webkit.org/show_bug.cgi?id=195454 (Tue 12 Mar 2019 04:09:45, eocanha@igalia.com)
GTK Linux 64-bit Release (Build) failed (https://build.webkit.org/builders/GTK%20Linux%2064-bit%20Release%20%28Build%29/builds/20146)
r242791: [Media][MSE] Don't emit timeUpdate after play() if currentTime hasn't changed https://bugs.webkit.org/show_bug.cgi?id=195454 (Tue 12 Mar 2019 04:09:45, eocanha@igalia.com)
GTK Linux 64-bit Debug (Build) failed (https://build.webkit.org/builders/GTK%20Linux%2064-bit%20Debug%20%28Build%29/builds/19778)
r242791: [Media][MSE] Don't emit timeUpdate after play() if currentTime hasn't changed https://bugs.webkit.org/show_bug.cgi?id=195454 (Tue 12 Mar 2019 04:09:45, eocanha@igalia.com)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment