[Devel] Making Bugs be able to check up on themselves
Asheesh Laroia
asheesh at asheesh.org
Fri Apr 8 15:20:35 UTC 2011
As Jack and I were sketching out the design of the asynchronous bug
importer at http://piratepad.net/async-bug-importer , we decided that Bug
objects should store enough information so that they can refresh their
data through a method call.
This is the One True Way to fix the Nagios warnings and the fact that we
sometimes show out-of-date bug information -- it will be super easy to
loop over the Bug objects and ask them to refresh themselves.
Jack filed a bug about this: https://openhatch.org/bugs/issue368
Here are my current thoughts about it:
* There are only a few bug trackers that create really stale data.
Two, actually: Our Mozilla Bugzilla importer, and the OpenSolaris
bug tracker.
* I'm going to write this as a patch series and ask for review from
someone else. And I'm not going to deploy until I get someone else's
sign-off.
* Once we deploy it, I think we should adjust the Nagios warnings to add 1
day -- so it gives a WARNING if there are bugs older than 2 days, and a
CRITICAL notification if there are any older than 3 days.
Once we land Jack's burgeoning work on doing the bug tracker imports
more efficiently (anynchronously), then we should bump that back down to 1
day for WARNING and 2 days for CRITICAL.
DATA
Here is how I checked up on which bug trackers are leaving stale data
in the database. I did './bin/production shell_plus' on the deployment,
and wrote the following code interactively:
In [1]: import datetime
In [2]: two_days_ago = (datetime.datetime.now() -
...: datetime.timedelta(days=2))
...:
In [4]: very_stale = Bug.all_bugs.filter(
...: last_polled__lt=two_days_ago)
In [5]: project_names = sorted(set([b.project.name for b in
very_stale]))
In [6]: project_names
Out[6]: [u'Firefox', u'Mozilla Core', u'OpenSolaris OS/Net',
u'mozilla.org']
-- Asheesh.
More information about the Devel
mailing list