← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/python-oops-datedir-repo/bug-1050722 into lp:python-oops-datedir-repo

 

William Grant has proposed merging lp:~wgrant/python-oops-datedir-repo/bug-1050722 into lp:python-oops-datedir-repo.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1050722 in Python OOPS Date-dir repository: "prune only searches for OOPS references up to prune_until"
  https://bugs.launchpad.net/python-oops-datedir-repo/+bug/1050722

For more details, see:
https://code.launchpad.net/~wgrant/python-oops-datedir-repo/bug-1050722/+merge/124851

oops_datedir_repo.prune and oopstools.scripts.prune have faulty reference finding logic. They only search for references up to the pruning threshold (usually a week ago), so OOPSes tend to only get kept if they're referenced within about 24 hours. The fix is trivial: just continue looking up until the current timestamp.
-- 
https://code.launchpad.net/~wgrant/python-oops-datedir-repo/bug-1050722/+merge/124851
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/python-oops-datedir-repo/bug-1050722 into lp:python-oops-datedir-repo.
=== modified file 'NEWS'
--- NEWS	2012-09-03 21:18:30 +0000
+++ NEWS	2012-09-18 07:47:22 +0000
@@ -6,6 +6,11 @@
 NEXT
 ----
 
+* When pruning, look for OOPS references up to now rather than up to
+  prune_until. Otherwise we miss any references created in the last
+  week, probably only finding references within 24 hours of the OOPS
+  occurring. (William Grant, #1050722)
+
 0.0.18
 ------
 

=== modified file 'oops_datedir_repo/prune.py'
--- oops_datedir_repo/prune.py	2011-11-21 00:28:20 +0000
+++ oops_datedir_repo/prune.py	2012-09-18 07:47:22 +0000
@@ -149,7 +149,8 @@
     # The tracker finds all the references for the selected dates.
     finder = tracker(options)
     references = finder.find_oops_references(
-        prune_from, prune_until, options.project, options.projectgroup)
+        prune_from, datetime.datetime.now(utc), options.project,
+        options.projectgroup)
     # Then we can delete the unreferenced oopses.
     repo.prune_unreferenced(prune_from, prune_until, references)
     # And finally save the fact we have scanned up to the selected date.