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" \
--outputformat="%{bug_id}|%{bug_status}|%{product}|%{component}|%{short_desc}" |
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 ***
In Fedora:
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
[etc]
You can download the script here: http://oirase.annexia.org/tmp/bugs-report.ml.txt

You could have used Bugzilla whining feature (https://bugzilla.redhat.com/editwhines.cgi)
It’s not as flexible as getting the data into your own script from where you can present it properly.
This seems to be just for Red Hat employees, I get:
“Sorry, you aren’t a member of the ‘bz_canusewhines’ group, and so you are not authorized to schedule whine reports.”
I don’t know whether or not the “whining” feature is just for Red Hat employees, but the bugzilla command line tool should work for anyone.
Thanks for this.
The Bugzilla black-hole as you call it is a real problem. Users would really benefit from a dashboard-like front page (dare i say web 2.0) showing things like would show recent activity i.e.
1. recently opened bugs
2. recently closed bugs
3. bugs with new comments
4. number of open bugs per product
etc
“Bugs I recently visited” would also be useful.
We explored navigation ideas around this for cocanwiki, although the “pages I recently visited” option only works on cocanwiki if you’re logged in (it should work for everyone of course).
Hey Rich,
Have you taken a look at BugZilla’s built in Frontpage feature? Kinda like whines I guess, but anyone can get access to it if they’ve a Bugzilla login:
https://bugzilla.redhat.com/frontpage.cgi
Sounds like this could be easily added to the existing Frontpage…
https://bugzilla.redhat.com/frontpage.cgi
In fact, what RMWJ is looking for probably could mostly be done in the existing front page. Granted a cron script is cool
Well the frontpage is a good example of how not to present information. Anyway, getting the information out of the BZ database and into your own script allows infinite possibilities.
I guess I’m just a bit confused how this differs from your regular Bugzilla inbox; that uses the exact same ‘bugs of interest’ criteria, so far as I can see. You don’t get emailed about all bugs, only bugs you reported, that are assigned to you, or that you’re in the CC list for.
The email format could probably be improved a bit – it’d be nice to have any actual state changes summarized in the topic, for e.g. – but I don’t find it horrible enough to have ever wanted to create such a script. And I get a lot of bug mail
The % names python-bugzilla uses, btw, come from Bugzilla itself; you can find ‘em in the Bugzilla source somewhere, or if it’s something you can search on in the Bugzilla web interface, just do such a search and look at the resulting URL; it’ll have the field name in it.
It’s different because I get a weekly summary, instead of random spam every few minutes.
Hello Rich,
It seems that http://www.annexia.org/tmp/bugs-report.ml.txt is not longer valid? Can you please post again? It seems like a cool utility.
I’ve moved it here:
http://oirase.annexia.org/tmp/bugs-report.ml.txt
Thanks.