Merge ~cjwatson/launchpad:revision-status-report-longer-retention into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 8a8d668826f79a5d66bda081687bebb718dcfebb
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:revision-status-report-longer-retention
Merge into: launchpad:master
Diff against target: 36 lines (+4/-4)
2 files modified
lib/lp/scripts/garbo.py (+1/-1)
lib/lp/scripts/tests/test_garbo.py (+3/-3)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+425194@code.launchpad.net

Commit message

Bump RevisionStatusReport retention period to 90 days

Description of the change

Keeping artifacts around for a bit longer is useful when preparing publications to Artifactory, and we have plenty of librarian space these days.

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/scripts/garbo.py b/lib/lp/scripts/garbo.py
2index 90736eb..b5120b4 100644
3--- a/lib/lp/scripts/garbo.py
4+++ b/lib/lp/scripts/garbo.py
5@@ -1805,7 +1805,7 @@ class PopulateSnapBuildStoreRevision(TunableLoop):
6
7 class RevisionStatusReportPruner(BulkPruner):
8 """Removes old revision status reports and their artifacts."""
9- older_than = 30 # artifacts older than 30 days
10+ older_than = 90 # artifacts older than 90 days
11 target_table_class = RevisionStatusArtifact
12 ids_to_prune_query = """
13 SELECT DISTINCT RevisionStatusArtifact.id
14diff --git a/lib/lp/scripts/tests/test_garbo.py b/lib/lp/scripts/tests/test_garbo.py
15index 1a26ca7..65b908c 100644
16--- a/lib/lp/scripts/tests/test_garbo.py
17+++ b/lib/lp/scripts/tests/test_garbo.py
18@@ -2091,15 +2091,15 @@ class TestGarbo(FakeAdapterMixin, TestCaseWithFactory):
19 self.assertEqual(build1._store_upload_revision, 1)
20
21 def test_RevisionStatusReportPruner(self):
22- # Artifacts for report1 are older than 30 days
23+ # Artifacts for report1 are older than 90 days
24 # and we expect the garbo job to delete them.
25- # Artifacts for report2 are newer then 30 days and
26+ # Artifacts for report2 are newer than 90 days and
27 # we expect them to survive the garbo job.
28 switch_dbuser('testadmin')
29 now = datetime.now(UTC)
30 report1 = removeSecurityProxy(self.factory.makeRevisionStatusReport())
31 report2 = self.factory.makeRevisionStatusReport()
32- report1.date_created = now - timedelta(days=60)
33+ report1.date_created = now - timedelta(days=120)
34 repo1 = report1.git_repository
35 repo2 = report2.git_repository
36 artifact1_1 = self.factory.makeRevisionStatusArtifact(

Subscribers

People subscribed via source and target branches

to status/vote changes: