request for date-* to parse activity log if +text interface value is empty

Bug #246636 reported by Leann Ogasawara
2
Affects Status Importance Assigned to Milestone
python-launchpad-bugs
Confirmed
Wishlist
Unassigned

Bug Description

I was wanting to find when a bug's Status was set to Confirmed and was using a tasks date-confirmed attribute in python launchpad bugs. However, I noticed in some cases this returns nothing even though the bug is set to Confirmed (eg https://bugs.edge.launchpad.net/ubuntu/+source/openoffice.org/+bug/20767). Apparently the +text interface for the bug is missing the "date-confirmed: . . ." line because this bug was filed prior to launchpad having this capability. It would be great if python launchpad bugs could not only look at the +text interface for the date-confirmed line but also as a secondary step maybe parse the activity log to get this information. Thanks.

Revision history for this message
Brian Murray (brian-murray) wrote :

Using the activity log as a fall back mechanism should work for every status change date.

Changed in python-launchpad-bugs:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Markus Korn (thekorn) wrote :

I thought about a kind of fall back mechanism some time ago and unfortunately I did not find a good idea how this could fit into the current design of py-lp-bugs. I came to the conclusion that the best way to achieve such a fall back would be in the end user script, something like:

     =====
In [32]: from launchpadbugs.connector import ConnectBug

In [33]: TBug = ConnectBug("text")

In [34]: HBug = ConnectBug()

In [35]: tbug = TBug(20767)

In [36]: ttask = tbug.infotable[1]

In [37]: date_confirmed = ttask.date_confirmed

In [38]: if date_confirmed is None:
   ....: try:
   ....: hbug = HBug(20767)
   ....: date_confirmed = [i.date for i in hbug.activity if "openoffice.org" in i.what and i.new_value == "Confirmed"][-1]
   ....: except:
   ....: pass
   ....:
   ....:

In [39]: date_confirmed
Out[39]: LPTime(2008, 2, 10, 19, 26)
     =====

Bug getting good information out of activity logs is sometimes (especially for older bugreports) a pain, because there are sometimes some bugzilla values in activity logs, sometimes the names of the packages are different and they are also sometimes missing some information.

If you agree I would like to change the scope of this bugreport a little bit and add helper methods to the ActivityLog-class which works like
>>> bug.activity.get_date("confirmed", "openoffice.org")

Markus

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Having something like bug.activity.get_date("confirmed", "openoffice.org") would be great. Thanks!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.