Merge lp:~michael.nelson/launchpad/db-build-farm-job-model into lp:launchpad/db-devel
| Status: | Merged |
|---|---|
| Approved by: | Michael Nelson on 2010-04-29 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 9405 |
| Proposed branch: | lp:~michael.nelson/launchpad/db-build-farm-job-model |
| Merge into: | lp:launchpad/db-devel |
| Prerequisite: | lp:~michael.nelson/launchpad/db-build-generalisation-db-changes |
| Diff against target: |
484 lines (+327/-37) 6 files modified
lib/canonical/launchpad/interfaces/_schema_circular_imports.py (+5/-0) lib/lp/buildmaster/configure.zcml (+15/-0) lib/lp/buildmaster/interfaces/buildfarmjob.py (+82/-14) lib/lp/buildmaster/model/buildfarmjob.py (+102/-22) lib/lp/buildmaster/model/packagebuildfarmjob.py (+3/-1) lib/lp/buildmaster/tests/test_buildfarmjob.py (+120/-0) |
| To merge this branch: | bzr merge lp:~michael.nelson/launchpad/db-build-farm-job-model |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Jelmer Vernooij (community) | 2010-04-22 | Abstain on 2010-04-29 | |
| Abel Deuring (community) | code | Approve on 2010-04-23 | |
|
Review via email:
|
|||
Description of the Change
This branch is part of a pipeline for
https:/
https:/
In particular, this branch turns BuildFarmJob into a concrete class, while at the same time, continuing support temporarily for classes that still expect this to be an in-memory object.
It is dependent on the pending schema patch in a previous branch.
To test
=======
First update the test db schema (required as the db patch still needs to be updated to remove the old build table):
psql launchpad_
bin/py database/
And then:
bin/test -vvt test_buildfarmjob -t doc/build.txt -t test_buildqueue -t test_sourcepack
The next stage will be a similar conversion for PackageBuildFar
| Abel Deuring (adeuring) wrote : | # |
Hi Michael,
a nice branch; just just have a few formal nitpicks.
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -9,15 +9,20 @@
>
> __all__ = [
> 'IBuildFarmJob',
> + 'IBuildFarmJobS
> 'IBuildFarmJobD
> 'BuildFarmJobType',
> ]
>
> from zope.interface import Interface, Attribute
> -
> -from canonical.launchpad import _
> +from zope.schema import Bool, Choice, Datetime
> from lazr.enum import DBEnumeratedType, DBItem
> from lazr.restful.fields import Reference
> +
> +from canonical.launchpad import _
> +from canonical.
> +
> +from lp.buildmaster.
> from lp.soyuz.
>
>
> @@ -56,6 +61,66 @@
> class IBuildFarmJob(
> """Operations that jobs for the build farm must implement."""
>
> + id = Attribute('The build farm job ID.')
> +
> + processor = Reference(
> + IProcessor, title=_
> + description=_(
> + "The Processor required by this build farm job. "
> + "For processor-
It is perhaps my limited English knowledge, but this sounds to me
like a polite request to the implementation class to do the right
thing ;) What about "should|must be None for processor-
> +
> + virtualized = Bool(
> + title=_
> + description=_(
> + "The virtualization setting required by this build farm job. "
> + "For job types that do not care about virtualization please "
> + "return None."))
Same here.
> +
> + date_created = Datetime(
> + title=_("Date created"), required=True, readonly=True,
> + description=_("The timestamp when the build farm job was created."))
> +
> + date_started = Datetime(
> + title=_("Date started"), required=False, readonly=True,
> + description=_("The timestamp when the build farm job was started."))
> +
> + date_finished = Datetime(
> + title=_("Date finished"), required=False, readonly=True,
> + description=_("The timestamp when the build farm job was finished."))
> +
> + date_first_
> + title=_("Date finished"), required=False, readonly=True,
> + description=_("The timestamp when the build farm job was finished."))
s/finished/
> +
> + builder = Reference(
> + title=_("Builder"), schema=IBuilder, required=False, readonly=True,
> + description=_("The builder assigned to this job."))
> +
> + status = Choice(
> + title=_('Status'), required=True,
> + # Really PackagePublishi
s/PackagePublis
[...]
> @@ -149,3 +202,17 @@
> accurately based on this job's properties.
> """
>
> +
> +class IBuildFarmJobSo
> + """A utility of Build...
| Michael Nelson (michael.nelson) wrote : | # |
On Fri, Apr 23, 2010 at 12:53 PM, Abel Deuring
<email address hidden> wrote:
> Hi Michael,
>
> a nice branch; just just have a few formal nitpicks.
Thanks Abel, comments below.
>
>> === modified file 'lib/lp/
>> --- lib/lp/
>> +++ lib/lp/
>> @@ -9,15 +9,20 @@
>>
>> __all__ = [
>> 'IBuildFarmJob',
>> + 'IBuildFarmJob
>> 'IBuildFarmJob
>> 'BuildFarmJobT
>> ]
>>
>> from zope.interface import Interface, Attribute
>> -
>> -from canonical.launchpad import _
>> +from zope.schema import Bool, Choice, Datetime
>> from lazr.enum import DBEnumeratedType, DBItem
>> from lazr.restful.fields import Reference
>> +
>> +from canonical.launchpad import _
>> +from canonical.
>> +
>> +from lp.buildmaster.
>> from lp.soyuz.
>>
>>
>> @@ -56,6 +61,66 @@
>> class IBuildFarmJob(
>> """Operations that jobs for the build farm must implement."""
>>
>> + id = Attribute('The build farm job ID.')
>> +
>> + processor = Reference(
>> + IProcessor, title=_
>> + description=_(
>> + "The Processor required by this build farm job. "
>> + "For processor-
>
> It is perhaps my limited English knowledge, but this sounds to me
> like a polite request to the implementation class to do the right
> thing ;) What about "should|must be None for processor-
Yep. This was just a copy-n-paste, but you're right. Updated.
>
>
>> +
>> + virtualized = Bool(
>> + title=
>> + description=_(
>> + "The virtualization setting required by this build farm job. "
>> + "For job types that do not care about virtualization please "
>> + "return None."))
>
> Same here.
Ditto.
>
>> +
>> + date_created = Datetime(
>> + title=_("Date created"), required=True, readonly=True,
>> + description=_("The timestamp when the build farm job was created."))
>> +
>> + date_started = Datetime(
>> + title=_("Date started"), required=False, readonly=True,
>> + description=_("The timestamp when the build farm job was started."))
>> +
>> + date_finished = Datetime(
>> + title=_("Date finished"), required=False, readonly=True,
>> + description=_("The timestamp when the build farm job was finished."))
>> +
>> + date_first_
>> + title=_("Date finished"), required=False, readonly=True,
>> + description=_("The timestamp when the build farm job was finished."))
>
> s/finished/
Done.
>
>> +
>> + builder = Reference(
>> + title=
>> + description=_("The builder assigned to this job."))
>> +
>> + status = Choice(
>> + title=

This branch is part of a pipeline for
https:/ /blueprints. edge.launchpad. net/soyuz/ +spec/build- generalisation /dev.launchpad. net/LEP/ GeneralBuildHis tories
https:/
In particular, this branch turns BuildFarmJob into a concrete class, while at the same time, continuing support temporarily for classes that still expect this to be an in-memory object.
It is dependent on the pending schema patch in a previous branch.
To test
=======
First update the test db schema (required as the db patch still needs to be updated to remove the old build table): ftest_template -f database/ schema/ pending/ michaeln- build-generalis ation.sql schema/ security. py -d launchpad_ ftest_template
psql launchpad_
bin/py database/
And then: agerecipebuild -t test_translatio ntemplatesbuild job
bin/test -vvt test_buildfarmjob -t doc/build.txt -t test_buildqueue -t test_sourcepack
The next stage will be a similar conversion for PackageBuildFar mJob, followed by switching the BinaryPackageBuild from the old build table to the new binarypackagebuild table.