Generalise IBuilder
Bug #487009 reported by
Michael Nelson
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Michael Nelson |
Bug Description
As per:
https:/
"Refactor the builder.py file / IBuilder class so that it's generic. Move the package build specific code to IPackageBuilder (non-model class)."
Although I wonder whether IBinaryPackageB
Related branches
lp://qastaging/~michael.nelson/launchpad/487009-db-generalise-ibuilder-1b
- Graham Binns (community): Approve (code)
-
Diff: 481 lines (+296/-7)11 files modifiedlib/lp/buildmaster/interfaces/buildfarmjobbehavior.py (+38/-0)
lib/lp/buildmaster/model/buildfarmjobbehavior.py (+50/-0)
lib/lp/soyuz/configure.zcml (+7/-0)
lib/lp/soyuz/doc/builder.txt (+12/-0)
lib/lp/soyuz/doc/buildqueue.txt (+10/-0)
lib/lp/soyuz/interfaces/builder.py (+8/-2)
lib/lp/soyuz/interfaces/buildqueue.py (+5/-1)
lib/lp/soyuz/model/binarypackagebuildbehavior.py (+35/-0)
lib/lp/soyuz/model/builder.py (+55/-4)
lib/lp/soyuz/model/buildqueue.py (+7/-0)
lib/lp/soyuz/tests/test_builder.py (+69/-0)
lp://qastaging/~michael.nelson/launchpad/487009-db-more-soyuz-extraction
- Henning Eggers (community): Approve (code)
-
Diff: 565 lines (+246/-191)5 files modifiedlib/lp/buildmaster/interfaces/buildfarmjobbehavior.py (+19/-4)
lib/lp/buildmaster/model/buildfarmjobbehavior.py (+14/-0)
lib/lp/soyuz/interfaces/builder.py (+0/-13)
lib/lp/soyuz/model/binarypackagebuildbehavior.py (+206/-0)
lib/lp/soyuz/model/builder.py (+7/-174)
lp://qastaging/~michael.nelson/launchpad/487009-db-extract-get-build-records
- Abel Deuring (community): Approve (code)
-
Diff: 494 lines (+257/-80)10 files modifiedlib/lp/buildmaster/buildergroup.py (+8/-3)
lib/lp/buildmaster/interfaces/buildfarmjobbehavior.py (+8/-0)
lib/lp/buildmaster/model/buildfarmjobbehavior.py (+8/-1)
lib/lp/buildmaster/tests/buildfarmjobbehavior.txt (+134/-0)
lib/lp/soyuz/browser/tests/builder-views.txt (+1/-0)
lib/lp/soyuz/doc/buildd-slavescanner.txt (+48/-12)
lib/lp/soyuz/interfaces/builder.py (+2/-10)
lib/lp/soyuz/model/binarypackagebuildbehavior.py (+30/-0)
lib/lp/soyuz/model/builder.py (+11/-32)
lib/lp/soyuz/tests/test_builder.py (+7/-22)
Changed in soyuz: | |
milestone: | 3.1.11 → 3.1.12 |
Changed in soyuz: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Here's the pre-implementation suggestion that I'm starting now:
---------- Forwarded message ----------
From: Michael Nelson <email address hidden>
Date: Mon, Nov 23, 2009 at 7:56 PM
OK, I had a bit of time to look at this today. Just in terms of a pre-implementation discussion, here's what I'm planning to do tomorrow - so if you see any flaws or improvements in my plan or assumptions, please let me know.
The specialized builders need to both (a) augment existing functionality (eg. startBuild()), and (b) provide some additional different functionality (eg. checkCanBuildFo rDistroArchSeri es()).
My assumption is that all call-sites will know whether they want a specific type of builder, or be happy to deal with a set of general builders (ie. a view listing all builders).
The approach that I'm planning to take tomorrow is to (note bigjools, this is different to the initial example I showed you earlier):
1) Create IPackageBuilder (or IBinaryPackageB uilder) as an extension of the IBuilder interface. ilder) content-class that uses composition + delegation to provide the IBuilder general functionality while adding custom functionality or augmenting existing functionality of IBuilder (using lazr.delegates). >IPackageBuilde r etc., so that call-sites can grab a builder and adapt it as required.
2) Create a PackageBuilder (or BinaryPackageBu
3) Provide adapters for IBuilder-
4) Where appropriate, provide hooks in any general Builder methods that will need additional behaviour so that customisations will generally (but not necessarily) follow a standard api.
Also, when a builder is building it will have a know job type and so can potentially adapt itself (via the job/build queue entry). Not sure if this will be necessary.
This means that the general IBuilder interface/class won't need to know about the specializations (or be updated when new specialized builders are added).