Merge lp:~jelmer/bzr/lp-qa-staging into lp:bzr

Proposed by Jelmer Vernooij
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: 5617
Proposed branch: lp:~jelmer/bzr/lp-qa-staging
Merge into: lp:bzr
Diff against target: 111 lines (+31/-12)
5 files modified
bzrlib/plugins/launchpad/lp_api.py (+13/-10)
bzrlib/plugins/launchpad/lp_registration.py (+1/-0)
bzrlib/plugins/launchpad/test_lp_api.py (+1/-2)
bzrlib/plugins/launchpad/test_lp_directory.py (+13/-0)
doc/en/release-notes/bzr-2.4.txt (+3/-0)
To merge this branch: bzr merge lp:~jelmer/bzr/lp-qa-staging
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+46515@code.launchpad.net

Commit message

Add support for qastaging in the launchpad plugin.

Description of the change

This adds support for lp://qastaging

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 1/17/2011 12:45 PM, Jelmer Vernooij wrote:
> Jelmer Vernooij has proposed merging lp:~jelmer/bzr/lp-qa-staging into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
>
> For more details, see:
> https://code.launchpad.net/~jelmer/bzr/lp-qa-staging/+merge/46515
>
> This adds support for lp://qastaging

     from launchpadlib.uris import LPNET_SERVICE_ROOT
 except ImportError:
     LPNET_SERVICE_ROOT = 'https://api.launchpad.net/beta/'
+try:
+ from launchpadlib.uris import QASTAGING_SERVICE_ROOT
+except ImportError:
+ QASTAGING_SERVICE_ROOT = 'https://api.qastaging.launchpad.net/'

^- These sure look like things that should be done with getattr() rather
than import hacks. Can we change these to:

from launchpadlib import uris

QASTAGING_SERVICE_ROOT = getattr(uris, 'QASTAGING_SERVICE_ROOT',
     'https://api.qastaging.launchpad.net')

etc.

launchpadlib may be doing import time hacks, but I doubt it.

The rest looks good to me. I would make sure you manually tested it, but
otherwise I'm happy.

 merge: approve

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk011pAACgkQJdeBCYSNAANGrACfc/oUxjzdgBvnVnKj8Cs8VnIf
ZuoAoIIxa+r1h36raJcEdpaKaxUIjz87
=thDm
-----END PGP SIGNATURE-----

review: Approve
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bzrlib/plugins/launchpad/lp_api.py'
--- bzrlib/plugins/launchpad/lp_api.py 2010-12-02 10:41:05 +0000
+++ bzrlib/plugins/launchpad/lp_api.py 2011-01-18 18:53:28 +0000
@@ -47,11 +47,12 @@
47 STAGING_SERVICE_ROOT,47 STAGING_SERVICE_ROOT,
48 Launchpad,48 Launchpad,
49 )49 )
50try:50from launchpadlib import uris
51 from launchpadlib.uris import LPNET_SERVICE_ROOT
52except ImportError:
53 LPNET_SERVICE_ROOT = 'https://api.launchpad.net/beta/'
5451
52LPNET_SERVICE_ROOT = getattr(uris, 'LPNET_SERVICE_ROOT',
53 'https://api.launchpad.net/beta/')
54QASTAGING_SERVICE_ROOT = getattr(uris, 'QASTAGING_SERVICE_ROOT',
55 'https://api.qastaging.launchpad.net/')
5556
56# Declare the minimum version of launchpadlib that we need in order to work.57# Declare the minimum version of launchpadlib that we need in order to work.
57# 1.5.1 is the version of launchpadlib packaged in Ubuntu 9.10, the most58# 1.5.1 is the version of launchpadlib packaged in Ubuntu 9.10, the most
@@ -80,6 +81,7 @@
8081
81LAUNCHPAD_API_URLS = {82LAUNCHPAD_API_URLS = {
82 'production': LPNET_SERVICE_ROOT,83 'production': LPNET_SERVICE_ROOT,
84 'qastaging': QASTAGING_SERVICE_ROOT,
83 'staging': STAGING_SERVICE_ROOT,85 'staging': STAGING_SERVICE_ROOT,
84 'dev': 'https://api.launchpad.dev/beta/',86 'dev': 'https://api.launchpad.dev/beta/',
85 }87 }
@@ -189,12 +191,13 @@
189 @staticmethod191 @staticmethod
190 def tweak_url(url, launchpad):192 def tweak_url(url, launchpad):
191 """Adjust a URL to work with staging, if needed."""193 """Adjust a URL to work with staging, if needed."""
192 if str(launchpad._root_uri) != STAGING_SERVICE_ROOT:194 if str(launchpad._root_uri) == STAGING_SERVICE_ROOT:
193 return url195 return url.replace('bazaar.launchpad.net',
194 if url is None:196 'bazaar.staging.launchpad.net')
195 return None197 elif str(launchpad._root_uri) == QASTAGING_SERVICE_ROOT:
196 return url.replace('bazaar.launchpad.net',198 return url.replace('bazaar.launchpad.net',
197 'bazaar.staging.launchpad.net')199 'bazaar.qastaging.launchpad.net')
200 return url
198201
199 @classmethod202 @classmethod
200 def from_bzr(cls, launchpad, bzr_branch, create_missing=True):203 def from_bzr(cls, launchpad, bzr_branch, create_missing=True):
201204
=== modified file 'bzrlib/plugins/launchpad/lp_registration.py'
--- bzrlib/plugins/launchpad/lp_registration.py 2010-12-02 09:23:10 +0000
+++ bzrlib/plugins/launchpad/lp_registration.py 2011-01-18 18:53:28 +0000
@@ -86,6 +86,7 @@
8686
87 LAUNCHPAD_DOMAINS = {87 LAUNCHPAD_DOMAINS = {
88 'production': 'launchpad.net',88 'production': 'launchpad.net',
89 'qastaging': 'qastaging.launchpad.net',
89 'staging': 'staging.launchpad.net',90 'staging': 'staging.launchpad.net',
90 'demo': 'demo.launchpad.net',91 'demo': 'demo.launchpad.net',
91 'dev': 'launchpad.dev',92 'dev': 'launchpad.dev',
9293
=== modified file 'bzrlib/plugins/launchpad/test_lp_api.py'
--- bzrlib/plugins/launchpad/test_lp_api.py 2010-03-05 08:55:12 +0000
+++ bzrlib/plugins/launchpad/test_lp_api.py 2011-01-18 18:53:28 +0000
@@ -15,8 +15,7 @@
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1616
1717
18from bzrlib import commands, config, errors, osutils18from bzrlib import config, errors, osutils
19from bzrlib.plugins.launchpad import cmd_launchpad_mirror
20from bzrlib.tests import (19from bzrlib.tests import (
21 ModuleAvailableFeature,20 ModuleAvailableFeature,
22 TestCase,21 TestCase,
2322
=== modified file 'bzrlib/plugins/launchpad/test_lp_directory.py'
--- bzrlib/plugins/launchpad/test_lp_directory.py 2011-01-10 22:20:12 +0000
+++ bzrlib/plugins/launchpad/test_lp_directory.py 2011-01-18 18:53:28 +0000
@@ -91,6 +91,19 @@
91 self.assertEquals('https://xmlrpc.launchpad.net/bazaar/',91 self.assertEquals('https://xmlrpc.launchpad.net/bazaar/',
92 factory._service_url)92 factory._service_url)
9393
94 def test_qastaging(self):
95 """A launchpad url should map to a http url"""
96 factory = FakeResolveFactory(
97 self, 'apt', dict(urls=[
98 'http://bazaar.qastaging.launchpad.net/~apt/apt/devel']))
99 url = 'lp://qastaging/apt'
100 directory = LaunchpadDirectory()
101 self.assertEquals('http://bazaar.qastaging.launchpad.net/~apt/apt/devel',
102 directory._resolve(url, factory))
103 # Make sure that resolve went to the qastaging server.
104 self.assertEquals('https://xmlrpc.qastaging.launchpad.net/bazaar/',
105 factory._service_url)
106
94 def test_staging(self):107 def test_staging(self):
95 """A launchpad url should map to a http url"""108 """A launchpad url should map to a http url"""
96 factory = FakeResolveFactory(109 factory = FakeResolveFactory(
97110
=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- doc/en/release-notes/bzr-2.4.txt 2011-01-15 07:05:45 +0000
+++ doc/en/release-notes/bzr-2.4.txt 2011-01-18 18:53:28 +0000
@@ -20,6 +20,9 @@
2020
21.. New commands, options, etc that users may wish to try out.21.. New commands, options, etc that users may wish to try out.
2222
23* The ``lp:`` directory service now supports Launchpad's QA staging.
24 (Jelmer Vernooij, #667483)
25
23Improvements26Improvements
24************27************
2528