Merge lp:~al-maisan/launchpad/disabled-copyarch-519665 into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Jeroen T. Vermeulen on 2010-02-11 |
| Approved revision: | not available |
| Merged at revision: | not available |
| Proposed branch: | lp:~al-maisan/launchpad/disabled-copyarch-519665 |
| Merge into: | lp:launchpad |
| Diff against target: |
138 lines (+55/-13) 4 files modified
lib/lp/buildmaster/interfaces/buildbase.py (+6/-2) lib/lp/buildmaster/model/buildbase.py (+6/-1) lib/lp/soyuz/model/publishing.py (+2/-1) lib/lp/soyuz/scripts/tests/test_populatearchive.py (+41/-9) |
| To merge this branch: | bzr merge lp:~al-maisan/launchpad/disabled-copyarch-519665 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Jeroen T. Vermeulen (community) | code | Approve on 2010-02-11 | |
| Gavin Panella (community) | 2010-02-10 | Approve on 2010-02-10 | |
|
Review via email:
|
|||
| Muharem Hrnjadovic (al-maisan) wrote : | # |
| Gavin Panella (allenap) wrote : | # |
Looks great :)
My only comment is about the following function you use in the test:
> def build_not_
> """True if the given build is not pending and suspended."""
> return (
> build.buildstate != BuildStatus.
> build.buildqueu
It absolutely does not need to change, but consider writing it like
you described it:
def build_not_
"""True if the given build is not pending and suspended."""
return not (
It just took me a few extra mental leaps - which meant a few minutes
in my current state :) - to verify that the description matched the
implementation.
| Jeroen T. Vermeulen (jtv) wrote : | # |
I have a few additional notes that Gavin thought were worth adding:
* What did the pre-imp conclude about the problem of re-enabling archives? Is it not going to be a problem to un-suspend jobs when that happens?
* In build_not_
* In production code we check "len(foo) == 0" to check for empty lists. But in tests it's nicer to compare "foo == []" so that a failure will give more information.
* With assertEqual, pass expected value first and actual value second! Again, better failure messages.
Jeroen
| Muharem Hrnjadovic (al-maisan) wrote : | # |
On 02/10/2010 06:00 PM, Jeroen T. Vermeulen wrote:
> Review: Needs Fixing code
> I have a few additional notes that Gavin thought were worth adding:
Hello,
thanks for posing these questions, they are all pertinent and good.
> * What did the pre-imp conclude about the problem of re-enabling
> archives? Is it not going to be a problem to un-suspend jobs when
> that happens?
We already have a mechanism that takes care of suspending/
binary build jobs when the associated archive is disabled and enabled
respectively.
Please see Archive.enable() and Archive.disable() for more detail.
The problem in this specific case is that the so called copy archives
are instantiated in a disabled state. Hence there is no
"enabled -> disabled"
state transition for these and their binary build jobs are created in an
unsuspended state which is a bug.
Please note also that the branch at hand enforces the constraint the
binary builds for disabled archives should be (created) suspended
irrespective of archive type (although the problem manifested itself in
a copy archive context).
> * In build_not_
> scope. Can't you replace this with two separate checks?
Hmm .. maybe I can name it better. How about
- build_in_
- an explanation what "wrong" means in the case at hand
> * In production code we check "len(foo) == 0" to check for empty
> lists. But in tests it's nicer to compare "foo == []" so that a
> failure will give more information.
OK. Done.
> * With assertEqual, pass expected value first and actual value
> second! Again, better failure messages.
Oh, yes! Fixed that as well.
Please see also the enclosed incremental diff.
Best regards
--
Muharem Hrnjadovic <email address hidden>
Public key id : B2BBFCFC
Key fingerprint : A5A3 CC67 2B87 D641 103F 5602 219F 6B60 B2BB FCFC
| Jeroen T. Vermeulen (jtv) wrote : | # |
All good. Thanks for adding the final polish!

Hello there,
The new generalized build farm candidate job selection logic ignores jobs with status JobStatus. SUSPENDED.
This branch tweaks the binary build creation process so that build jobs are created in suspended mode for disabled archives. That prevents them from getting dispatched to builders "by accident".
Tests to run:
bin/test -vv -t build
No pertinent "make lint" errors or warnings.