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

Proposed by William Grant on 2010-12-23
Status: Merged
Approved by: Данило Шеган on 2010-12-23
Approved revision: no longer in the source branch.
Merged at revision: 12143
Proposed branch: lp:~wgrant/launchpad/bug-685624-ttbj-build-interface
Merge into: lp:launchpad
Diff against target: 44 lines (+6/-2)
3 files modified
lib/lp/buildmaster/interfaces/buildfarmbranchjob.py (+4/-0)
lib/lp/translations/configure.zcml (+1/-1)
lib/lp/translations/tests/test_translationtemplatesbuildjob.py (+1/-1)
To merge this branch: bzr merge lp:~wgrant/launchpad/bug-685624-ttbj-build-interface
Reviewer Review Type Date Requested Status
Данило Шеган (community) code 2010-12-23 Approve on 2010-12-23
Review via email: mp+44558@code.launchpad.net

Commit Message

[r=danilo][ui=none][bug=685624] Let TranslationTemplatesBuildJob.build through the security proxy.

Description of the Change

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.

To post a comment you must log in.
review: Approve (blessing)
Данило Шеган (danilo) wrote :

ec2 land seems to be agnostic: believe I say, believe!

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/buildmaster/interfaces/buildfarmbranchjob.py'
2--- lib/lp/buildmaster/interfaces/buildfarmbranchjob.py 2010-04-16 13:16:05 +0000
3+++ lib/lp/buildmaster/interfaces/buildfarmbranchjob.py 2010-12-23 10:01:23 +0000
4@@ -8,6 +8,8 @@
5 'IBuildFarmBranchJob'
6 ]
7
8+from zope.interface import Attribute
9+
10 from lp.code.interfaces.branchjob import IBranchJob
11
12
13@@ -18,3 +20,5 @@
14 have a "build" attribute but do implement `IBranchJob`, so that the
15 UI can render appropriate status information.
16 """
17+
18+ build = Attribute("The `IBuildFarmJob` associated with this job.")
19
20=== modified file 'lib/lp/translations/configure.zcml'
21--- lib/lp/translations/configure.zcml 2010-12-01 11:26:57 +0000
22+++ lib/lp/translations/configure.zcml 2010-12-23 10:01:23 +0000
23@@ -601,7 +601,7 @@
24 <class
25 class="lp.translations.model.translationtemplatesbuildjob.TranslationTemplatesBuildJob">
26 <allow
27- interface="lp.code.interfaces.branchjob.IBranchJob"/>
28+ interface="lp.buildmaster.interfaces.buildfarmbranchjob.IBuildFarmBranchJob"/>
29 <allow
30 interface="lp.buildmaster.interfaces.buildfarmjob.IBuildFarmJobOld"/>
31 </class>
32
33=== modified file 'lib/lp/translations/tests/test_translationtemplatesbuildjob.py'
34--- lib/lp/translations/tests/test_translationtemplatesbuildjob.py 2010-12-17 12:13:54 +0000
35+++ lib/lp/translations/tests/test_translationtemplatesbuildjob.py 2010-12-23 10:01:23 +0000
36@@ -298,7 +298,7 @@
37 branch = self._makeTranslationBranch(fake_pottery_compatible=True)
38 specific_job = self.jobsource.create(branch, testing=True)
39 naked_job = removeSecurityProxy(specific_job)
40- self.assertEquals(naked_job._constructed_build, naked_job.build)
41+ self.assertEquals(naked_job._constructed_build, specific_job.build)
42
43
44 def test_suite():