Merge lp://staging/~michael.nelson/launchpad/567922-binarypackagebuild-packagebuild-4 into lp://staging/launchpad/db-devel

Proposed by Michael Nelson
Status: Merged
Approved by: Michael Nelson
Approved revision: no longer in the source branch.
Merged at revision: 9405
Proposed branch: lp://staging/~michael.nelson/launchpad/567922-binarypackagebuild-packagebuild-4
Merge into: lp://staging/launchpad/db-devel
Prerequisite: lp://staging/~michael.nelson/launchpad/567922-binarypackagebuild-packagebuild-3
Diff against target: 711 lines (+184/-237) (has conflicts)
11 files modified
BRANCH.TODO (+6/-0)
lib/lp/buildmaster/interfaces/buildfarmjob.py (+40/-34)
lib/lp/buildmaster/model/buildfarmjob.py (+109/-97)
lib/lp/buildmaster/model/packagebuild.py (+8/-71)
lib/lp/buildmaster/tests/test_buildfarmjob.py (+0/-12)
lib/lp/code/model/sourcepackagerecipebuild.py (+4/-4)
lib/lp/soyuz/interfaces/buildfarmbuildjob.py (+2/-2)
lib/lp/soyuz/model/buildpackagejob.py (+6/-6)
lib/lp/soyuz/tests/test_buildpackagejob.py (+3/-3)
lib/lp/translations/model/translationtemplatesbuildjob.py (+3/-4)
lib/lp/translations/tests/test_translationtemplatesbuildjob.py (+3/-4)
Text conflict in lib/lp/buildmaster/interfaces/buildbase.py
Text conflict in lib/lp/buildmaster/model/buildbase.py
Text conflict in lib/lp/buildmaster/tests/test_buildbase.py
To merge this branch: bzr merge lp://staging/~michael.nelson/launchpad/567922-binarypackagebuild-packagebuild-4
Reviewer Review Type Date Requested Status
Abel Deuring (community) code Approve
Review via email: mp+24356@code.staging.launchpad.net

Description of the change

This branch is part of a pipeline for

https://blueprints.edge.launchpad.net/soyuz/+spec/build-generalisation
https://dev.launchpad.net/LEP/GeneralBuildHistories

Overview
========
The changes in this branch just do a bit of cleaning up after the refactoring of the past 3 branches.

The previous 3 branches added all the IBuildBase attributes and methods to IBuildFarmJob/IPackageJob in preparation for switching our build infrastructure to the new build tables (similar, but not exactly like http://people.ubuntu.com/~wgrant/launchpad/buildfarm/new-build-model-again.png)

This branch does some retrospective cleaning up.

Details
=======
The previous branches update the IBuildFarmJob as planned so that new database-backed BuildFarmJob/PackageBuild objects can be created and tested while still ensuring that existing classes that use IBuildFarmJob implementations and expect them to be non-database objects providing functionality still pass their tests. But it was getting complicated to see these two different ways in which IBuildFarmJob was expected to behave (see has_concrete_build_farm_job that is removed in this branch).

So, to simplify the ongoing refactoring work, I split out IBuildFarmJobOld from IBuildFarmJob, where IBuildFarmJobOld is the exact interface that existing classes currently expect, while IBuildFarmJob is a superset representing the new database-backed objects. I also added a note in the BRANCH.TODO that these *Old classes will be removed before the branch is landed.

This allowed IBuildFarmJob and IPackageBuild to be simplified, as they no longer need to worry about whether they are representing a database-backed object or not.

This branch is dependent on the pending schema patch in a previous branch.

To test
=======

First update the test db schema (required as the db patch still needs to be updated to remove the old build table):
psql launchpad_ftest_template -f database/schema/pending/michaeln-build-generalisation.sql
bin/py database/schema/security.py -d launchpad_ftest_template

And then either:
bin/test -vvt test_*build (lots of tests), or for a quicker run:
bin/test -vvt test_packagebuild -t test_buildfarmjob -t doc/build.txt -t test_buildqueue -t test_sourcepackagerecipebuild -t test_buildpackagejob -t test_buildbase

(there is one intentional test failure in test_buildfarmjob for a method that can't be implemented until I switch BinaryPackageBuild to the new delegation model of IPackageBuild/IBuildFarmJob).

The next branch will (finally) the work to switch BinaryPackageBuild from the old build table to the new buildfarmjob/packagebuild/binarypackagebuild tables.

To post a comment you must log in.
Revision history for this message
Abel Deuring (adeuring) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: