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
=== modified file 'lib/canonical/config/schema-lazr.conf'
--- lib/canonical/config/schema-lazr.conf 2010-01-22 04:01:17 +0000
+++ lib/canonical/config/schema-lazr.conf 2010-02-18 17:25:22 +0000
@@ -27,6 +27,7 @@
27# External base URL for distribution archives.27# External base URL for distribution archives.
28# datatype: string28# datatype: string
29base_url: http://ftpmaster.internal/29base_url: http://ftpmaster.internal/
30copy_base_url: http://rebuild-test.internal/
3031
3132
32[calculate_bug_heat]33[calculate_bug_heat]
3334
=== modified file 'lib/lp/soyuz/doc/archive.txt'
--- lib/lp/soyuz/doc/archive.txt 2010-01-26 11:34:26 +0000
+++ lib/lp/soyuz/doc/archive.txt 2010-02-18 17:25:22 +0000
@@ -1342,9 +1342,9 @@
1342package copy request:1342package copy request:
13431343
1344 >>> requestor = factory.makePerson(name='me-copy')1344 >>> requestor = factory.makePerson(name='me-copy')
1345 >>> target = factory.makeCopyArchiveLocation(distribution=ubuntu,1345 >>> copy_target = factory.makeCopyArchiveLocation(
1346 ... name='my-copy-archive')1346 ... distribution=ubuntu, name='my-copy-archive')
1347 >>> pcr = ubuntu.main_archive.requestPackageCopy(target, requestor)1347 >>> pcr = ubuntu.main_archive.requestPackageCopy(copy_target, requestor)
1348 >>> print pcr1348 >>> print pcr
1349 Package copy request1349 Package copy request
1350 source = primary/hoary/-/RELEASE1350 source = primary/hoary/-/RELEASE
@@ -1357,7 +1357,7 @@
1357The requestPackageCopy method can also take an optional suite name:1357The requestPackageCopy method can also take an optional suite name:
13581358
1359 >>> package_copy_request = ubuntu.main_archive.requestPackageCopy(1359 >>> package_copy_request = ubuntu.main_archive.requestPackageCopy(
1360 ... target, requestor, suite="hoary-updates");1360 ... copy_target, requestor, suite="hoary-updates");
1361 >>> print package_copy_request1361 >>> print package_copy_request
1362 Package copy request1362 Package copy request
1363 source = primary/hoary/-/UPDATES1363 source = primary/hoary/-/UPDATES
@@ -1466,6 +1466,13 @@
1466 ... ubuntu, ArchivePurpose.DEBUG).archive_url1466 ... ubuntu, ArchivePurpose.DEBUG).archive_url
1467 http://ftpmaster.internal/ubuntu-debug1467 http://ftpmaster.internal/ubuntu-debug
14681468
1469COPY archives use a URL format of <distro-name>-<archive-name>:
1470
1471 >>> print copy_target.archive.is_copy
1472 True
1473 >>> print copy_target.archive.archive_url
1474 http://rebuild-test.internal/ubuntu-my-copy-archive
1475
1469If the archive is private, the url may be different as private PPAs1476If the archive is private, the url may be different as private PPAs
1470are published to a secure location.1477are published to a secure location.
14711478
14721479
=== modified file 'lib/lp/soyuz/model/archive.py'
--- lib/lp/soyuz/model/archive.py 2010-02-02 12:04:19 +0000
+++ lib/lp/soyuz/model/archive.py 2010-02-18 17:25:22 +0000
@@ -288,6 +288,11 @@
288 url, "/".join(288 url, "/".join(
289 (self.owner.name, self.name, self.distribution.name)))289 (self.owner.name, self.name, self.distribution.name)))
290290
291 if self.is_copy:
292 return urlappend(
293 config.archivepublisher.copy_base_url,
294 self.distribution.name + '-' + self.name)
295
291 try:296 try:
292 postfix = archive_postfixes[self.purpose]297 postfix = archive_postfixes[self.purpose]
293 except KeyError:298 except KeyError: