On Tue, May 4, 2010 at 7:52 PM, Brad Crittenden <email address hidden> wrote:
> Review: Approve code
> Hi Michael,
>
> Man I know you're going to be happy to get these changes all wrapped
> up. Thanks for doing a very tedious series of branches.
>
> I'm glad to see soyuzvariablenames expanded. thank_you.
>
> --bac
Thanks for the review bac, a few comments below.
>
>
>> === modified file 'lib/lp/buildmaster/interfaces/packagebuild.py'
>> --- lib/lp/buildmaster/interfaces/packagebuild.py 2010-05-04 12:07:35 +0000
>> +++ lib/lp/buildmaster/interfaces/packagebuild.py 2010-05-04 15:29:42 +0000
>> @@ -151,6 +151,13 @@
>> :param slave_status: A dict as returned by IBuilder.slaveStatus
>> """
>>
>> + def queueBuild(suspended=False):
>> + """Create a BuildQueue entry for this build.
>> +
>> + :param suspended: Whether the associated `Job` instance should be
>> + created in a suspended state.
>> + """
>
> So interface method specifications leave off the 'self' argument but
> as a staticmethod there is no self, so the first argument 'build' is
> dropped? That's no good.
It's not a static method on PackageBuild... the
PackageBuild.queueBuild() method calls BuildBase.queueBuild() which is
a static method (so the implementation can be shared in the transition
by old BuildBase-based classes and the new PackageBuild classes).
Let me know if that was obvious to you and there is still something
you'd like to see changed?
>
>>
>> class IPackageBuildSource(Interface):
>> """A utility of this interface used to create _things_."""
>
>> === modified file 'lib/lp/buildmaster/model/buildfarmjob.py'
>> --- lib/lp/buildmaster/model/buildfarmjob.py 2010-05-04 13:42:25 +0000
>> +++ lib/lp/buildmaster/model/buildfarmjob.py 2010-05-04 15:29:42 +0000
>> @@ -189,7 +189,7 @@
>> def __init__(self, job_type, status=BuildStatus.NEEDSBUILD,
>> processor=None, virtualized=None):
>> super(BuildFarmJob, self).__init__()
>> - self.job_type, self.status, self.process, self.virtualized = (
>> + self.job_type, self.status, self.processor, self.virtualized = (
>> job_type,
>> status,
>> processor,
>
>> === modified file 'lib/lp/soyuz/model/binarypackagebuild.py'
>> --- lib/lp/soyuz/model/binarypackagebuild.py 2010-05-04 09:45:26 +0000
>> +++ lib/lp/soyuz/model/binarypackagebuild.py 2010-05-04 15:29:42 +0000
>
>> @@ -778,7 +791,7 @@
>>
>> # This code MUST match the logic in the Build security adapter,
>> # otherwise users are likely to get 403 errors, or worse.
>
> If it MUST match then perhaps it should be refactored and shared?
> (Not a requirement for this branch.)
Yeah, I thought the same thing when I moved that comment.
>
>> === renamed file 'lib/lp/soyuz/tests/test_build.py' => 'lib/lp/soyuz/tests/test_binarypackagebuild.py'
>> --- lib/lp/soyuz/tests/test_build.py 2010-04-29 08:28:30 +0000
>> +++ lib/lp/soyuz/tests/test_binarypackagebuild.py 2010-05-04 15:29:42 +0000
>> @@ -7,6 +7,7 @@
>>
>> from storm.store import Store
>> from zope.component import getUtility
>> +from zope.security.proxy import removeSecurityProxy
>>
>> from canonical.database.constants import UTC_NOW
>> from canonical.testing import LaunchpadZopelessLayer
>> @@ -81,7 +82,7 @@
>>
>> [depwait_build] = depwait_source.createMissingBuilds()
>> depwait_build.buildstate = BuildStatus.MANUALDEPWAIT
>> - depwait_build.dependencies = 'dep-bin'
>> + depwait_build.dependencies = u'dep-bin'
>
> Why did you need to convert these strings to unicode?
I meant to mention that on the MP with a question - without the
unicode string I see:
{{{
Error in test testBuildqueueRemoval
(lp.soyuz.tests.test_binarypackagebuild.TestBuildUpdateDependencies)
Traceback (most recent call last):
_StringException: Text attachment: traceback
------------
Traceback (most recent call last):
File "/home/michael/canonical/lp-sourcedeps/eggs/testtools-0.9.2-py2.5.egg/testtools/runtest.py",
line 128, in _run_user
return fn(*args)
File "/home/michael/canonical/lp-sourcedeps/eggs/testtools-0.9.2-py2.5.egg/testtools/testcase.py",
line 368, in _run_test_method
testMethod()
File "/home/michael/canonical/lp-branches/current_work/lib/lp/soyuz/tests/test_binarypackagebuild.py",
line 96, in testBuildqueueRemoval
depwait_build = self._setupSimpleDepwaitContext()
File "/home/michael/canonical/lp-branches/current_work/lib/lp/soyuz/tests/test_binarypackagebuild.py",
line 85, in _setupSimpleDepwaitContext
depwait_build.dependencies = 'dep-bin'
File "/home/michael/canonical/lp-sourcedeps/eggs/lazr.delegates-1.1.0-py2.5.egg/lazr/delegates/_delegates.py",
line 123, in __set__
setattr(getattr(inst, self.contextvar), self.name, value)
File "/home/michael/canonical/lp-sourcedeps/eggs/storm-0.15danilo_storm_launchpad_r342-py2.5-linux-x86_64.egg/storm/properties.py",
line 67, in __set__
obj_info.variables[column].set(value)
File "/home/michael/canonical/lp-sourcedeps/eggs/storm-0.15danilo_storm_launchpad_r342-py2.5-linux-x86_64.egg/storm/variables.py",
line 394, in parse_set
% (type(value), value))
TypeError: Expected unicode, found <type 'str'>: 'dep-bin'
------------
}}}
I checked the db table definitions, and the old build.dependencies
column was simply text, as is the new, so I wasn't certain why this
was required. Any ideas? (my only guess is that new tables/columns are
now defaulting to unicode).
On Tue, May 4, 2010 at 7:52 PM, Brad Crittenden <email address hidden> wrote:
> Review: Approve code
> Hi Michael,
>
> Man I know you're going to be happy to get these changes all wrapped
> up. Thanks for doing a very tedious series of branches.
>
> I'm glad to see soyuzvariablenames expanded. thank_you.
>
> --bac
Thanks for the review bac, a few comments below.
> buildmaster/ interfaces/ packagebuild. py' buildmaster/ interfaces/ packagebuild. py 2010-05-04 12:07:35 +0000 buildmaster/ interfaces/ packagebuild. py 2010-05-04 15:29:42 +0000 slaveStatus suspended= False):
>
>> === modified file 'lib/lp/
>> --- lib/lp/
>> +++ lib/lp/
>> @@ -151,6 +151,13 @@
>> :param slave_status: A dict as returned by IBuilder.
>> """
>>
>> + def queueBuild(
>> + """Create a BuildQueue entry for this build.
>> +
>> + :param suspended: Whether the associated `Job` instance should be
>> + created in a suspended state.
>> + """
>
> So interface method specifications leave off the 'self' argument but
> as a staticmethod there is no self, so the first argument 'build' is
> dropped? That's no good.
It's not a static method on PackageBuild... the queueBuild( ) method calls BuildBase. queueBuild( ) which is
PackageBuild.
a static method (so the implementation can be shared in the transition
by old BuildBase-based classes and the new PackageBuild classes).
Let me know if that was obvious to you and there is still something
you'd like to see changed?
> urce(Interface) : buildmaster/ model/buildfarm job.py' buildmaster/ model/buildfarm job.py 2010-05-04 13:42:25 +0000 buildmaster/ model/buildfarm job.py 2010-05-04 15:29:42 +0000 BuildStatus. NEEDSBUILD, soyuz/model/ binarypackagebu ild.py' soyuz/model/ binarypackagebu ild.py 2010-05-04 09:45:26 +0000 soyuz/model/ binarypackagebu ild.py 2010-05-04 15:29:42 +0000
>>
>> class IPackageBuildSo
>> """A utility of this interface used to create _things_."""
>
>> === modified file 'lib/lp/
>> --- lib/lp/
>> +++ lib/lp/
>> @@ -189,7 +189,7 @@
>> def __init__(self, job_type, status=
>> processor=None, virtualized=None):
>> super(BuildFarmJob, self).__init__()
>> - self.job_type, self.status, self.process, self.virtualized = (
>> + self.job_type, self.status, self.processor, self.virtualized = (
>> job_type,
>> status,
>> processor,
>
>> === modified file 'lib/lp/
>> --- lib/lp/
>> +++ lib/lp/
>
>> @@ -778,7 +791,7 @@
>>
>> # This code MUST match the logic in the Build security adapter,
>> # otherwise users are likely to get 403 errors, or worse.
>
> If it MUST match then perhaps it should be refactored and shared?
> (Not a requirement for this branch.)
Yeah, I thought the same thing when I moved that comment.
> soyuz/tests/ test_build. py' => 'lib/lp/ soyuz/tests/ test_binarypack agebuild. py' soyuz/tests/ test_build. py 2010-04-29 08:28:30 +0000 soyuz/tests/ test_binarypack agebuild. py 2010-05-04 15:29:42 +0000 database. constants import UTC_NOW ssLayer source. createMissingBu ilds() build.buildstat e = BuildStatus. MANUALDEPWAIT build.dependenc ies = 'dep-bin' build.dependenc ies = u'dep-bin'
>> === renamed file 'lib/lp/
>> --- lib/lp/
>> +++ lib/lp/
>> @@ -7,6 +7,7 @@
>>
>> from storm.store import Store
>> from zope.component import getUtility
>> +from zope.security.proxy import removeSecurityProxy
>>
>> from canonical.
>> from canonical.testing import LaunchpadZopele
>> @@ -81,7 +82,7 @@
>>
>> [depwait_build] = depwait_
>> depwait_
>> - depwait_
>> + depwait_
>
> Why did you need to convert these strings to unicode?
I meant to mention that on the MP with a question - without the
unicode string I see:
{{{ emoval tests.test_ binarypackagebu ild.TestBuildUp dateDependencie s) michael/ canonical/ lp-sourcedeps/ eggs/testtools- 0.9.2-py2. 5.egg/testtools /runtest. py", michael/ canonical/ lp-sourcedeps/ eggs/testtools- 0.9.2-py2. 5.egg/testtools /testcase. py", michael/ canonical/ lp-branches/ current_ work/lib/ lp/soyuz/ tests/test_ binarypackagebu ild.py" , emoval leDepwaitContex t() michael/ canonical/ lp-branches/ current_ work/lib/ lp/soyuz/ tests/test_ binarypackagebu ild.py" , waitContext build.dependenc ies = 'dep-bin' michael/ canonical/ lp-sourcedeps/ eggs/lazr. delegates- 1.1.0-py2. 5.egg/lazr/ delegates/ _delegates. py", getattr( inst, self.contextvar), self.name, value) michael/ canonical/ lp-sourcedeps/ eggs/storm- 0.15danilo_ storm_launchpad _r342-py2. 5-linux- x86_64. egg/storm/ properties. py", info.variables[ column] .set(value) michael/ canonical/ lp-sourcedeps/ eggs/storm- 0.15danilo_ storm_launchpad _r342-py2. 5-linux- x86_64. egg/storm/ variables. py",
Error in test testBuildqueueR
(lp.soyuz.
Traceback (most recent call last):
_StringException: Text attachment: traceback
------------
Traceback (most recent call last):
File "/home/
line 128, in _run_user
return fn(*args)
File "/home/
line 368, in _run_test_method
testMethod()
File "/home/
line 96, in testBuildqueueR
depwait_build = self._setupSimp
File "/home/
line 85, in _setupSimpleDep
depwait_
File "/home/
line 123, in __set__
setattr(
File "/home/
line 67, in __set__
obj_
File "/home/
line 394, in parse_set
% (type(value), value))
TypeError: Expected unicode, found <type 'str'>: 'dep-bin'
------------
}}}
I checked the db table definitions, and the old build.dependencies
column was simply text, as is the new, so I wasn't certain why this
was required. Any ideas? (my only guess is that new tables/columns are
now defaulting to unicode).
Thanks,
Michael