Merge lp:~jtv/launchpad/bug-730460-job-class into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Jeroen T. Vermeulen | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 12588 | ||||
Proposed branch: | lp:~jtv/launchpad/bug-730460-job-class | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
524 lines (+342/-8) 12 files modified
database/schema/security.cfg (+3/-0) lib/canonical/launchpad/interfaces/_schema_circular_imports.py (+5/-1) lib/lp/registry/interfaces/distroseries.py (+6/-1) lib/lp/registry/model/distroseries.py (+8/-3) lib/lp/registry/tests/test_distroseries.py (+7/-1) lib/lp/soyuz/configure.zcml (+10/-0) lib/lp/soyuz/interfaces/distributionjob.py (+7/-0) lib/lp/soyuz/interfaces/distroseriesdifferencejob.py (+24/-0) lib/lp/soyuz/model/distributionjob.py (+6/-2) lib/lp/soyuz/model/distroseriesdifferencejob.py (+113/-0) lib/lp/soyuz/model/publishing.py (+7/-0) lib/lp/soyuz/tests/test_distroseriesdifferencejob.py (+146/-0) |
||||
To merge this branch: | bzr merge lp:~jtv/launchpad/bug-730460-job-class | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | Approve | ||
Review via email: mp+52857@code.launchpad.net |
Commit message
[r=allenap][bug=730460] DistroSeriesDif
Description of the change
= Summary =
Create a job class DistroSeriesDif
== Proposed fix ==
It's pathetic, really. I based my new job class on DistributionJob, which isn't really all that similar. The sad, sad fact is that the current job system encourages us to design "class hierarchies" based on what columns a type of job happens to need.
Before I land this branch I may want to implement a feature flag in a follow-up branch, so we don't create lots of DistroSeriesDif
== Pre-implementation notes ==
Discussed repeatedly with bigjools and StevenK. Using DistributionJob as a base was found to be a relatively practical tradeoff.
Also discussed: the guard code against redundant jobs is fragile, since it relies on a textually exact reproduction of a simple JSON data structure. This wasn't considered a big problem as long as redundant jobs don't dominate the queue.
== Implementation details ==
All fairly straightforward. Surprisingly DistroSeries offered no way to find derived series, so I had to add one.
You'll note that the new job type's "run" method does nothing. StevenK is working on an implementation, but that's a separate task. His branch will probably depend on mine.
== Tests ==
{{{
./bin/test -vvc lp.soyuz.
./bin/test -vvc lp.registry.
}}}
== Demo and Q/A ==
Source-package publishing must still work, and the appropriate DistroSeriesDif
= Launchpad lint =
I fixed most, but left a few reasonable-looking bits in place:
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/canonical
./lib/lp/
430: E301 expected 1 blank line, found 2
471: E301 expected 1 blank line, found 0
./lib/lp/
403: E301 expected 1 blank line, found 2
Nice, +1.
[1]
+ child_series = distroseries. getDerivedSerie s() parent_ series
+ parent_series = distroseries.
Consider calling the variable child_serieses. Even though it's
probably not correct English, it helps to differentiate it from
parent_series which is a single DistroSeries instance.
[2]
+ layer = ZopelessDatabas eLayer
I always get confused by this. "Zopeless" actually means "component
architecture" doesn't it? That makes little sense to me, so I keep
forgetting it. What is your understanding? Another's perspective might
help me remember.
[3]
+ def test_make_ metadata_ is_consistent( self): makeSourcePacka geName( ) l(make_ metadata( package) , make_metadata( package) )
+ package = self.factory.
+ self.assertEqua
If someone adds anything to make_metadata() this is going to become
fragile, unless the JSON lib sorts dictionary keys. Mmm, we shall
see. Good call adding this.