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

Proposed by Richard Harding
Status: Merged
Approved by: Aaron Bentley
Approved revision: no longer in the source branch.
Merged at revision: 15681
Proposed branch: lp:~rharding/launchpad/yuiv3
Merge into: lp:launchpad
Diff against target: 65 lines (+8/-12)
2 files modified
buildout.cfg (+5/-9)
lib/lp/app/templates/base-layout-macros.pt (+3/-3)
To merge this branch: bzr merge lp:~rharding/launchpad/yuiv3
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Approve
Review via email: mp+115592@code.launchpad.net

Commit message

Wire up buildout to install multiple YUI versions and wire up feature flag to YUI Config.

Description of the change

= Summary =

3rd try at landing this change. Currently the QAS and production systems don't have unzip installed. This is fixed in the latest launchpad-depedencies package and is slowly rolling out. Asked for update on QAS 7/18 and will ask on production 7/19.

In order to test different YUI versions behind the feature flag, we need to
have the ability to load up multiple versions into the combo loader directory
and to change which version you get based on the feature flag setting:

js.yui_version

== Pre Implementation ==

Talked with Orange, Curtis, William, and Robert on various ways to tackle dealing with the YUI dep.

== Implementation Notes ==

This is a second pass that expands on the current method of getting YUI from the download-cache through buildout.cfg.

This sets up only the currently used/testing versions and makes sure both are installed by default.

The download cache is updated to pull the raw YUI upstream .zip files to make it easier to update in the future vs rolling our own .tar.gz of things.

This also updates the YUI config to use the already built in value for the
js.yui_version feature flag. When not set, it's set to yui and uses the
default symlink. Otherwise you can specify the actual version file.

Currently you can use the feature flag below to run under the latest 3.5.1
release.

js.yui_version default 1 yui-3.5.1

== Tests ==

All tests should pass as normal. No new tests for this.

== LoC Qualification ==

Yay negative LoC

To post a comment you must log in.
Revision history for this message
Aaron Bentley (abentley) wrote :

The max URL length supported by IE 8 is 2083: http://support.microsoft.com/kb/q208427
I suggest we stick to that. Other than that, looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'buildout.cfg'
2--- buildout.cfg 2012-07-17 12:42:13 +0000
3+++ buildout.cfg 2012-07-18 18:30:30 +0000
4@@ -4,6 +4,7 @@
5 [buildout]
6 parts =
7 yui-default
8+ yui-3.5
9 scripts
10 filetemplates
11 tags
12@@ -42,22 +43,17 @@
13 command =
14 mkdir -p ${buildout:yui-directory}/yui-${:yui_version}
15 rm -rf ${buildout:yui-directory}/yui-${:yui_version}/*
16- tar -zxf download-cache/dist/yui-${:yui_version}.tar.gz \
17- --wildcards --strip-components 2 \
18- -C ${buildout:yui-directory}/yui-${:yui_version} \
19- '*/build'
20+ unzip -q download-cache/dist/yui_${:yui_version}.zip -d /tmp/yui-${:yui_version}
21+ mv /tmp/yui-${:yui_version}/yui/build/* ${buildout:yui-directory}/yui-${:yui_version}
22+ rm -rf /tmp/yui-${:yui_version}
23
24 [yui-default]
25 <= yui
26 yui_version = ${versions:yui}
27
28-[yui-3.4]
29-<= yui
30-yui_version = 3.4.1
31-
32 [yui-3.5]
33 <=yui
34-yui_version = 3.5.0pr1
35+yui_version = 3.5.1
36
37 [filetemplates]
38 recipe = z3c.recipe.filetemplate
39
40=== modified file 'lib/lp/app/templates/base-layout-macros.pt'
41--- lib/lp/app/templates/base-layout-macros.pt 2012-07-17 12:42:13 +0000
42+++ lib/lp/app/templates/base-layout-macros.pt 2012-07-18 18:30:30 +0000
43@@ -88,8 +88,7 @@
44 tal:content="string:var cookie_scope = '${request/lp:cookie_scope}';"></script>
45
46 <tal:js-loader condition="request/features/js.combo_loader.enabled">
47- <script type="text/javascript"
48- tal:attributes="src string:${combo_url}/?yui/yui/yui-min.js&amp;lp/meta.js&amp;yui/loader/loader-min.js"></script>
49+ <script type="text/javascript" tal:attributes="src string:${combo_url}/?${yui_version}/yui/yui-min.js&amp;lp/meta.js&amp;${yui_version}/loader/loader-min.js"></script>
50 <script type="text/javascript" tal:content="string:
51 var raw = null;
52 if (LP.devmode) {
53@@ -98,10 +97,11 @@
54 YUI.GlobalConfig = {
55 combine: true,
56 comboBase: '${combo_url}/?',
57- root: 'yui/',
58+ root: '${yui_version}/',
59 filter: raw,
60 debug: ${yui_console_debug},
61 fetchCSS: false,
62+ maxURLLength: 2000,
63 groups: {
64 lp: {
65 combine: true,