Merge lp:~wgrant/python-oops-tools/bug-1050722 into lp:python-oops-tools

Proposed by William Grant
Status: Merged
Approved by: William Grant
Approved revision: 43
Merged at revision: 42
Proposed branch: lp:~wgrant/python-oops-tools/bug-1050722
Merge into: lp:python-oops-tools
Diff against target: 29 lines (+7/-1)
2 files modified
src/oopstools/NEWS.txt (+5/-0)
src/oopstools/scripts/prune.py (+2/-1)
To merge this branch: bzr merge lp:~wgrant/python-oops-tools/bug-1050722
Reviewer Review Type Date Requested Status
Richard Harding (community) Approve
Review via email: mp+124852@code.launchpad.net

Commit message

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.

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Richard Harding (rharding) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/oopstools/NEWS.txt'
--- src/oopstools/NEWS.txt 2012-09-11 09:18:49 +0000
+++ src/oopstools/NEWS.txt 2012-09-18 07:47:23 +0000
@@ -5,6 +5,11 @@
5NEXT5NEXT
6====6====
77
8* When pruning, look for OOPS references up to now rather than up to
9 prune_until. Otherwise we miss any references created in the last
10 week, probably only finding references within 24 hours of the OOPS
11 occurring. (William Grant, #1050722)
12
80.6.3130.6.3
9=====14=====
1015
1116
=== modified file 'src/oopstools/scripts/prune.py'
--- src/oopstools/scripts/prune.py 2011-11-21 04:12:51 +0000
+++ src/oopstools/scripts/prune.py 2012-09-18 07:47:23 +0000
@@ -114,7 +114,8 @@
114 # The tracker finds all the references for the selected dates.114 # The tracker finds all the references for the selected dates.
115 finder = tracker(options)115 finder = tracker(options)
116 references = finder.find_oops_references(116 references = finder.find_oops_references(
117 prune_from, prune_until, options.project, options.projectgroup)117 prune_from, datetime.datetime.now(utc), options.project,
118 options.projectgroup)
118 # Then we can delete the unreferenced oopses.119 # Then we can delete the unreferenced oopses.
119 PruneInfo.prune_unreferenced(prune_from, prune_until, references)120 PruneInfo.prune_unreferenced(prune_from, prune_until, references)
120 # And finally save the fact we have scanned up to the selected date.121 # And finally save the fact we have scanned up to the selected date.

Subscribers

People subscribed via source and target branches

to all changes: