Merge lp:~jtv/launchpad/transitional-published into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | William Grant | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 13911 | ||||
Proposed branch: | lp:~jtv/launchpad/transitional-published | ||||
Merge into: | lp:launchpad | ||||
Prerequisite: | lp:~jtv/launchpad/bug-844577 | ||||
Diff against target: |
178 lines (+95/-24) 3 files modified
lib/lp/soyuz/doc/gina.txt (+24/-24) lib/lp/soyuz/scripts/gina/dominate.py (+18/-0) lib/lp/soyuz/scripts/tests/test_gina.py (+53/-0) |
||||
To merge this branch: | bzr merge lp:~jtv/launchpad/transitional-published | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
William Grant | code | Approve | |
Review via email: mp+74720@code.launchpad.net |
This proposal supersedes a proposal from 2011-09-09.
Commit message
Convert any remaining Pending Debian SPPHs before transitional domination.
Description of the change
= Summary =
Gina is learning to run domination on its Debian imports. Yes, technically that makes Gina a dominatrix.
There is a catch: domination operates only on publication records in Published state. So far, Gina has been creating Pending records. That made sense for Ubuntu's import into Launchpad, way back when, which is what Gina was originally written for. It does not make sense now, so we changed the code and updated the legacy data in batches.
Of course that does not take care of further legacy data that is created between the update we just did in the database and the time the Gina changes roll out. But it should reduce the problem's size enough that we can afford to do the final update from inside Gina. This will only need to run once, during “transitional domination” but will do nothing if run repeatedly.
== Pre-implementation notes ==
I had wanted to do a final patch-up update later, but William's points out that there is quite a substantial risk if domination runs on partially updated data. So I inserted the change directly into the code; I have another branch waiting to remove the transitional code.
== Implementation details ==
The diff starts with some modernization of a doctest (using active_
== Tests ==
Two new tests verify transitional behaviour. One is very simple: an active SPPH is Pending but really ought to be Published. Gina dominates and the SPPH's version is found in the simulated Sources list. The Pending SPPH becomes Published.
Another test looks for the doom scenario that might occur when data is not properly migrated: an older release of a package is Published, but the version that is mentioned in the Sources list is still Pending. It is essential that the live version be upgraded to Published before domination, or the dominator would decide that there is no newer published version to dominate the now-obsolete published SPPH, and mark it deleted. Needless to say, the test shows doom being avoided.
{{{
./bin/test -vvc lp.soyuz.
}}}
== Demo and Q/A ==
= Launchpad lint =
There is some pre-existing lint, especially in the doctest, that I can't afford to do too much about. It's not just the effort (mostly a matter of running utilities/
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