← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stevenk/launchpad/drop-bug-information_type-migrator into lp:launchpad

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/drop-bug-information_type-migrator into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~stevenk/launchpad/drop-bug-information_type-migrator/+merge/98757

Drop the bug.information_type migrator garbo job, it's done on all four instances.
-- 
https://code.launchpad.net/~stevenk/launchpad/drop-bug-information_type-migrator/+merge/98757
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/drop-bug-information_type-migrator into lp:launchpad.
=== modified file 'lib/lp/scripts/garbo.py'
--- lib/lp/scripts/garbo.py	2012-03-16 05:41:21 +0000
+++ lib/lp/scripts/garbo.py	2012-03-21 22:58:19 +0000
@@ -1092,28 +1092,6 @@
         self.offset += chunk_size
 
 
-class BugsInformationTypeMigrator(TunableLoop):
-    """A `TunableLoop` to populate information_type for all bugs."""
-
-    maximum_chunk_size = 5000
-
-    def __init__(self, log, abort_time=None):
-        super(BugsInformationTypeMigrator, self).__init__(log, abort_time)
-        self.transaction = transaction
-        self.store = IMasterStore(Bug)
-
-    def findBugs(self):
-        return self.store.find(Bug, Bug.information_type == None)
-
-    def isDone(self):
-        return self.findBugs().is_empty()
-
-    def __call__(self, chunk_size):
-        for bug in self.findBugs()[:chunk_size]:
-            bug._setInformationType()
-        self.transaction.commit()
-
-
 class BugLegacyAccessMirrorer(TunableLoop):
     """A `TunableLoop` to populate the access policy schema for all bugs."""
 
@@ -1399,7 +1377,6 @@
         UnusedSessionPruner,
         DuplicateSessionPruner,
         BugHeatUpdater,
-        BugsInformationTypeMigrator,
         BugLegacyAccessMirrorer,
         ]
     experimental_tunable_loops = []

=== modified file 'lib/lp/scripts/tests/test_garbo.py'
--- lib/lp/scripts/tests/test_garbo.py	2012-03-16 05:41:21 +0000
+++ lib/lp/scripts/tests/test_garbo.py	2012-03-21 22:58:19 +0000
@@ -54,7 +54,6 @@
     )
 from lp.code.model.codeimportevent import CodeImportEvent
 from lp.code.model.codeimportresult import CodeImportResult
-from lp.registry.enums import InformationType
 from lp.registry.interfaces.accesspolicy import IAccessArtifactSource
 from lp.registry.interfaces.distribution import IDistributionSet
 from lp.registry.interfaces.person import IPersonSet
@@ -1106,16 +1105,6 @@
         self.assertEqual(whiteboard, spec.whiteboard)
         self.assertEqual(0, spec.work_items.count())
 
-    def test_BugsInformationTypeMigrator(self):
-        # A non-migrated bug will have information_type set correctly.
-        switch_dbuser('testadmin')
-        bug = self.factory.makeBug(private=True)
-        # Since creating a bug will set information_type, unset it.
-        removeSecurityProxy(bug).information_type = None
-        transaction.commit()
-        self.runHourly()
-        self.assertEqual(InformationType.USERDATA, bug.information_type)
-
     def test_BugLegacyAccessMirrorer(self):
         # Private bugs without corresponding data in the access policy
         # schema get mirrored.