def main(args): if len(args) < 1: print "Syntax: release_notes.py <milestone>" return 0 logging.basicConfig(level=logging.INFO) milestone = args[0] logging.info("Querying bugzilla....") rows = bugzillalib.bz_query(BZ_HOST, [ ("query_format", "advanced"), ("product", "Miro"), ("bug_status", "RESOLVED"), ("bug_status", "VERIFIED"), ("resolution", "FIXED"), ("target_milestone", milestone), ("ctype", "csv") ]) rows.sort(key=lambda x: (x["op_sys"], int(x["bug_id"]))) logging.info("Calculating enhancements....") enhancements = [r for r in rows if r["bug_severity"] == "enhancement"] enhancements.sort(key=lambda x: int(x["bug_id"])) logging.info("Calculating bugfixes....") bugfixes = get_bugfixes([r for r in rows if r["bug_severity"] != "enhancement"]) bugfixes.sort(key=lambda x: int(x["bug_id"])) logging.info("Creating output....") output = [] output.append("== Changes and bug fixes in Miro %s (pending) ==" % ( milestone)) output.append("") output.append("* New features") for row in enhancements: output.append("** [[bz:%s]] (%s) %s" % ( row["bug_id"], row["op_sys"], row["short_desc"])) output.append("") output.append("* Bug fixes") for row in bugfixes: output.append("** [[bz:%s]] (%s) %s" % ( row["bug_id"], row["op_sys"], row["short_desc"])) logging.info("Writing releasenotes.txt....") with open("releasenotes.txt", "w") as fp: fp.write("\n".join(output)) return 0
def main(args): if len(args) < 1: print "Syntax: release_notes.py <milestone>" return 0 logging.basicConfig(level=logging.INFO) milestone = args[0] logging.info("Querying bugzilla....") rows = bugzillalib.bz_query(BZ_HOST, [("query_format", "advanced"), ("product", "Miro"), ("bug_status", "RESOLVED"), ("bug_status", "VERIFIED"), ("resolution", "FIXED"), ("target_milestone", milestone), ("ctype", "csv")]) rows.sort(key=lambda x: (x["op_sys"], int(x["bug_id"]))) logging.info("Calculating enhancements....") enhancements = [r for r in rows if r["bug_severity"] == "enhancement"] enhancements.sort(key=lambda x: int(x["bug_id"])) logging.info("Calculating bugfixes....") bugfixes = get_bugfixes( [r for r in rows if r["bug_severity"] != "enhancement"]) bugfixes.sort(key=lambda x: int(x["bug_id"])) logging.info("Creating output....") output = [] output.append("== Changes and bug fixes in Miro %s (pending) ==" % (milestone)) output.append("") output.append("* New features") for row in enhancements: output.append("** [[bz:%s]] (%s) %s" % (row["bug_id"], row["op_sys"], row["short_desc"])) output.append("") output.append("* Bug fixes") for row in bugfixes: output.append("** [[bz:%s]] (%s) %s" % (row["bug_id"], row["op_sys"], row["short_desc"])) logging.info("Writing releasenotes.txt....") with open("releasenotes.txt", "w") as fp: fp.write("\n".join(output)) return 0
def get_bugzilla_reporters(milestone): logging.info("pulling bugzilla reporters/commenters....") reporters = {} rows = bugzillalib.bz_query("bugzilla.pculture.org", [ ("query_format", "advanced"), ("product", "Miro"), ("bug_status", "RESOLVED"), ("bug_status", "VERIFIED"), ("resolution", "FIXED"), ("target_milestone", milestone), ("order", "Bug Number"), ("ctype", "csv") ]) bug_ids = [row["bug_id"] for row in rows] for bug_id in bug_ids: logging.info("... working on bug %s", bug_id) try: etree = bugzillalib.bz_query_bug_id("bugzilla.pculture.org", bug_id) except socket.error, se: logging.error("... error %s -- skipping", se) bug = etree.find("bug") reporter = bug.find("reporter") if reporter is None: logging.info("reporter is None") continue reporter = get_name(reporter) reporter = clean_up_name(reporter) reporter = (reporter, "bug reporter") reporters[reporter] = reporters.get(reporter, 0) + 1 descs = bug.getiterator("long_desc") for desc in descs: commenter = desc.find("who") if commenter is None: logging.info("commenter is None") continue commenter = get_name(commenter) commenter = clean_up_name(commenter) commenter = (commenter, "bug reporter") reporters[commenter] = reporters.get(commenter, 0) + 1