Merge lp:~julian-edwards/launchpad/publish-copy-archives-bug-520520-copy-url into lp:launchpad

Proposed by Julian Edwards
Status: Merged
Merged at revision: not available
Proposed branch: lp:~julian-edwards/launchpad/publish-copy-archives-bug-520520-copy-url
Merge into: lp:launchpad
Diff against target: 67 lines (+17/-4)
3 files modified
lib/canonical/config/schema-lazr.conf (+1/-0)
lib/lp/soyuz/doc/archive.txt (+11/-4)
lib/lp/soyuz/model/archive.py (+5/-0)
To merge this branch: bzr merge lp:~julian-edwards/launchpad/publish-copy-archives-bug-520520-copy-url
Reviewer Review Type Date Requested Status
Paul Hummer (community) code Approve
Review via email: mp+19637@code.launchpad.net

Commit message

Add IArchive.archive_url response for COPY archive types

To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

= Summary =
Add IArchive.archive_url response for COPY archive types

== Proposed fix ==
As part of the fix for bug 520520 to publish copy archives (rebuilds) we need
to establish a URL for the published repository. This branch makes that
change.

== Implementation details ==
Pretty simple change plus some config added for a new base url.

== Tests ==
bin/test -cvvt archive.txt

== Demo and Q/A ==

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/canonical/config/schema-lazr.conf
  lib/lp/soyuz/doc/archive.txt
  lib/lp/soyuz/model/archive.py

== Pylint notices ==

lib/lp/soyuz/model/archive.py
    14: [F0401] Unable to import 'lazr.lifecycle.event' (No module named
lifecycle)

Revision history for this message
Paul Hummer (rockstar) wrote :

Short branch, easy review, I approve!

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/config/schema-lazr.conf'
2--- lib/canonical/config/schema-lazr.conf 2010-01-22 04:01:17 +0000
3+++ lib/canonical/config/schema-lazr.conf 2010-02-18 17:25:22 +0000
4@@ -27,6 +27,7 @@
5 # External base URL for distribution archives.
6 # datatype: string
7 base_url: http://ftpmaster.internal/
8+copy_base_url: http://rebuild-test.internal/
9
10
11 [calculate_bug_heat]
12
13=== modified file 'lib/lp/soyuz/doc/archive.txt'
14--- lib/lp/soyuz/doc/archive.txt 2010-01-26 11:34:26 +0000
15+++ lib/lp/soyuz/doc/archive.txt 2010-02-18 17:25:22 +0000
16@@ -1342,9 +1342,9 @@
17 package copy request:
18
19 >>> requestor = factory.makePerson(name='me-copy')
20- >>> target = factory.makeCopyArchiveLocation(distribution=ubuntu,
21- ... name='my-copy-archive')
22- >>> pcr = ubuntu.main_archive.requestPackageCopy(target, requestor)
23+ >>> copy_target = factory.makeCopyArchiveLocation(
24+ ... distribution=ubuntu, name='my-copy-archive')
25+ >>> pcr = ubuntu.main_archive.requestPackageCopy(copy_target, requestor)
26 >>> print pcr
27 Package copy request
28 source = primary/hoary/-/RELEASE
29@@ -1357,7 +1357,7 @@
30 The requestPackageCopy method can also take an optional suite name:
31
32 >>> package_copy_request = ubuntu.main_archive.requestPackageCopy(
33- ... target, requestor, suite="hoary-updates");
34+ ... copy_target, requestor, suite="hoary-updates");
35 >>> print package_copy_request
36 Package copy request
37 source = primary/hoary/-/UPDATES
38@@ -1466,6 +1466,13 @@
39 ... ubuntu, ArchivePurpose.DEBUG).archive_url
40 http://ftpmaster.internal/ubuntu-debug
41
42+COPY archives use a URL format of <distro-name>-<archive-name>:
43+
44+ >>> print copy_target.archive.is_copy
45+ True
46+ >>> print copy_target.archive.archive_url
47+ http://rebuild-test.internal/ubuntu-my-copy-archive
48+
49 If the archive is private, the url may be different as private PPAs
50 are published to a secure location.
51
52
53=== modified file 'lib/lp/soyuz/model/archive.py'
54--- lib/lp/soyuz/model/archive.py 2010-02-02 12:04:19 +0000
55+++ lib/lp/soyuz/model/archive.py 2010-02-18 17:25:22 +0000
56@@ -288,6 +288,11 @@
57 url, "/".join(
58 (self.owner.name, self.name, self.distribution.name)))
59
60+ if self.is_copy:
61+ return urlappend(
62+ config.archivepublisher.copy_base_url,
63+ self.distribution.name + '-' + self.name)
64+
65 try:
66 postfix = archive_postfixes[self.purpose]
67 except KeyError: