Merge lp:~al-maisan/launchpad/ibuilder-api-cleanup-505647 into lp:launchpad
| Status: | Merged |
|---|---|
| Merged at revision: | not available |
| Proposed branch: | lp:~al-maisan/launchpad/ibuilder-api-cleanup-505647 |
| Merge into: | lp:launchpad |
| Diff against target: |
622 lines (+117/-93) 7 files modified
lib/lp/buildmaster/manager.py (+2/-10) lib/lp/soyuz/doc/buildd-dispatching.txt (+17/-11) lib/lp/soyuz/doc/buildd-slavescanner.txt (+31/-30) lib/lp/soyuz/interfaces/builder.py (+8/-18) lib/lp/soyuz/model/builder.py (+41/-9) lib/lp/soyuz/scripts/buildd.py (+2/-4) lib/lp/soyuz/tests/test_builder.py (+16/-11) |
| To merge this branch: | bzr merge lp:~al-maisan/launchpad/ibuilder-api-cleanup-505647 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Björn Tillenius (community) | 2010-01-11 | Approve on 2010-01-11 | |
|
Review via email:
|
|||
| Muharem Hrnjadovic (al-maisan) wrote : | # |
| Björn Tillenius (bjornt) wrote : | # |
On Mon, Jan 11, 2010 at 03:08:17AM -0000, Muharem Hrnjadovic wrote:
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -340,17 +340,9 @@
> transaction.
> continue
>
> - candidate = builder.
> - if candidate is None:
> - self.logger.debug(
> - "No build candidates available for builder.")
> - continue
> -
> slave = RecordingSlave(
> - builder.
> -
> - builder.
> - if builder.currentjob is not None:
> + candidate = builder.
> + if candidate is not None:
> recording_
> transaction.
Here you changed it to commit when no candidates are found...
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -201,12 +201,10 @@
> if not builder.
> self.logger.
> continue
> - candidate = builder.
> +
> + candidate = builder.
> if candidate is None:
> - self.logger.debug(
> - "No candidates available for builder.")
> continue
> - builder.
> self.txn.commit()
... but here you retain the behaviour of not commiting when no candidate
is found. Why was one place changed, but not the other?
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -34,13 +35,15 @@
> # Create some i386 builders ready to build PPA builds. Two
> # already exist in sampledata so we'll use those first.
> self.builder1 = getUtility(
> - self.builder2 = getUtility(
> + self.frog_builder = removeSecurityP
> + getUtility(
Why doesn't frog_builder have a security proxy? If it's just to call
private methods, it's better to remove the proxy when you call the
method. If you start passing frog_builder to methods in your tests, you
might get things passing in the tests, while failing in real code.
Better to be safe and only unwrap the objects when you know it's safe.
> self.builder3 = self.factory.
> - self.builder4 = self.factory.
> + self.builder4 = removeSecurityP
> + self.factory.
Same comment here.
> self.builder5 = self.factory.
> self.b...
| Muharem Hrnjadovic (al-maisan) wrote : | # |
Björn Tillenius wrote:
> Review: Needs Information
> On Mon, Jan 11, 2010 at 03:08:17AM -0000, Muharem Hrnjadovic wrote:
>> === modified file 'lib/lp/
>> --- lib/lp/
>> +++ lib/lp/
>> @@ -340,17 +340,9 @@
>> transaction.
>> continue
>>
>> - candidate = builder.
>> - if candidate is None:
>> - self.logger.debug(
>> - "No build candidates available for builder.")
>> - continue
>> -
>> slave = RecordingSlave(
>> - builder.
>> -
>> - builder.
>> - if builder.currentjob is not None:
>> + candidate = builder.
>> + if candidate is not None:
>> recording_
>> transaction.
>
> Here you changed it to commit when no candidates are found...
Good catch! I have indented the commit() line above to preserve the old
behaviour.
>> === modified file 'lib/lp/
>> --- lib/lp/
>> +++ lib/lp/
>> @@ -201,12 +201,10 @@
>> if not builder.
>> self.logger.
>> continue
>> - candidate = builder.
>> +
>> + candidate = builder.
>> if candidate is None:
>> - self.logger.debug(
>> - "No candidates available for builder.")
>> continue
>> - builder.
>> self.txn.commit()
>
> ... but here you retain the behaviour of not commiting when no candidate
> is found. Why was one place changed, but not the other?
The issue above is fixed now.
>> === modified file 'lib/lp/
>> --- lib/lp/
>> +++ lib/lp/
>
>> @@ -34,13 +35,15 @@
>> # Create some i386 builders ready to build PPA builds. Two
>> # already exist in sampledata so we'll use those first.
>> self.builder1 = getUtility(
>> - self.builder2 = getUtility(
>> + self.frog_builder = removeSecurityP
>> + getUtility(
>
> Why doesn't frog_builder have a security proxy? If it's just to call
> private methods, it's better to remove the proxy when you call the
> method. If you start passing frog_builder to methods in your tests, you
> might get things passing in the tests, while failing in real code.
> Better to be safe and only unwrap the objects when you know it's safe.
Good point! Revised the code accordingly.
>> self.builder3 = self.factory.
>> - ...

Hello there!
This branch cleans up the IBuilder interface and model code related to ate()/dispatchB uildCandidate( ) methods are made internal
candidate job selection.
The findBuildCandid
and a new findAndStartJob() method that hides them is introduced.
Tests to run:
bin/test -vv -t build
No "make lint" errors.