← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/bug-685624-ttbj-build-interface into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/bug-685624-ttbj-build-interface into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #685624 Translation template build jobs should use the new BuildFarmJob
  https://bugs.launchpad.net/bugs/685624

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/bug-685624-ttbj-build-interface/+merge/44558

TranslationTemplatesBuildJob.build was recently added, but security declarations were not updated to permit access to it. This branch fixes that by adding IBuildFarmBranchJob['build'].

It would be more correct to instead add IBuildFarmJobOld['build'], but that is more trouble than fixing this obsolete model is worth.

I've updated a test to check that the attribute is accessible through the security proxy.
-- 
https://code.launchpad.net/~wgrant/launchpad/bug-685624-ttbj-build-interface/+merge/44558
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/bug-685624-ttbj-build-interface into lp:launchpad.
=== modified file 'lib/lp/buildmaster/interfaces/buildfarmbranchjob.py'
--- lib/lp/buildmaster/interfaces/buildfarmbranchjob.py	2010-04-16 13:16:05 +0000
+++ lib/lp/buildmaster/interfaces/buildfarmbranchjob.py	2010-12-23 10:01:23 +0000
@@ -8,6 +8,8 @@
     'IBuildFarmBranchJob'
     ]
 
+from zope.interface import Attribute
+
 from lp.code.interfaces.branchjob import IBranchJob
 
 
@@ -18,3 +20,5 @@
     have a "build" attribute but do implement `IBranchJob`, so that the
     UI can render appropriate status information.
     """
+
+    build = Attribute("The `IBuildFarmJob` associated with this job.")

=== modified file 'lib/lp/translations/configure.zcml'
--- lib/lp/translations/configure.zcml	2010-12-01 11:26:57 +0000
+++ lib/lp/translations/configure.zcml	2010-12-23 10:01:23 +0000
@@ -601,7 +601,7 @@
     <class
         class="lp.translations.model.translationtemplatesbuildjob.TranslationTemplatesBuildJob">
         <allow
-            interface="lp.code.interfaces.branchjob.IBranchJob"/>
+            interface="lp.buildmaster.interfaces.buildfarmbranchjob.IBuildFarmBranchJob"/>
         <allow
             interface="lp.buildmaster.interfaces.buildfarmjob.IBuildFarmJobOld"/>
     </class>

=== modified file 'lib/lp/translations/tests/test_translationtemplatesbuildjob.py'
--- lib/lp/translations/tests/test_translationtemplatesbuildjob.py	2010-12-17 12:13:54 +0000
+++ lib/lp/translations/tests/test_translationtemplatesbuildjob.py	2010-12-23 10:01:23 +0000
@@ -298,7 +298,7 @@
         branch = self._makeTranslationBranch(fake_pottery_compatible=True)
         specific_job = self.jobsource.create(branch, testing=True)
         naked_job = removeSecurityProxy(specific_job)
-        self.assertEquals(naked_job._constructed_build, naked_job.build)
+        self.assertEquals(naked_job._constructed_build, specific_job.build)
 
 
 def test_suite():