Merge lp:~mars/launchpad/ga-deployment-only into lp:launchpad

Proposed by Māris Fogels
Status: Merged
Approved by: Curtis Hovey
Approved revision: no longer in the source branch.
Merged at revision: 11111
Proposed branch: lp:~mars/launchpad/ga-deployment-only
Merge into: lp:launchpad
Diff against target: 60 lines (+3/-11)
3 files modified
lib/lp/app/browser/tests/base-layout.txt (+0/-9)
lib/lp/app/templates/base-layout.pt (+2/-1)
lib/lp/bugs/stories/bugs/xx-bugtarget-bugs-page.txt (+1/-1)
To merge this branch: bzr merge lp:~mars/launchpad/ga-deployment-only
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Māris Fogels (community) release-critical Approve
Curtis Hovey (community) Approve
Review via email: mp+29116@code.launchpad.net

Commit message

Only load our analytics JS on edge and production servers.

Description of the change

Hi,

This branch makes sure our analytics JS code is only loaded on edge and production. This fixes a problem with our windmill suite failing on test servers that do not have network access. See bug 601158 for details.

Test command: make run, check DOM with and without the change
Lint: none
Pre-implementation call with: sinzui

Maris

To post a comment you must log in.
Revision history for this message
Māris Fogels (mars) wrote :

I intend to land this branch with ec2 land.

Revision history for this message
Māris Fogels (mars) wrote :

release-critical=me

review: Approve (release-critical)
Revision history for this message
Māris Fogels (mars) wrote :

Approved by sinzui on #launchpad-reviews.

review: Approve (code)
Revision history for this message
Curtis Hovey (sinzui) wrote :

As we discusses on IRC, ``python: is_edge or is_lpnet`` is the way to do this.

review: Approve
Revision history for this message
Māris Fogels (mars) wrote :

Trying this again, overwriting my previous vote.

review: Approve (release-critical)
Revision history for this message
Brad Crittenden (bac) :
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/browser/tests/base-layout.txt'
2--- lib/lp/app/browser/tests/base-layout.txt 2010-06-25 16:14:24 +0000
3+++ lib/lp/app/browser/tests/base-layout.txt 2010-07-08 15:57:44 +0000
4@@ -72,9 +72,6 @@
5 main_side
6 public
7 yui-skin-sam">
8- <script type="text/javascript">
9- ...google-analytics.com...
10- </script>
11 <div class="yui-d0">
12 <BLANKLINE>
13 <div id="locationbar">
14@@ -265,9 +262,6 @@
15 searchless
16 public
17 yui-skin-sam">
18- <script type="text/javascript">
19- ...google-analytics.com...
20- </script>
21 <div class="yui-d0">
22 ...
23
24@@ -370,9 +364,6 @@
25 locationless
26 public
27 yui-skin-sam">
28- <script type="text/javascript">
29- ...google-analytics.com...
30- </script>
31 <div class="yui-d0">
32 ...
33
34
35=== modified file 'lib/lp/app/templates/base-layout.pt'
36--- lib/lp/app/templates/base-layout.pt 2010-06-16 19:07:12 +0000
37+++ lib/lp/app/templates/base-layout.pt 2010-07-08 15:57:44 +0000
38@@ -69,7 +69,8 @@
39 ${view/macro:pagetype}
40 ${view/context/fmt:public-private-css}
41 yui-skin-sam">
42- <script type="text/javascript">
43+ <script type="text/javascript"
44+ tal:condition="python: is_edge or is_lpnet">
45 var _gaq = _gaq || [];
46 _gaq.push(['_setAccount', 'UA-12833497-1']);
47 _gaq.push(['_setDomainName', '.launchpad.net']);
48
49=== modified file 'lib/lp/bugs/stories/bugs/xx-bugtarget-bugs-page.txt'
50--- lib/lp/bugs/stories/bugs/xx-bugtarget-bugs-page.txt 2010-04-06 22:06:46 +0000
51+++ lib/lp/bugs/stories/bugs/xx-bugtarget-bugs-page.txt 2010-07-08 15:57:44 +0000
52@@ -12,7 +12,7 @@
53 so the search field is focused by default.
54
55 >>> from BeautifulSoup import BeautifulSoup
56- >>> print BeautifulSoup(browser.contents).body('script')[1]
57+ >>> print BeautifulSoup(browser.contents).body('script')[0]
58 <script...$('field.searchtext').focus();...
59
60 But once you're on the search results page, you're quite likely to want