← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/flatten-bfj-2.5-destroy-garbo into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/flatten-bfj-2.5-destroy-garbo into lp:launchpad with lp:~wgrant/launchpad/flatten-bfj-2-garbo as a prerequisite.

Commit message:
Drop the temporary BPB/SPRB/TTB flattener garbo jobs.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #758258 in Launchpad itself: "buildfarmjob schema is inefficient for reporting"
  https://bugs.launchpad.net/launchpad/+bug/758258

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/flatten-bfj-2.5-destroy-garbo/+merge/146337

Drop the temporary BPB/SPRB/TTB flattener garbo jobs.
-- 
https://code.launchpad.net/~wgrant/launchpad/flatten-bfj-2.5-destroy-garbo/+merge/146337
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/flatten-bfj-2.5-destroy-garbo into lp:launchpad.
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg	2013-01-31 07:25:36 +0000
+++ database/schema/security.cfg	2013-02-04 03:51:21 +0000
@@ -2218,7 +2218,6 @@
 public.answercontact                    = SELECT, DELETE
 public.branch                           = SELECT, UPDATE
 public.branchjob                        = SELECT, DELETE
-public.binarypackagebuild               = SELECT, UPDATE
 public.binarypackagename                = SELECT
 public.binarypackagerelease             = SELECT
 public.binarypackagepublishinghistory   = SELECT, UPDATE
@@ -2241,7 +2240,6 @@
 public.bugtaskflat                      = SELECT
 public.bugwatch                         = SELECT, UPDATE
 public.bugwatchactivity                 = SELECT, DELETE
-public.buildfarmjob                     = SELECT, UPDATE
 public.codeimportevent                  = SELECT, DELETE
 public.codeimporteventdata              = SELECT, DELETE
 public.codeimportresult                 = SELECT, DELETE
@@ -2265,7 +2263,6 @@
 public.revisionauthor                   = SELECT, UPDATE
 public.revisioncache                    = SELECT, DELETE
 public.sourcepackagename                = SELECT
-public.sourcepackagerecipebuild         = SELECT, UPDATE
 public.sourcepackagerelease             = SELECT
 public.sourcepackagepublishinghistory   = SELECT, UPDATE
 public.suggestivepotemplate             = INSERT, DELETE
@@ -2273,7 +2270,6 @@
 public.teamparticipation                = SELECT, DELETE
 public.translationmessage               = SELECT, DELETE
 public.translationtemplateitem          = SELECT, DELETE
-public.translationtemplatesbuild        = SELECT, UPDATE
 type=user
 
 [garbo_daily]

=== modified file 'lib/lp/scripts/garbo.py'
--- lib/lp/scripts/garbo.py	2013-02-04 01:59:37 +0000
+++ lib/lp/scripts/garbo.py	2013-02-04 03:51:21 +0000
@@ -57,8 +57,6 @@
     BugWatchScheduler,
     MAX_SAMPLE_SIZE,
     )
-from lp.buildmaster.model.buildfarmjob import BuildFarmJob
-from lp.buildmaster.model.packagebuild import PackageBuild
 from lp.code.interfaces.revision import IRevisionSet
 from lp.code.model.codeimportevent import CodeImportEvent
 from lp.code.model.codeimportresult import CodeImportResult
@@ -66,10 +64,8 @@
     RevisionAuthor,
     RevisionCache,
     )
-from lp.code.model.sourcepackagerecipebuild import SourcePackageRecipeBuild
 from lp.hardwaredb.model.hwdb import HWSubmission
 from lp.registry.model.commercialsubscription import CommercialSubscription
-from lp.registry.model.distroseries import DistroSeries
 from lp.registry.model.person import Person
 from lp.registry.model.product import Product
 from lp.registry.model.teammembership import TeamMembership
@@ -108,7 +104,6 @@
 from lp.services.librarian.model import TimeLimitedToken
 from lp.services.log.logger import PrefixFilter
 from lp.services.looptuner import TunableLoop
-from lp.services.memcache.interfaces import IMemcacheClient
 from lp.services.oauth.model import OAuthNonce
 from lp.services.openid.model.openidconsumer import OpenIDConsumerNonce
 from lp.services.propertycache import cachedproperty
@@ -123,10 +118,7 @@
     )
 from lp.services.session.model import SessionData
 from lp.services.verification.model.logintoken import LoginToken
-from lp.soyuz.interfaces.archive import MAIN_ARCHIVE_PURPOSES
 from lp.soyuz.model.archive import Archive
-from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild
-from lp.soyuz.model.distroarchseries import DistroArchSeries
 from lp.soyuz.model.publishing import SourcePackagePublishingHistory
 from lp.soyuz.model.reporting import LatestPersonSourcePackageReleaseCache
 from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
@@ -137,9 +129,6 @@
 from lp.translations.model.translationtemplateitem import (
     TranslationTemplateItem,
     )
-from lp.translations.model.translationtemplatesbuild import (
-    TranslationTemplatesBuild,
-    )
 from lp.translations.scripts.scrub_pofiletranslator import (
     ScrubPOFileTranslator,
     )
@@ -1346,6 +1335,7 @@
         transaction.commit()
 
 
+<<<<<<< TREE
 class BinaryPackageBuildFlattener(TunableLoop):
     """Populates the new denormalised columns on BinaryPackageBuild."""
 
@@ -1559,6 +1549,8 @@
         getUtility(IMemcacheClient).set(self.memcache_key, self.start_at)
 
 
+=======
+>>>>>>> MERGE-SOURCE
 class BaseDatabaseGarbageCollector(LaunchpadCronScript):
     """Abstract base class to run a collection of TunableLoops."""
     script_name = None  # Script name for locking and database user. Override.
@@ -1814,9 +1806,6 @@
         UnusedSessionPruner,
         DuplicateSessionPruner,
         BugHeatUpdater,
-        BinaryPackageBuildFlattener,
-        SourcePackageRecipeBuildFlattener,
-        TranslationTemplatesBuildFlattener,
         ]
     experimental_tunable_loops = []
 

=== modified file 'lib/lp/scripts/tests/test_garbo.py'
--- lib/lp/scripts/tests/test_garbo.py	2013-02-01 02:16:55 +0000
+++ lib/lp/scripts/tests/test_garbo.py	2013-02-04 03:51:21 +0000
@@ -31,7 +31,6 @@
 from testtools.matchers import (
     Equals,
     GreaterThan,
-    MatchesStructure,
     )
 import transaction
 from zope.component import getUtility
@@ -43,7 +42,6 @@
     BugNotification,
     BugNotificationRecipient,
     )
-from lp.buildmaster.enums import BuildStatus
 from lp.code.bzr import (
     BranchFormat,
     RepositoryFormat,
@@ -60,7 +58,6 @@
     BranchSharingPolicy,
     BugSharingPolicy,
     )
-from lp.code.model.sourcepackagerecipebuild import SourcePackageRecipeBuild
 from lp.registry.interfaces.accesspolicy import IAccessPolicySource
 from lp.registry.interfaces.person import IPersonSet
 from lp.registry.interfaces.teammembership import TeamMembershipStatus
@@ -117,7 +114,6 @@
 from lp.services.verification.model.logintoken import LoginToken
 from lp.services.worlddata.interfaces.language import ILanguageSet
 from lp.soyuz.enums import PackagePublishingStatus
-from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild
 from lp.soyuz.model.reporting import LatestPersonSourcePackageReleaseCache
 from lp.testing import (
     FakeAdapterMixin,
@@ -125,10 +121,7 @@
     TestCase,
     TestCaseWithFactory,
     )
-from lp.testing.dbuser import (
-    dbuser,
-    switch_dbuser,
-    )
+from lp.testing.dbuser import switch_dbuser
 from lp.testing.layers import (
     DatabaseLayer,
     LaunchpadScriptLayer,
@@ -140,9 +133,6 @@
 from lp.translations.model.translationtemplateitem import (
     TranslationTemplateItem,
     )
-from lp.translations.model.translationtemplatesbuild import (
-    TranslationTemplatesBuild,
-    )
 
 
 class TestGarboScript(TestCase):
@@ -1283,131 +1273,6 @@
             'PopulateLatestPersonSourcePackageReleaseCache')
         self.assertEqual(spph_2.id, job_data['last_spph_id'])
 
-    def test_BinaryPackageBuildFlattener(self):
-        store = IMasterStore(BinaryPackageBuild)
-        # Sampledata builds start off with the new columns set to None,
-        # and garbo won't run without a feature flag set.
-        self.runHourly()
-        self.assertNotEqual(
-            0, store.find(BinaryPackageBuild, _new_archive=None).count())
-
-        # But after a garbo run they're all set properly.
-        with dbuser('testadmin'):
-            IMasterStore(FeatureFlag).add(FeatureFlag(
-                u'default', 0, u'soyuz.flatten_bfj.garbo.enabled', u'true'))
-        self.runHourly()
-        self.assertEqual(
-            0, store.find(BinaryPackageBuild, _new_archive=None).count())
-
-        with dbuser('testadmin'):
-            # Create a build with lots of attributes set.
-            build = self.factory.makeBinaryPackageBuild()
-            build.gotFailure()
-            build.updateStatus(
-                BuildStatus.BUILDING, builder=self.factory.makeBuilder())
-            build.updateStatus(BuildStatus.FULLYBUILT)
-            build.setLog(self.factory.makeLibraryFileAlias())
-            build.storeUploadLog('uploaded')
-
-            # Manually unset the build's denormed columns.
-            attrs = (
-                'archive', 'pocket', 'processor', 'virtualized',
-                'date_created', 'date_started', 'date_finished',
-                'date_first_dispatched', 'builder', 'status', 'log',
-                'upload_log', 'dependencies', 'failure_count',
-                'build_farm_job', 'distribution', 'distro_series',
-                'source_package_name', 'is_distro_archive')
-            for attr in attrs:
-                setattr(removeSecurityProxy(build), '_new_' + attr, None)
-            removeSecurityProxy(build.build_farm_job).archive = None
-        self.assertEqual(
-            1, store.find(BinaryPackageBuild, _new_archive=None).count())
-        self.runHourly()
-        self.assertEqual(
-            0, store.find(BinaryPackageBuild, _new_archive=None).count())
-
-        self.assertThat(
-            removeSecurityProxy(build),
-            MatchesStructure.byEquality(
-                **dict(
-                    ('_new_' + attr, getattr(build, attr)) for attr in attrs)))
-        self.assertEqual(
-            build.archive, removeSecurityProxy(build.build_farm_job).archive)
-
-    def test_SourcePackageRecipeBuildFlattener(self):
-        store = IMasterStore(BinaryPackageBuild)
-        with dbuser('testadmin'):
-            IMasterStore(FeatureFlag).add(FeatureFlag(
-                u'default', 0, u'soyuz.flatten_bfj.garbo.enabled', u'true'))
-
-        with dbuser('testadmin'):
-            # Create a build with lots of attributes set.
-            build = self.factory.makeSourcePackageRecipeBuild()
-            build.gotFailure()
-            build.updateStatus(
-                BuildStatus.BUILDING, builder=self.factory.makeBuilder())
-            build.updateStatus(BuildStatus.FULLYBUILT)
-            build.setLog(self.factory.makeLibraryFileAlias())
-            build.storeUploadLog('uploaded')
-
-            # Manually unset the build's denormed columns.
-            attrs = (
-                'archive', 'pocket', 'processor', 'virtualized',
-                'date_created', 'date_started', 'date_finished',
-                'date_first_dispatched', 'builder', 'status', 'log',
-                'upload_log', 'dependencies', 'failure_count',
-                'build_farm_job')
-            for attr in attrs:
-                setattr(removeSecurityProxy(build), '_new_' + attr, None)
-            removeSecurityProxy(build).build_farm_job.archive = None
-        self.assertEqual(
-            1, store.find(SourcePackageRecipeBuild, _new_archive=None).count())
-        self.runHourly()
-        self.assertEqual(
-            0, store.find(SourcePackageRecipeBuild, _new_archive=None).count())
-
-        self.assertThat(
-            removeSecurityProxy(build),
-            MatchesStructure.byEquality(
-                **dict(
-                    ('_new_' + attr, getattr(build, attr)) for attr in attrs)))
-        self.assertEqual(
-            build.archive, removeSecurityProxy(build.build_farm_job).archive)
-
-    def test_TranslationTemplatesBuildFlattener(self):
-        store = IMasterStore(BinaryPackageBuild)
-        with dbuser('testadmin'):
-            IMasterStore(FeatureFlag).add(FeatureFlag(
-                u'default', 0, u'soyuz.flatten_bfj.garbo.enabled', u'true'))
-
-        with dbuser('testadmin'):
-            # Create a build with lots of attributes set.
-            build = self.factory.makeTranslationTemplatesBuildJob().build
-            build.gotFailure()
-            build.updateStatus(
-                BuildStatus.BUILDING, builder=self.factory.makeBuilder())
-            build.updateStatus(BuildStatus.FULLYBUILT)
-            build.setLog(self.factory.makeLibraryFileAlias())
-
-            # Manually unset the build's denormed columns.
-            attrs = (
-                'processor', 'virtualized', 'date_created', 'date_started',
-                'date_finished', 'date_first_dispatched', 'builder', 'status',
-                'log', 'failure_count')
-            for attr in attrs:
-                setattr(removeSecurityProxy(build), '_new_' + attr, None)
-        self.assertEqual(
-            1, store.find(TranslationTemplatesBuild, _new_status=None).count())
-        self.runHourly()
-        self.assertEqual(
-            0, store.find(TranslationTemplatesBuild, _new_status=None).count())
-
-        self.assertThat(
-            removeSecurityProxy(build),
-            MatchesStructure.byEquality(
-                **dict(
-                    ('_new_' + attr, getattr(build, attr)) for attr in attrs)))
-
 
 class TestGarboTasks(TestCaseWithFactory):
     layer = LaunchpadZopelessLayer

=== modified file 'lib/lp/soyuz/interfaces/binarypackagebuild.py'
--- lib/lp/soyuz/interfaces/binarypackagebuild.py	2013-02-01 02:16:55 +0000
+++ lib/lp/soyuz/interfaces/binarypackagebuild.py	2013-02-04 03:51:21 +0000
@@ -100,9 +100,6 @@
     distro_series = Attribute("Direct parent needed by CanonicalURL")
     arch_tag = exported(
         Text(title=_("Architecture tag"), required=False))
-    source_package_name = Attribute("Source package name")
-    is_distro_archive = Attribute(
-        "Whether the target archive belongs to the distro")
     distributionsourcepackagerelease = Attribute("The page showing the "
         "details for this sourcepackagerelease in this distribution.")
     binarypackages = Attribute(

=== modified file 'lib/lp/soyuz/model/binarypackagebuild.py'
--- lib/lp/soyuz/model/binarypackagebuild.py	2013-02-04 03:48:35 +0000
+++ lib/lp/soyuz/model/binarypackagebuild.py	2013-02-04 03:51:21 +0000
@@ -265,16 +265,6 @@
         return self.distro_series.distribution
 
     @property
-    def source_package_name(self):
-        """See `IBinaryPackageBuild`."""
-        return self.source_package_release.sourcepackagename
-
-    @property
-    def is_distro_archive(self):
-        """See `IBinaryPackageBuild`."""
-        return self.archive.is_main
-
-    @property
     def is_virtualized(self):
         """See `IBuild`"""
         return self.archive.require_virtualized