This is my inbox, and it sucks:
Bugzilla is like a black hole for bugs. The search tools fail so badly it’s often impossible to find a bug that you were working on the day before. It’s slow, clumsy, and disorganized.
But one bright point is it has a reasonable command line reporting tool also available as a Fedora package. So I decided yesterday to write a Bugzilla report script and have it email me daily from cron.
The starting point is to identify “bugs of interest”. The bugs of interest to me are:
- bugs I reported
- bugs I am assigned to fix
- bugs I’m CC’d on
I put some thought into this set of criteria for bugs:
- I should be able to register an interest in any bug: Yes, by adding myself to the CC field.
- I should be able to unregister an interest: Yes, by removing myself from the CC, or closing or reassigning those bugs where I’m reporter or assignee.
- It shouldn’t tell me about bugs I’m not interested in: Yes, I would be reporter, assignee or in the CC list for any bug related to me or a package I maintain.
- It shouldn’t miss out any bugs I might be interested in: Yes, if I’ve ever added a comment, I will be in the CC field at least, and I can always unregister myself from any I no longer care about.
With the command line tool, getting the raw list of bug IDs is very simple.
for flag in -r -c -a; do
bugzilla query $flag $email -i
done | sort -n -u
(replacing $email with your email address, or even mine if you so care).
That pulls out 781 unique bug IDs, the oldest being one I don’t remember reporting and the most recent being a virt-v2v bug. (Note this includes CLOSED bugs which in the script are ignored).
Now I take the list of bug IDs and pull out the other fields I want from the Bugzilla database. The command below is just an illustrative example of what the script does:
$ bugzilla query -b "86308,601092" \
sort -n -t"|"
86308|CLOSED|Red Hat Web Site|Other|Red Hat Command Centre site is down
601092|NEW|Red Hat Enterprise Linux 5|libguestfs|[RFE]Incorrect error msg popped up when missing "-f" in v2v command
As far as I know you have to guess what the %-fields are called. I also had to choose a separator character which wouldn’t appear in any field except the short_desc (which is always the last field), since fields like the product name can and do contain spaces.
The rest of the script is “merely” formatting this whole lot into a nice looking email report:
Bugs in OPEN states:
*** coccinelle ***
502185 coccinelle segfaults on ppc64
579457 coccinelle-0.2.3rc1 is available
*** e2fsprogs ***
In Red Hat Enterprise Linux 5:
518190 mke2fs -t option in RHEL5 differs vs upstream, leading to confusion
You can download the script here: http://oirase.annexia.org/tmp/bugs-report.ml.txt