Hey,

I've put together the following py snippet to fetch some informations
from bugzilla to display the "progress" of our release, based on the
number of remaining (open [modified, new, assigned, post]) bugs.
This is a very rough estimate, but - use existing informations and can
be enhanced to respect the state of a dependency bug.

I tried to do this with JS - for a shiny in browser progressbar with
hyperlinks (!) - but, x-domain ajax request are not really possible ...

Maybe this is of use for someone else.

Just run it with 
python bzp.py

The current (3.2) tracker bug is hardcoded.

Greetings
fabian
#!/bin/env python

#
# Display how many of the oVirt 3.2 bugs depending on bugid
# (currently: tracker for 3.2)are closed
# NEW, ASSIGNED, MODIFIED and POST are all seens as open.
#
bugid = 881006

import urllib
from lxml import etree

trackerurl = "https://bugzilla.redhat.com/showdependencytree.cgi?id={bugid}&hide_resolved={hide_resolved}&ctype=xml";

fetch_xml = lambda u: etree.XML(urllib.urlopen(u).read())
w_resolved = fetch_xml(trackerurl.format(bugid=bugid, hide_resolved=0))
wo_resolved = fetch_xml(trackerurl.format(bugid=bugid, hide_resolved=1))

c_all = w_resolved.xpath("count(//bug)")
c_all_wo_open = wo_resolved.xpath("count(//bug)")
c_closed = int(c_all - c_all_wo_open)
c_open = int(c_all - c_closed)

# Width of the ASCII chart
width = 15
percentile = 1.0 / c_all * c_closed
closed_w = int(percentile * width)

print("[" + "=" * closed_w + " " * (width - closed_w) + "]")
print("%.2f%% (%d/%d) Complete" % (100 * percentile, c_closed, c_all))

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Infra mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/infra

Reply via email to