Merge lp:~wgrant/launchpad/rescueiflost-and-updatestatus-to-model into lp:launchpad
Proposed by
William Grant
Status: | Merged |
---|---|
Approved by: | Michael Nelson |
Approved revision: | no longer in the source branch. |
Merged at revision: | not available |
Proposed branch: | lp:~wgrant/launchpad/rescueiflost-and-updatestatus-to-model |
Merge into: | lp:launchpad |
Prerequisite: | lp:~wgrant/launchpad/refactor-slave-architecture-check |
Diff against target: |
326 lines (+105/-87) 5 files modified
lib/lp/buildmaster/buildergroup.py (+1/-76) lib/lp/buildmaster/interfaces/builder.py (+12/-0) lib/lp/buildmaster/model/builder.py (+76/-1) lib/lp/soyuz/doc/buildd-slavescanner.txt (+8/-10) lib/lp/soyuz/tests/soyuzbuilddhelpers.py (+8/-0) |
To merge this branch: | bzr merge lp:~wgrant/launchpad/rescueiflost-and-updatestatus-to-model |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Nelson (community) | code | Approve | |
Review via email: mp+22016@code.launchpad.net |
Commit message
Move BuilderGroup.
Description of the change
BuilderGroup.
To post a comment you must log in.
Thanks for more cleanups and simplifications William!
It'd be nice if we didn't need to define the functions externally to be able to re-use them, but you clarified why that's necessary. Although I wonder if MockBuilder could just inherit from Builder and stub out the relevant methods as required? (leaving rescuiIfLost/ updateStatus) ? I'll leave it up to you.
Just a small suggested update for a comment below.
> === modified file 'lib/lp/ buildmaster/ model/builder. py' buildmaster/ model/builder. py 2010-03-24 12:02:21 +0000 buildmaster/ model/builder. py 2010-03-24 12:02:22 +0000 fLost', tatus', interfaces. buildbase import BuildStatus interfaces. builder import ( Mismatch) Mismatch) interfaces. buildfarmjobbeh avior import ( smatch) interfaces. buildqueue import IBuildQueueSet re(info) rescueIfLost should be used instead.
> --- lib/lp/
> +++ lib/lp/
> @@ -8,6 +8,8 @@
> __all__ = [
> 'Builder',
> 'BuilderSet',
> + 'rescueBuilderI
> + 'updateBuilderS
> ]
>
> import httplib
> @@ -40,7 +42,8 @@
> from lp.buildmaster.
> from lp.buildmaster.
> BuildDaemonError, BuildSlaveFailure, CannotBuild, CannotFetchFile,
> - CannotResumeHost, IBuilder, IBuilderSet, ProtocolVersion
> + CannotResumeHost, CorruptBuildID, IBuilder, IBuilderSet,
> + ProtocolVersion
> from lp.buildmaster.
> BuildBehaviorMi
> from lp.buildmaster.
> @@ -154,6 +157,71 @@
> raise BuildSlaveFailu
>
>
> +# This is a separate function since MockBuilder needs to use it too.
> +# Do not use it -- (Mock)Builder.
Perhaps:
These functions are defined here so that both Builder and MockBuilder updateStatus methods.
can share the implementation for the rescueIfLost/
> +def rescueBuilderIf Lost(builder, logger=None): slaveStatusSent ence()
> + """See `IBuilder`."""
> + status_sentence = builder.
{{{ updatestatus branch, couldn't we do something like rescueIfLost = Builder. rescueIfLost on the MockBuilder
if the code is the same? (and not have to define the functions?)
10:10 < noodles775> wgrant: with your rescueiflost/
10:10 < wgrant> noodles775: Bound methods check the type of the first argument.
10:10 < wgrant> So no, it's not quite that easy :(
10:10 < wgrant> Er, unbound methods.
10:10 < noodles775> Ok.
10:22 < noodles775> wgrant: in which case, is there an obvious reason that I'm missing for why MockBuilder couldn't inherit from Builder and just overload all its methods as needed?
10:27 < wgrant> noodles775: It looks like a few other mocks do that. So maybe I could.
10:27 < noodles775> wgrant: OK, I'll leave it up to you - I personally think it would improve the code.
10:27 < noodles775> r=me
}}}