Merge lp:~rharding/launchpad/updated_wally_use_convoy into lp:launchpad

Proposed by Richard Harding on 2012-01-23
Status: Merged
Merged at revision: 14722
Proposed branch: lp:~rharding/launchpad/updated_wally_use_convoy
Merge into: lp:launchpad
Prerequisite: lp:~wallyworld/launchpad/use-convoy
Diff against target: 53 lines (+11/-2)
3 files modified
lib/lp/app/widgets/doc/location-widget.txt (+1/-1)
lib/lp/services/webapp/error.py (+9/-0)
lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt (+1/-1)
To merge this branch: bzr merge lp:~rharding/launchpad/updated_wally_use_convoy
Reviewer Review Type Date Requested Status
Benji York (community) code 2012-01-23 Approve on 2012-01-23
Review via email: mp+89732@code.launchpad.net

Commit Message

Short cut features checks on error pages and adjust tests for changes in use-convoy branch.

Description of the Change

= Summary =
There were some failing tests when trying to ec2 land the use-convoy branch.

== Fixes and implementation details ==
The first error was that the url for the YUI2 calendar was altered during preparing the JS build directory. That path was updated (it's not under app any longer).

The second error was that the geo location code was returning a float value of 2.9999999999. This seems a bit spurious, and since it's a LAT value, if it's off by that little it won't effect the map loading. So I updated the doctest to round out to 4 decimal places and make sure that equals our expected value. That should be a small enough difference to be able to ignore.

The third was that during db errors, the request dies out early and the feature flag code isn't neutered with a NullFeatureController. This causes the base layout macros file to bomb when it checks if you've gotten the feature flag for the combo loader. I've added the setup of the NullFeatureController to the SystemErrorView so that it's prepared and ready for the check to fail gracefully in the .pt file.

== Tests ==
./bin/test -x -cvvt "test_error"
./bin/test -x -cvvt "xx-private-ppa"
./bin/test -x -cvvt "app.*browser.*tests"

To post a comment you must log in.
Benji York (benji) wrote :

This branch looks fine. Two small suggestions:

The "print" in "print round(widget.center_lng, 5)" is superfluous.

It would be nice if the comment on line 32 of the diff explained why
injecting the NullFeatureController was necessary.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/app/widgets/doc/location-widget.txt'
2--- lib/lp/app/widgets/doc/location-widget.txt 2012-01-23 21:27:27 +0000
3+++ lib/lp/app/widgets/doc/location-widget.txt 2012-01-23 21:27:28 +0000
4@@ -62,7 +62,7 @@
5 9
6 >>> widget.center_lat
7 52...
8- >>> widget.center_lng
9+ >>> print round(widget.center_lng, 5)
10 0.3...
11 >>> widget.show_marker
12 1
13
14=== modified file 'lib/lp/services/webapp/error.py'
15--- lib/lp/services/webapp/error.py 2012-01-01 02:58:52 +0000
16+++ lib/lp/services/webapp/error.py 2012-01-23 21:27:28 +0000
17@@ -25,7 +25,9 @@
18 from zope.interface import implements
19
20 import lp.layers
21+from lp.services import features
22 from lp.services.config import config
23+from lp.services.features.flags import NullFeatureController
24 from lp.services.propertycache import cachedproperty
25 from lp.services.webapp.interfaces import ILaunchBag
26 from lp.services.webapp.publisher import LaunchpadView
27@@ -70,6 +72,13 @@
28 if getattr(self.request, 'oopsid') is not None:
29 self.request.response.addHeader(
30 'X-Lazr-OopsId', self.request.oopsid)
31+
32+ # Need to neuter the feature flags on error output. The base template
33+ # checks for a feature flag, but they depend on db access which might
34+ # not have been setup yet.
35+ request.features = NullFeatureController()
36+ features.install_feature_controller(request.features)
37+
38 self.computeDebugOutput()
39 if config.canonical.show_tracebacks:
40 self.show_tracebacks = True
41
42=== modified file 'lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt'
43--- lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt 2012-01-15 13:32:27 +0000
44+++ lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt 2012-01-23 21:27:28 +0000
45@@ -54,7 +54,7 @@
46 >>> print extract_all_script_and_style_links(cprov_browser.contents)
47 /...
48 ...
49- http://launchpad.dev/+icing/.../build/app/calendar.js
50+ http://launchpad.dev/+icing/.../build/calendar/calendar.js
51 http://launchpad.dev/+icing/.../yui_2.7.0b/build/calendar/assets/skins/sam/calendar.css
52
53 Initially there are no subscriptions for a newly privatized PPA (although,