Merge lp:~jtv/launchpad/bug-845326 into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Julian Edwards | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 13911 | ||||
Proposed branch: | lp:~jtv/launchpad/bug-845326 | ||||
Merge into: | lp:launchpad | ||||
Prerequisite: | lp:~jtv/launchpad/transitional-published | ||||
Diff against target: |
288 lines (+177/-22) 3 files modified
lib/lp/archivepublisher/domination.py (+19/-4) lib/lp/archivepublisher/tests/test_dominator.py (+152/-17) lib/lp/soyuz/model/publishing.py (+6/-1) |
||||
To merge this branch: | bzr merge lp:~jtv/launchpad/bug-845326 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Julian Edwards (community) | Approve | ||
Review via email: mp+74741@code.launchpad.net |
This proposal supersedes a proposal from 2011-09-09.
Commit message
[r=julian-edwards][bug=845326] Make newer [BS]PPHs supersede older ones for same version.
Description of the change
= Summary =
I'm re-doing the domination process so that one Dominator can serve the needs of traditional, latest-
My code for this was not a full replacement for traditional domination. A single package release can have multiple active publications in the same archive, distroseries, and pocket (e.g. when the package is being re-published into a different component) and traditional domination would mark the newer publication as superseding the older one. The challenge for this branch was to fix that, in a way that was still general enough to serve Gina's needs. All that Gina really knows is what version numbers should survive.
== Proposed fix ==
Extend the new-style domination algorithm: when domination finds multiple publication records for the same package (and archive etc.), for a version that should stay published, then have the newest one supersede the older ones.
(My previous generalized code would keep all publications for the version published. The classic dominator code would only keep the newest publication of the very latest version published and supersede all older ones.)
== Pre-implementation notes ==
William seems to think the solution is sane. As far as we're aware right now, this is the last step before we can land and deploy transitional Gina domination.
== Implementation details ==
The fix itself is fairly straightforward. It's in the first file in the diff. It involves one redundant variable and an extra case in an if/elif cadence, but overall I think it works out pretty cleanly.
== Tests ==
Besides a unit test for the new behaviour, for good measure I also added a massive test for complex combined data. This is not meant to replace proper unit tests; it's too complex for that. But it may reveal any breakage that the unit tests might miss.
{{{
./bin/test -vvc lp.archivepubli
}}}
== Demo and Q/A ==
A bunch of branches are going to land together. We'll have to make sure that domination still works; that Gina still works; and that Gina now does proper domination.
= Launchpad lint =
There's some pre-existing lint in the dependent branches that either can't be fixed, or would increase the risk of conflicts too much. I did not create any lint of my own, however, and left less than I found.
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
scripts/gina.py
lib/lp/
lib/lp/
lib/lp/
./lib/lp/
113: narrative exceeds 78 characters.
162: want exceeds 78 characters.
179: want exceeds 78 characters.
189: narrative uses a moin header.
221: want exceeds 78 characters.
234: want exceeds 78 characters.
240: want exceeds 78 characters.
295: source exceeds 78 characters.
324: narrative uses a moin header.
342: narrative exceeds 78 characters.
354: narrative uses a moin header.
360: narrative exceeds 78 characters.
361: narrative exceeds 78 characters.
459: narrative uses a moin header.
461: narrative exceeds 78 characters.
462: narrative exceeds 78 characters.
477: narrative uses a moin header.
563: narrative exceeds 78 characters.
600: narrative uses a moin header.
657: narrative uses a moin header.
746: narrative uses a moin header.
767: narrative uses a moin header.
780: narrative uses a moin header.
./lib/lp/
381: E261 at least two spaces before inline comment
478: E261 at least two spaces before inline comment
511: E261 at least two spaces before inline comment
681: E261 at least two spaces before inline comment
767: E261 at least two spaces before inline comment
./scripts/gina.py
26: '_pythonpath' imported but unused