Merge lp:~jtv/launchpad/bug-844550 into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Jeroen T. Vermeulen | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 14009 | ||||
Proposed branch: | lp:~jtv/launchpad/bug-844550 | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
250 lines (+59/-151) 2 files modified
lib/lp/soyuz/scripts/gina/dominate.py (+6/-78) lib/lp/soyuz/scripts/tests/test_gina.py (+53/-73) |
||||
To merge this branch: | bzr merge lp:~jtv/launchpad/bug-844550 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Graham Binns (community) | code | Approve | |
Review via email: mp+75150@code.launchpad.net |
Commit message
Replace transitional Gina domination with its permanent form.
Description of the change
= Summary =
We're rolling out “transitional Gina domination.” This means that Gina will perform source domination on the imported Debian packages: publications of package versions that are no longer in Debian's Sources lists will become Superseded by their newer versions. Where the very newest versions are deleted from the Sources lists for whatever reason, the publication records in our database will be marked Deleted. (Also, Debian source publications are no longer nonsensically kept Pending; they will be Published immediately upon import.)
But what happens when a package no longer occurs in the Debian Sources list at all? We have tons of these still lying around for old packages. For the historical cases, we'll assume that the last known release for a package superseded all others. So the last known release should end up Deleted and all its older ones Superseded. In the future, when a package disappears from Debian's Sources list, its remaining active publications should be considered Deleted.
To make a smooth transition, transitional domination does the one-off jobs: mark any remaining Pending publications for Debian as Published (the bulk of the work was done in custom SQL), and for any package that isn't in the Sources lists, pick the latest version as “live.” That last version stays Published; the older ones become Deleted.
And then there's this branch. Once transitional domination has run, disposing of all the historical data, we can start marking publications for packages that aren't in the Sources at all as Deleted. That includes, for the historical data, that one last release that transitional domination had kept Published.
== Pre-implementation notes ==
Discussed in great detail with wgrant. Unfortunately the transition to making Debian source package publications Published (rather than Pending) broke some scripts the Ubuntu people were running, which explicitly looked for the doubtful Pending status. No multi-status filtering is available, so the easiest fix was to steam ahead to the more desirable situation and assume that all new publications are Published instead.
== Implementation details ==
Mostly this branch consists of removals of clearly marked transitional code. Things get a bit simpler, as planned. But I extended a test for the gina code, to cover a more complete scenario. There is already an extensive scenario test for the underlying functionality, but the new test code shows in one place how permanent domination behaves over a realistic "chain" of package publications.
== Tests ==
{{{
./bin/test -vvc lp.soyuz.
}}}
== Demo and Q/A ==
We've found we can run Gina on dogfood's copy of sid to compare:
./scripts/
This closely matches what will happen in production, since we also ran transitional Gina domination there. The only slightly unusual thing there is that the Sources list we have on dogfood is a bit older than the publications we have in the database, so some publications are marked Deleted because they're newer than any listed ones.
A useful thing to do before running domination is to copy all (id, status) from SourcePackagePu
Then, to get an overview of all changes made by gina:
http://
Results after setting all SPPHs for archive 3 (Debian primary) to Published, for a really thorough domination run:
http://
With this new code, a portion of those 18668 Published records should become Deleted. These should be one per SourcePackageName, and all for source packages that are no longer in the Sources list we have in /src/launchpad.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
Hi Jeroen,
Excellent branch this; I don't have any questions other than:
112 + self.assertEqual([ ngStatus. SUPERSEDED, ngStatus. SUPERSEDED, ngStatus. PUBLISHED, ngStatus. DELETED, ngStatus. PENDING,
113 + PackagePublishi
114 + PackagePublishi
115 + PackagePublishi
116 + PackagePublishi
117 + PackagePublishi
118 + ],
119 + [pub.status for pub in spphs])
This might be more comprehensible if it were written as single statements (though I can appreciate that that might be a bit less elegant), purely from a "don't make me think about it" point of view. Also, if it's a series of single asserts, it's likely to be simpler to unwind when something goes wrong.