Merge lp://staging/~cjwatson/launchpad/init-packageset-fixes into lp://staging/launchpad

Proposed by Colin Watson
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 15137
Proposed branch: lp://staging/~cjwatson/launchpad/init-packageset-fixes
Merge into: lp://staging/launchpad
Diff against target: 99 lines (+53/-9)
2 files modified
lib/lp/soyuz/scripts/initialize_distroseries.py (+3/-5)
lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py (+50/-4)
To merge this branch: bzr merge lp://staging/~cjwatson/launchpad/init-packageset-fixes
Reviewer Review Type Date Requested Status
William Grant (community) code Approve
Review via email: mp+103036@code.staging.launchpad.net

Commit message

Fix InitializeDistroSeries._copy_packagesets to copy from only the most recent series, not merge packagesets from all series.

Description of the change

== Summary ==

Bug 887185 reports that initialize-distroseries.py has been creating duplicate ArchivePermission rows. Relatedly, I've also noticed that, rather than copying the list of source packages in a given packageset from oneiric to precise when initialising precise (say), it's been merging the source packages in all instances of that packageset name in all distroseries. These look intuitively related, and indeed they turn out to be due to the same underlying bug.

== Proposed fix ==

        packagesets = self._store.find(
            Packageset, DistroSeries.id.is_in(self.derivation_parent_ids))

The intention is obvious here, but that code is missing anything relating the Packageset and Distroseries rows, so it ends up just loading all packagesets. Adding the obvious And(Packageset.distroseries == DistroSeries.id, ...) makes it work.

== Implementation details ==

+49 LoC, but I'd like to get this landed in time for opening Ubuntu Q and so don't want to spend lots of time refactoring if possible; could I use some credit from r15080 (-232) or r15103 (-93)?

== Tests ==

bin/test -vvct test_initialize_distroseries

== Demo and Q/A ==

I'm open to suggestions of something that can be done in practice in a reasonable time. My guess would be that we run initialize-distroseries.py on some suitable series on dogfood and then inspect the results, but I don't know what would be a suitable series and I don't know whether running i-d on dogfood is practical.

== lint ==

None.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Oh, incidentally, I don't think this entirely closes this bug, as we need to check for existing busted data and do something about it if any, so this is probably [incr]. I'm willing to work on the rest, although probably not immediately.

Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.