launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #15623
[Merge] lp:~stevenk/launchpad/drop-obsolete-series-garbo into lp:launchpad
Steve Kowalik has proposed merging lp:~stevenk/launchpad/drop-obsolete-series-garbo into lp:launchpad with lp:~stevenk/launchpad/obsolete-series-garbo as a prerequisite.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~stevenk/launchpad/drop-obsolete-series-garbo/+merge/165537
Drop the PopulateArchivePermitObsoleteSeriesUploads garbo job.
--
https://code.launchpad.net/~stevenk/launchpad/drop-obsolete-series-garbo/+merge/165537
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/drop-obsolete-series-garbo into lp:launchpad.
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg 2013-05-24 05:22:30 +0000
+++ database/schema/security.cfg 2013-05-20 01:11:49 +0000
@@ -2208,7 +2208,6 @@
public.accesspolicygrant = SELECT, DELETE
public.account = SELECT, DELETE
public.answercontact = SELECT, DELETE
-public.archive = SELECT, UPDATE
public.branch = SELECT, UPDATE
public.branchjob = SELECT, DELETE
public.binarypackagename = SELECT
=== modified file 'lib/lp/scripts/garbo.py'
--- lib/lp/scripts/garbo.py 2013-05-24 05:22:30 +0000
+++ lib/lp/scripts/garbo.py 2013-05-20 01:11:49 +0000
@@ -40,7 +40,6 @@
Or,
Row,
SQL,
- Update,
)
from storm.info import ClassAlias
from storm.store import EmptyResultSet
@@ -1366,36 +1365,6 @@
transaction.commit()
-class PopulateArchivePermitObsoleteSeriesUploads(TunableLoop):
-
- maximum_chunk_size = 5000
-
- def __init__(self, log, abort_time=None):
- super(PopulateArchivePermitObsoleteSeriesUploads, self).__init__(
- log, abort_time)
- self.start_at = 1
- self.store = IMasterStore(Archive)
-
- def findArchiveIDs(self):
- return self.store.find(
- Archive.id,
- Archive.permit_obsolete_series_uploads == None,
- Archive.id >= self.start_at).order_by(Archive.id)
-
- def isDone(self):
- return self.findArchiveIDs().is_empty()
-
- def __call__(self, chunk_size):
- archive_ids = list(self.findArchiveIDs()[:chunk_size])
- self.store.execute(
- Update(
- {Archive.permit_obsolete_series_uploads: False},
- Archive.id.is_in(archive_ids),
- Archive))
- self.start_at = archive_ids[-1] + 1
- transaction.commit()
-
-
class BaseDatabaseGarbageCollector(LaunchpadCronScript):
"""Abstract base class to run a collection of TunableLoops."""
script_name = None # Script name for locking and database user. Override.
@@ -1650,7 +1619,6 @@
UnusedSessionPruner,
DuplicateSessionPruner,
BugHeatUpdater,
- PopulateArchivePermitObsoleteSeriesUploads,
]
experimental_tunable_loops = []
=== modified file 'lib/lp/scripts/tests/test_garbo.py'
--- lib/lp/scripts/tests/test_garbo.py 2013-05-24 05:22:30 +0000
+++ lib/lp/scripts/tests/test_garbo.py 2013-05-20 01:11:49 +0000
@@ -1296,14 +1296,6 @@
'PopulateLatestPersonSourcePackageReleaseCache')
self.assertEqual(spph_2.id, job_data['last_spph_id'])
- def test_PopulateArchivePermitObsoleteSeriesUploads(self):
- switch_dbuser('testadmin')
- archive = self.factory.makeArchive()
- removeSecurityProxy(archive).permit_obsolete_series_uploads = None
- transaction.commit()
- self.runHourly()
- self.assertIs(False, archive.permit_obsolete_series_uploads)
-
class TestGarboTasks(TestCaseWithFactory):
layer = LaunchpadZopelessLayer