Merge lp:~jml/launchpad/no-testing-on-prod-bug-559128-devel into lp:launchpad

Proposed by Jonathan Lange
Status: Merged
Approved by: Данило Шеган
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~jml/launchpad/no-testing-on-prod-bug-559128-devel
Merge into: lp:launchpad
Diff against target: 38 lines (+4/-3)
1 file modified
utilities/create-lp-wadl-and-apidoc.py (+4/-3)
To merge this branch: bzr merge lp:~jml/launchpad/no-testing-on-prod-bug-559128-devel
Reviewer Review Type Date Requested Status
Данило Шеган (community) code Approve
Review via email: mp+23655@code.launchpad.net

Commit message

Import login code from libraries, rather than testing code. Allows staging and edge to be deployed again.

Description of the change

In https://code.edge.launchpad.net/~flacoste/launchpad/bug-559128/+merge/23504, flacoste mostly fixed bug 559128 by splitting out the non-testing behaviour of login etc. into a non-testing module.

This branch finishes the job by fixing a script that flacoste didn't change.

Raises the question, how do we prevent this from happening again? Here, a developer depended on lp.testing / canonical.launchpad.ftests in code that's only used in the build process. It's a natural enough thing to do.

To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) wrote :

Looks good.

review: Approve (code)
Revision history for this message
Данило Шеган (danilo) wrote :

I was also wondering if we could have a buildbot to run 'make build' in production env, but then jml mentioned some 'edge' thing.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'utilities/create-lp-wadl-and-apidoc.py'
--- utilities/create-lp-wadl-and-apidoc.py 2010-03-25 18:06:39 +0000
+++ utilities/create-lp-wadl-and-apidoc.py 2010-04-19 10:09:17 +0000
@@ -12,7 +12,6 @@
1212
13import _pythonpath13import _pythonpath
1414
15from cStringIO import StringIO
16import os15import os
17import pkg_resources16import pkg_resources
18import subprocess17import subprocess
@@ -22,14 +21,16 @@
22from zope.component import getUtility21from zope.component import getUtility
23from zope.pagetemplate.pagetemplatefile import PageTemplateFile22from zope.pagetemplate.pagetemplatefile import PageTemplateFile
2423
25from canonical.launchpad.ftests import login, ANONYMOUS
26from canonical.launchpad.scripts import execute_zcml_for_scripts24from canonical.launchpad.scripts import execute_zcml_for_scripts
25from canonical.launchpad.webapp.interaction import (
26 ANONYMOUS, setupInteractionByEmail)
27from canonical.launchpad.webapp.servers import (27from canonical.launchpad.webapp.servers import (
28 WebServicePublication, WebServiceTestRequest)28 WebServicePublication, WebServiceTestRequest)
29from canonical.launchpad.webapp.vhosts import allvhosts29from canonical.launchpad.webapp.vhosts import allvhosts
30from canonical.launchpad.systemhomes import WebServiceApplication30from canonical.launchpad.systemhomes import WebServiceApplication
31from lazr.restful.interfaces import IWebServiceConfiguration31from lazr.restful.interfaces import IWebServiceConfiguration
3232
33
33def main(path_template):34def main(path_template):
34 WebServiceApplication.cached_wadl = None # do not use cached file version35 WebServiceApplication.cached_wadl = None # do not use cached file version
35 execute_zcml_for_scripts()36 execute_zcml_for_scripts()
@@ -61,7 +62,7 @@
61 # publisher) and then calling the root resource - retrieved through62 # publisher) and then calling the root resource - retrieved through
62 # getApplication().63 # getApplication().
63 request.setPublication(WebServicePublication(None))64 request.setPublication(WebServicePublication(None))
64 login(ANONYMOUS, request)65 setupInteractionByEmail(ANONYMOUS, request)
65 filename = path_template % {'version' : version}66 filename = path_template % {'version' : version}
66 print "Writing WADL for version %s to %s." % (version, filename)67 print "Writing WADL for version %s to %s." % (version, filename)
67 f = open(filename, 'w')68 f = open(filename, 'w')