launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #18003
[Merge] lp:~thomir/launchpad/devel-fix-import-violations-buildfarmjob into lp:launchpad
Thomi Richards has proposed merging lp:~thomir/launchpad/devel-fix-import-violations-buildfarmjob into lp:launchpad.
Commit message:
Fix an import policy violation: lp.buildmaster.model.buildfarmjob is no longer imported into lp.soyuz.browser.build.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~thomir/launchpad/devel-fix-import-violations-buildfarmjob/+merge/251397
This branch removes an import policy violation:
You should not import lp.buildmaster.model.buildfarmjob into lp.soyuz.browser.build
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~thomir/launchpad/devel-fix-import-violations-buildfarmjob into lp:launchpad.
=== modified file 'lib/lp/soyuz/browser/build.py'
--- lib/lp/soyuz/browser/build.py 2015-02-22 23:02:28 +0000
+++ lib/lp/soyuz/browser/build.py 2015-03-02 01:15:26 +0000
@@ -49,11 +49,11 @@
BuildStatus,
)
from lp.buildmaster.interfaces.buildfarmjob import (
+ IBuildFarmJob,
InconsistentBuildFarmJobError,
ISpecificBuildFarmJobSource,
)
from lp.buildmaster.interfaces.buildqueue import IBuildQueueSet
-from lp.buildmaster.model.buildfarmjob import BuildFarmJob
from lp.services.librarian.browser import (
FileNavigationMixin,
ProxiedLibraryFileAlias,
@@ -439,7 +439,7 @@
builds = []
key = attrgetter('job_type.name')
nonspecific_jobs = sorted(
- (job for job in jobs if zope_isinstance(job, BuildFarmJob)), key=key)
+ (job for job in jobs if IBuildFarmJob.providedBy(job)), key=key)
job_builds = {}
for job_type_name, grouped_jobs in groupby(nonspecific_jobs, key=key):
# Fetch the jobs in batches grouped by their job type.
@@ -463,7 +463,7 @@
try:
return [
job_builds[job.id]
- if zope_isinstance(job, BuildFarmJob) else job for job in jobs]
+ if IBuildFarmJob.providedBy(job) else job for job in jobs]
except KeyError:
raise InconsistentBuildFarmJobError(
"Could not find all the related specific jobs.")
Follow ups