launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #16207
[Merge] lp:~wgrant/launchpad/no-bfjo-ui into lp:launchpad
William Grant has proposed merging lp:~wgrant/launchpad/no-bfjo-ui into lp:launchpad.
Commit message:
Adjust Builder(Set):+index to use IBuildFarmJob rather than IBuildFarmJobOld for displaying status details, and move generic Builder(Set) browser bits to lp.buildmaster.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~wgrant/launchpad/no-bfjo-ui/+merge/195347
Adjust Builder(Set):+index to use IBuildFarmJob rather than IBuildFarmJobOld for displaying status details, and move generic Builder(Set) browser bits to lp.buildmaster.
--
https://code.launchpad.net/~wgrant/launchpad/no-bfjo-ui/+merge/195347
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/no-bfjo-ui into lp:launchpad.
=== renamed file 'lib/lp/soyuz/browser/builder.py' => 'lib/lp/buildmaster/browser/builder.py'
=== modified file 'lib/lp/buildmaster/browser/configure.zcml'
--- lib/lp/buildmaster/browser/configure.zcml 2010-05-11 21:52:52 +0000
+++ lib/lp/buildmaster/browser/configure.zcml 2013-11-15 07:03:07 +0000
@@ -12,4 +12,89 @@
for="lp.buildmaster.interfaces.packagebuild.IPackageBuild"
path_expression="string:+build/${build_farm_job/id}"
attribute_to_parent="archive"/>
+
+ <browser:page
+ for="lp.buildmaster.interfaces.buildqueue.IBuildQueue"
+ name="+current"
+ class="lp.services.webapp.publisher.LaunchpadView"
+ permission="launchpad.View"
+ template="../templates/buildqueue-current.pt"/>
+ <browser:page
+ for="lp.buildmaster.interfaces.buildfarmjob.IBuildFarmJob"
+ name="+current"
+ class="lp.services.webapp.publisher.LaunchpadView"
+ permission="launchpad.View"
+ template="../templates/buildfarmjob-current.pt"/>
+
+ <browser:url
+ for="lp.buildmaster.interfaces.builder.IBuilderSet"
+ path_expression="string:builders"
+ parent_utility="lp.services.webapp.interfaces.ILaunchpadRoot"/>
+ <browser:defaultView
+ for="lp.buildmaster.interfaces.builder.IBuilderSet"
+ name="+index"/>
+ <browser:navigation
+ module="lp.buildmaster.browser.builder"
+ classes="
+ BuilderSetNavigation"/>
+ <browser:pages
+ for="lp.buildmaster.interfaces.builder.IBuilderSet"
+ permission="zope.Public"
+ class="lp.buildmaster.browser.builder.BuilderSetView">
+ <browser:page
+ template="../templates/builders-index.pt"
+ name="+index"/>
+ </browser:pages>
+ <browser:page
+ name="+new"
+ for="lp.buildmaster.interfaces.builder.IBuilderSet"
+ class="lp.buildmaster.browser.builder.BuilderSetAddView"
+ permission="launchpad.Admin"
+ template="../templates/builder-new.pt"/>
+ <browser:defaultView
+ for="lp.buildmaster.interfaces.builder.IBuilder"
+ name="+index"/>
+ <browser:navigation
+ module="lp.buildmaster.browser.builder"
+ classes="
+ BuilderNavigation"/>
+ <browser:url
+ for="lp.buildmaster.interfaces.builder.IBuilder"
+ path_expression="name"
+ parent_utility="lp.buildmaster.interfaces.builder.IBuilderSet"/>
+ <browser:pages
+ for="lp.buildmaster.interfaces.builder.IBuilder"
+ permission="zope.Public"
+ class="lp.buildmaster.browser.builder.BuilderView">
+ <browser:page
+ template="../templates/builder-index.pt"
+ name="+index"/>
+ </browser:pages>
+ <browser:pages
+ for="lp.buildmaster.interfaces.builder.IBuilder"
+ permission="zope.Public"
+ class="lp.buildmaster.browser.builder.BuilderHistoryView">
+ <browser:page
+ name="+history"
+ template="../templates/builds.pt"/>
+ <browser:page
+ template="../templates/builds-list.pt"
+ name="+builds-list"/>
+ </browser:pages>
+ <browser:page
+ name="+edit"
+ for="lp.buildmaster.interfaces.builder.IBuilder"
+ class="lp.buildmaster.browser.builder.BuilderEditView"
+ permission="launchpad.Edit"
+ template="../templates/builder-edit.pt"/>
+ <browser:menus
+ classes="
+ BuilderSetFacets
+ BuilderSetOverviewMenu"
+ module="lp.buildmaster.browser.builder"/>
+ <browser:menus
+ classes="
+ BuilderFacets
+ BuilderOverviewMenu"
+ module="lp.buildmaster.browser.builder"/>
</configure>
=== modified file 'lib/lp/buildmaster/configure.zcml'
--- lib/lp/buildmaster/configure.zcml 2013-02-04 06:55:17 +0000
+++ lib/lp/buildmaster/configure.zcml 2013-11-15 07:03:07 +0000
@@ -40,7 +40,7 @@
<adapter
provides="lp.services.webapp.interfaces.IBreadcrumb"
for="lp.buildmaster.interfaces.builder.IBuilderSet"
- factory="lp.soyuz.browser.builder.BuilderSetBreadcrumb"
+ factory="lp.buildmaster.browser.builder.BuilderSetBreadcrumb"
permission="zope.Public"/>
=== removed file 'lib/lp/buildmaster/interfaces/buildfarmbranchjob.py'
--- lib/lp/buildmaster/interfaces/buildfarmbranchjob.py 2010-12-23 09:41:08 +0000
+++ lib/lp/buildmaster/interfaces/buildfarmbranchjob.py 1970-01-01 00:00:00 +0000
@@ -1,24 +0,0 @@
-# Copyright 2010 Canonical Ltd. This software is licensed under the
-# GNU Affero General Public License version 3 (see the file LICENSE).
-
-"""Interface for `IBuildFarmJob`s that are also `IBranchJob`s."""
-
-__metaclass__ = type
-__all__ = [
- 'IBuildFarmBranchJob'
- ]
-
-from zope.interface import Attribute
-
-from lp.code.interfaces.branchjob import IBranchJob
-
-
-class IBuildFarmBranchJob(IBranchJob):
- """An `IBuildFarmJob` that's also an `IBranchJob`.
-
- Use this interface for `IBuildFarmJob` implementations that do not
- 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/buildmaster/interfaces/buildfarmjob.py'
--- lib/lp/buildmaster/interfaces/buildfarmjob.py 2013-11-14 10:09:46 +0000
+++ lib/lp/buildmaster/interfaces/buildfarmjob.py 2013-11-15 07:03:07 +0000
@@ -76,6 +76,8 @@
def cleanUp():
"""Job's finished. Delete its supporting data."""
+ build = Attribute("Build")
+
class IBuildFarmJobDB(Interface):
"""Operations on a `BuildFarmJob` DB row.
=== added directory 'lib/lp/buildmaster/templates'
=== renamed file 'lib/lp/soyuz/templates/builder-edit.pt' => 'lib/lp/buildmaster/templates/builder-edit.pt'
=== renamed file 'lib/lp/soyuz/templates/builder-index.pt' => 'lib/lp/buildmaster/templates/builder-index.pt'
--- lib/lp/soyuz/templates/builder-index.pt 2013-10-26 11:01:35 +0000
+++ lib/lp/buildmaster/templates/builder-index.pt 2013-11-15 07:03:07 +0000
@@ -111,7 +111,7 @@
<tal:job-header condition="job">
<span class="sortkey" tal:content="job/id" />
<img src="/@@/processing" alt="[building]" />
- <tal:specific-job replace="structure job/specific_job/@@+current" />
+ <tal:specific-build replace="structure job/specific_build/@@+current" />
</tal:job-header>
</metal:macro>
=== renamed file 'lib/lp/soyuz/templates/builder-new.pt' => 'lib/lp/buildmaster/templates/builder-new.pt'
=== renamed file 'lib/lp/soyuz/templates/builders-index.pt' => 'lib/lp/buildmaster/templates/builders-index.pt'
=== renamed file 'lib/lp/soyuz/templates/buildfarmbuildjob-current.pt' => 'lib/lp/buildmaster/templates/buildfarmjob-current.pt'
--- lib/lp/soyuz/templates/buildfarmbuildjob-current.pt 2010-03-16 05:08:47 +0000
+++ lib/lp/buildmaster/templates/buildfarmjob-current.pt 2013-11-15 07:03:07 +0000
@@ -4,5 +4,5 @@
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
omit-tag="">
- Building <tal:build replace="structure context/build/fmt:link" />
+ Building <tal:build replace="structure context/fmt:link" />
</tal:root>
=== renamed file 'lib/lp/soyuz/templates/buildqueue-current.pt' => 'lib/lp/buildmaster/templates/buildqueue-current.pt'
--- lib/lp/soyuz/templates/buildqueue-current.pt 2012-06-02 12:25:39 +0000
+++ lib/lp/buildmaster/templates/buildqueue-current.pt 2013-11-15 07:03:07 +0000
@@ -10,7 +10,7 @@
tal:content="context/current_build_duration/fmt:exactduration" />
ago.
</p>
- <tal:logtail condition="context/specific_job/required:launchpad.View">
+ <tal:logtail condition="context/specific_build/required:launchpad.View">
<h2>Buildlog</h2>
<div tal:content="structure context/logtail/fmt:text-to-html"
id="buildlog-tail"
=== renamed file 'lib/lp/soyuz/templates/builds-list.pt' => 'lib/lp/buildmaster/templates/builds-list.pt'
=== renamed file 'lib/lp/soyuz/templates/builds.pt' => 'lib/lp/buildmaster/templates/builds.pt'
=== modified file 'lib/lp/code/interfaces/sourcepackagerecipebuild.py'
--- lib/lp/code/interfaces/sourcepackagerecipebuild.py 2013-01-07 02:40:55 +0000
+++ lib/lp/code/interfaces/sourcepackagerecipebuild.py 2013-11-15 07:03:07 +0000
@@ -24,7 +24,10 @@
)
from lp import _
-from lp.buildmaster.interfaces.buildfarmjob import ISpecificBuildFarmJobSource
+from lp.buildmaster.interfaces.buildfarmjob import (
+ IBuildFarmJobOld,
+ ISpecificBuildFarmJobSource,
+ )
from lp.buildmaster.interfaces.packagebuild import IPackageBuild
from lp.code.interfaces.sourcepackagerecipe import (
ISourcePackageRecipe,
@@ -34,7 +37,6 @@
from lp.registry.interfaces.person import IPerson
from lp.services.job.interfaces.job import IJob
from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuild
-from lp.soyuz.interfaces.buildfarmbuildjob import IBuildFarmBuildJob
from lp.soyuz.interfaces.sourcepackagerelease import ISourcePackageRelease
@@ -104,7 +106,7 @@
"""
-class ISourcePackageRecipeBuildJob(IBuildFarmBuildJob):
+class ISourcePackageRecipeBuildJob(IBuildFarmJobOld):
"""A read-only interface for recipe build jobs."""
job = Reference(
=== modified file 'lib/lp/scripts/utilities/importfascist.py'
--- lib/lp/scripts/utilities/importfascist.py 2013-04-09 08:29:04 +0000
+++ lib/lp/scripts/utilities/importfascist.py 2013-11-15 07:03:07 +0000
@@ -48,6 +48,7 @@
'lp.answers.browser.question',
'lp.app.browser.vocabulary',
'lp.blueprints.browser.sprint',
+ 'lp.buildmaster.browser.builder',
'lp.bugs.browser.bug',
'lp.bugs.browser.bugalsoaffects',
'lp.bugs.browser.bugsubscription',
@@ -64,7 +65,6 @@
'lp.registry.browser.project',
'lp.registry.browser.sourcepackage',
'lp.soyuz.browser.archive',
- 'lp.soyuz.browser.builder',
'lp.soyuz.browser.queue',
'lp.translations.browser.potemplate',
'lp.translations.browser.serieslanguage',
=== modified file 'lib/lp/soyuz/browser/configure.zcml'
--- lib/lp/soyuz/browser/configure.zcml 2013-10-26 09:55:27 +0000
+++ lib/lp/soyuz/browser/configure.zcml 2013-11-15 07:03:07 +0000
@@ -270,10 +270,10 @@
class="lp.soyuz.browser.archive.ArchiveBuildsView">
<browser:page
name="+builds"
- template="../templates/builds.pt"/>
+ template="../../buildmaster/templates/builds.pt"/>
<browser:page
name="+builds-list"
- template="../templates/builds-list.pt"/>
+ template="../../buildmaster/templates/builds-list.pt"/>
</browser:pages>
<browser:page
name="+edit"
@@ -387,77 +387,6 @@
classes="
BuildContextMenu"
module="lp.soyuz.browser.build"/>
- <browser:url
- for="lp.buildmaster.interfaces.builder.IBuilderSet"
- path_expression="string:builders"
- parent_utility="lp.services.webapp.interfaces.ILaunchpadRoot"/>
- <browser:defaultView
- for="lp.buildmaster.interfaces.builder.IBuilderSet"
- name="+index"/>
- <browser:navigation
- module="lp.soyuz.browser.builder"
- classes="
- BuilderSetNavigation"/>
- <browser:pages
- for="lp.buildmaster.interfaces.builder.IBuilderSet"
- permission="zope.Public"
- class="lp.soyuz.browser.builder.BuilderSetView">
- <browser:page
- template="../templates/builders-index.pt"
- name="+index"/>
- </browser:pages>
- <browser:page
- name="+new"
- for="lp.buildmaster.interfaces.builder.IBuilderSet"
- class="lp.soyuz.browser.builder.BuilderSetAddView"
- permission="launchpad.Admin"
- template="../templates/builder-new.pt"/>
- <browser:defaultView
- for="lp.buildmaster.interfaces.builder.IBuilder"
- name="+index"/>
- <browser:navigation
- module="lp.soyuz.browser.builder"
- classes="
- BuilderNavigation"/>
- <browser:url
- for="lp.buildmaster.interfaces.builder.IBuilder"
- path_expression="name"
- parent_utility="lp.buildmaster.interfaces.builder.IBuilderSet"/>
- <browser:pages
- for="lp.buildmaster.interfaces.builder.IBuilder"
- permission="zope.Public"
- class="lp.soyuz.browser.builder.BuilderView">
- <browser:page
- template="../templates/builder-index.pt"
- name="+index"/>
- </browser:pages>
- <browser:pages
- for="lp.buildmaster.interfaces.builder.IBuilder"
- permission="zope.Public"
- class="lp.soyuz.browser.builder.BuilderHistoryView">
- <browser:page
- name="+history"
- template="../templates/builds.pt"/>
- <browser:page
- template="../templates/builds-list.pt"
- name="+builds-list"/>
- </browser:pages>
- <browser:page
- name="+edit"
- for="lp.buildmaster.interfaces.builder.IBuilder"
- class="lp.soyuz.browser.builder.BuilderEditView"
- permission="launchpad.Edit"
- template="../templates/builder-edit.pt"/>
- <browser:menus
- classes="
- BuilderSetFacets
- BuilderSetOverviewMenu"
- module="lp.soyuz.browser.builder"/>
- <browser:menus
- classes="
- BuilderFacets
- BuilderOverviewMenu"
- module="lp.soyuz.browser.builder"/>
<browser:defaultView
for="lp.soyuz.interfaces.distroarchseriesbinarypackage.IDistroArchSeriesBinaryPackage"
name="+index"/>
@@ -608,10 +537,10 @@
class="lp.soyuz.browser.build.BuildRecordsView">
<browser:page
name="+builds"
- template="../templates/builds.pt"/>
+ template="../../buildmaster/templates/builds.pt"/>
<browser:page
name="+builds-list"
- template="../templates/builds-list.pt"/>
+ template="../../buildmaster/templates/builds-list.pt"/>
</browser:pages>
<browser:page
for="lp.soyuz.interfaces.distroarchseries.IDistroArchSeries"
@@ -728,10 +657,10 @@
"lp.soyuz.browser.sourcepackagebuilds.SourcePackageBuildsView">
<browser:page
name="+builds-list"
- template="../templates/builds-list.pt"/>
+ template="../../buildmaster/templates/builds-list.pt"/>
<browser:page
name="+builds"
- template="../templates/builds.pt"/>
+ template="../../buildmaster/templates/builds.pt"/>
</browser:pages>
<browser:pages
for="lp.registry.interfaces.person.IPerson"
@@ -747,10 +676,10 @@
permission="zope.Public">
<browser:page
name="+builds"
- template="../templates/builds.pt"/>
+ template="../../buildmaster/templates/builds.pt"/>
<browser:page
name="+builds-list"
- template="../templates/builds-list.pt"/>
+ template="../../buildmaster/templates/builds-list.pt"/>
</browser:pages>
<browser:pages
for="lp.registry.interfaces.distroseries.IDistroSeries"
@@ -758,10 +687,10 @@
permission="zope.Public">
<browser:page
name="+builds"
- template="../templates/builds.pt"/>
+ template="../../buildmaster/templates/builds.pt"/>
<browser:page
name="+builds-list"
- template="../templates/builds-list.pt"/>
+ template="../../buildmaster/templates/builds-list.pt"/>
<browser:page
name="+portlet-architectures"
template="../templates/distroseries-portlet-architectures.pt"/>
@@ -804,25 +733,6 @@
attribute_to_parent="archive"
/>
- <!-- XXX JeroenVermeulen 2010-03-13 bug=539395: This is buildmaster, not soyuz -->
- <browser:page
- for="lp.buildmaster.interfaces.buildqueue.IBuildQueue"
- name="+current"
- class="lp.services.webapp.publisher.LaunchpadView"
- permission="launchpad.View"
- template="../templates/buildqueue-current.pt"/>
- <browser:page
- for="lp.buildmaster.interfaces.buildfarmbranchjob.IBuildFarmBranchJob"
- name="+current"
- class="lp.services.webapp.publisher.LaunchpadView"
- permission="launchpad.View"
- template="../templates/buildfarmbranchjob-current.pt"/>
- <browser:page
- for="lp.soyuz.interfaces.buildfarmbuildjob.IBuildFarmBuildJob"
- name="+current"
- class="lp.services.webapp.publisher.LaunchpadView"
- permission="launchpad.View"
- template="../templates/buildfarmbuildjob-current.pt"/>
<browser:pages
for="lp.soyuz.interfaces.packagerelationship.IPackageRelationshipSet"
permission="zope.Public">
=== removed file 'lib/lp/soyuz/interfaces/buildfarmbuildjob.py'
--- lib/lp/soyuz/interfaces/buildfarmbuildjob.py 2011-12-24 16:54:44 +0000
+++ lib/lp/soyuz/interfaces/buildfarmbuildjob.py 1970-01-01 00:00:00 +0000
@@ -1,22 +0,0 @@
-# Copyright 2010 Canonical Ltd. This software is licensed under the
-# GNU Affero General Public License version 3 (see the file LICENSE).
-
-"""Interface to support UI for most build-farm jobs."""
-
-__metaclass__ = type
-__all__ = [
- 'IBuildFarmBuildJob'
- ]
-
-from lazr.restful.fields import Reference
-
-from lp import _
-from lp.buildmaster.interfaces.buildfarmjob import IBuildFarmJobOld
-from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuild
-
-
-class IBuildFarmBuildJob(IBuildFarmJobOld):
- """An `IBuildFarmJob` with an `IBuild` reference."""
- build = Reference(
- IBinaryPackageBuild, title=_("Build"), required=True, readonly=True,
- description=_("Build record associated with this job."))
=== modified file 'lib/lp/soyuz/interfaces/buildpackagejob.py'
--- lib/lp/soyuz/interfaces/buildpackagejob.py 2013-11-14 07:56:46 +0000
+++ lib/lp/soyuz/interfaces/buildpackagejob.py 2013-11-15 07:03:07 +0000
@@ -13,12 +13,12 @@
from zope.schema import Int
from lp import _
+from lp.buildmaster.interfaces.buildfarmjob import IBuildFarmJobOld
from lp.services.job.interfaces.job import IJob
from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuild
-from lp.soyuz.interfaces.buildfarmbuildjob import IBuildFarmBuildJob
-
-
-class IBuildPackageJob(IBuildFarmBuildJob):
+
+
+class IBuildPackageJob(IBuildFarmJobOld):
"""A read-only interface for build package jobs."""
id = Int(title=_('ID'), required=True, readonly=True)
=== modified file 'lib/lp/soyuz/tests/test_buildpackagejob.py'
--- lib/lp/soyuz/tests/test_buildpackagejob.py 2013-11-12 00:28:01 +0000
+++ lib/lp/soyuz/tests/test_buildpackagejob.py 2013-11-15 07:03:07 +0000
@@ -15,7 +15,6 @@
ArchivePurpose,
PackagePublishingStatus,
)
-from lp.soyuz.interfaces.buildfarmbuildjob import IBuildFarmBuildJob
from lp.soyuz.interfaces.buildpackagejob import IBuildPackageJob
from lp.soyuz.interfaces.processor import IProcessorSet
from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild
@@ -177,4 +176,3 @@
build, bq = find_job(self, 'gcc', '386')
build_farm_job = bq.specific_job
self.assertProvides(build_farm_job, IBuildPackageJob)
- self.assertProvides(build_farm_job, IBuildFarmBuildJob)
=== modified file 'lib/lp/translations/browser/configure.zcml'
--- lib/lp/translations/browser/configure.zcml 2011-12-24 17:49:30 +0000
+++ lib/lp/translations/browser/configure.zcml 2013-11-15 07:03:07 +0000
@@ -1023,5 +1023,11 @@
name="+index"
facet="overview"
template="../templates/translationtemplatesbuild-index.pt"/>
+ <browser:page
+ for="lp.translations.interfaces.translationtemplatesbuild.ITranslationTemplatesBuild"
+ name="+current"
+ class="lp.services.webapp.publisher.LaunchpadView"
+ permission="launchpad.View"
+ template="../templates/translationtemplatesbuild-current.pt"/>
</configure>
=== modified file 'lib/lp/translations/configure.zcml'
--- lib/lp/translations/configure.zcml 2013-11-12 06:03:14 +0000
+++ lib/lp/translations/configure.zcml 2013-11-15 07:03:07 +0000
@@ -595,8 +595,6 @@
<class
class="lp.translations.model.translationtemplatesbuildjob.TranslationTemplatesBuildJob">
<allow
- interface="lp.buildmaster.interfaces.buildfarmbranchjob.IBuildFarmBranchJob"/>
- <allow
interface="lp.buildmaster.interfaces.buildfarmjob.IBuildFarmJobOld"/>
</class>
<securedutility
=== modified file 'lib/lp/translations/model/translationtemplatesbuild.py'
--- lib/lp/translations/model/translationtemplatesbuild.py 2013-11-14 10:09:46 +0000
+++ lib/lp/translations/model/translationtemplatesbuild.py 2013-11-15 07:03:07 +0000
@@ -220,10 +220,7 @@
def getByID(cls, build_id, store=None):
"""See `ITranslationTemplatesBuildSource`."""
store = cls._getStore(store)
- match = store.find(
- TranslationTemplatesBuild,
- TranslationTemplatesBuild.id == build_id)
- return match.one()
+ return store.get(TranslationTemplatesBuild, build_id)
@classmethod
def getByBuildFarmJob(cls, buildfarmjob, store=None):
=== modified file 'lib/lp/translations/model/translationtemplatesbuildjob.py'
--- lib/lp/translations/model/translationtemplatesbuildjob.py 2013-11-14 09:37:03 +0000
+++ lib/lp/translations/model/translationtemplatesbuildjob.py 2013-11-15 07:03:07 +0000
@@ -13,7 +13,7 @@
implements,
)
-from lp.buildmaster.interfaces.buildfarmbranchjob import IBuildFarmBranchJob
+from lp.buildmaster.interfaces.buildfarmjob import IBuildFarmJobOld
from lp.buildmaster.model.buildfarmjob import BuildFarmJobOld
from lp.code.model.branchjob import (
BranchJob,
@@ -35,7 +35,7 @@
Implementation-wise, this is actually a `BranchJob`.
"""
- implements(IBuildFarmBranchJob)
+ implements(IBuildFarmJobOld)
class_job_type = BranchJobType.TRANSLATION_TEMPLATES_BUILD
classProvides(ITranslationTemplatesBuildJobSource)
@@ -49,14 +49,22 @@
Store.of(self.context).remove(self.context)
@property
+ def build_id(self):
+ """Return the ID of the TranslationTemplatesBuild for this job."""
+ build_id = self.context.metadata.get('build_id', None)
+ if build_id is None:
+ return None
+ else:
+ return int(build_id)
+
+ @property
def build(self):
"""Return a TranslationTemplateBuild for this build job."""
- build_id = self.context.metadata.get('build_id', None)
- if build_id is None:
+ if self.build_id is None:
return None
else:
return getUtility(ITranslationTemplatesBuildSource).getByID(
- int(build_id))
+ self.build_id)
@classmethod
def getByJob(cls, job):
@@ -90,11 +98,15 @@
from lp.registry.model.product import Product
from lp.code.model.branchcollection import GenericBranchCollection
from lp.services.job.model.job import Job
+ from lp.translations.model.translationtemplatesbuild import (
+ TranslationTemplatesBuild,
+ )
contexts = [job.context for job in jobs]
load_related(Job, contexts, ['jobID'])
branches = load_related(Branch, contexts, ['branchID'])
GenericBranchCollection.preloadDataForBranches(branches)
load_related(Product, branches, ['productID'])
+ load_related(TranslationTemplatesBuild, jobs, ['build_id'])
@classmethod
def getByBranch(cls, branch):
=== modified file 'lib/lp/translations/stories/buildfarm/xx-build-summary.txt'
--- lib/lp/translations/stories/buildfarm/xx-build-summary.txt 2013-11-14 09:46:03 +0000
+++ lib/lp/translations/stories/buildfarm/xx-build-summary.txt 2013-11-15 07:03:07 +0000
@@ -73,7 +73,7 @@
>>> user_browser.mech_browser.set_handle_equiv(False)
>>> user_browser.open(builder_page)
>>> print extract_text(find_build_summary(user_browser))
- Working on TranslationTemplatesBuildJob for branch ...
+ Working on TranslationTemplatesBuild for branch ...
>>> user_browser.getLink(branch_url).click()
=== renamed file 'lib/lp/soyuz/templates/buildfarmbranchjob-current.pt' => 'lib/lp/translations/templates/translationtemplatesbuild-current.pt'
Follow ups