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
1=== modified file 'src/oopstools/NEWS.txt'
2--- src/oopstools/NEWS.txt 2012-09-11 09:18:49 +0000
3+++ src/oopstools/NEWS.txt 2012-09-18 07:47:23 +0000
4@@ -5,6 +5,11 @@
5 NEXT
6 ====
7
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+
13 0.6.3
14 =====
15
16
17=== modified file 'src/oopstools/scripts/prune.py'
18--- src/oopstools/scripts/prune.py 2011-11-21 04:12:51 +0000
19+++ src/oopstools/scripts/prune.py 2012-09-18 07:47:23 +0000
20@@ -114,7 +114,8 @@
21 # The tracker finds all the references for the selected dates.
22 finder = tracker(options)
23 references = finder.find_oops_references(
24- prune_from, prune_until, options.project, options.projectgroup)
25+ prune_from, datetime.datetime.now(utc), options.project,
26+ options.projectgroup)
27 # Then we can delete the unreferenced oopses.
28 PruneInfo.prune_unreferenced(prune_from, prune_until, references)
29 # And finally save the fact we have scanned up to the selected date.

Subscribers

People subscribed via source and target branches

to all changes: