← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/sync-source-nonexistent into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/sync-source-nonexistent into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/sync-source-nonexistent/+merge/119263

== Summary ==

Bug 837555: the various package-copying methods on Archive OOPS if asked to copy a package that isn't published in the source archive.

== Proposed fix ==

Consistently raise CannotCopy in this case for all four relevant methods.

I took the liberty of arranging for Archive.syncSources to raise an exception rather than silently doing nothing; my reasoning is that the user clearly expected it to do something and thus doing nothing should be regarded as an exceptional condition here.  Besides, it's consistent with Archive.copyPackages, and this allows the error handling to be pushed down into a common method.

== LOC Rationale ==

+50.  I have ~4000 lines of credit and more to come, so I'd like to use a bit of that on reducing the critical queue slightly.

== Tests ==

bin/test -vvct lib/lp/soyuz/doc/archive.txt -t lp.soyuz.tests.test_archive.TestSyncSource

== Demo and Q/A ==

There's a reproduction recipe in the bug description.

== Lint ==

Just a false positive:

./lib/lp/soyuz/model/archive.py
     346: redefinition of function 'private' from line 342
-- 
https://code.launchpad.net/~cjwatson/launchpad/sync-source-nonexistent/+merge/119263
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/sync-source-nonexistent into lp:launchpad.


Follow ups