← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~rharding/launchpad/yuiff into lp:launchpad

 

Richard Harding has proposed merging lp:~rharding/launchpad/yuiff into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1023923 in Launchpad itself: "the yui_version feature flag isn't wired for use"
  https://bugs.launchpad.net/launchpad/+bug/1023923

For more details, see:
https://code.launchpad.net/~rharding/launchpad/yuiff/+merge/115170

= Summary =

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
-- 
https://code.launchpad.net/~rharding/launchpad/yuiff/+merge/115170
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~rharding/launchpad/yuiff into lp:launchpad.
=== modified file 'buildout.cfg'
--- buildout.cfg	2012-07-13 18:54:42 +0000
+++ buildout.cfg	2012-07-16 15:47:24 +0000
@@ -4,6 +4,7 @@
 [buildout]
 parts =
     yui-default
+    yui-3.5
     scripts
     filetemplates
     tags
@@ -42,22 +43,18 @@
 command =
     mkdir -p ${buildout:yui-directory}/yui-${:yui_version}
     rm -rf ${buildout:yui-directory}/yui-${:yui_version}/*
-    tar -zxf download-cache/dist/yui-${:yui_version}.tar.gz \
-        --wildcards --strip-components 2 \
-        -C ${buildout:yui-directory}/yui-${:yui_version} \
-        '*/build'
+    unzip -q download-cache/dist/yui_${:yui_version}.zip -d /tmp/yui-${:yui_version}
+    mv /tmp/yui-${:yui_version}/yui/build/* ${buildout:yui-directory}/yui-${:yui_version}
+    rm -rf /tmp/yui-${:yui_version}
 
 [yui-default]
 <= yui
 yui_version = ${versions:yui}
 
-[yui-3.4]
-<= yui
-yui_version = 3.4.1
-
 [yui-3.5]
-<=yui
-yui_version = 3.5.0pr1
+<= yui
+yui_version = 3.5.1
+
 
 [filetemplates]
 recipe = z3c.recipe.filetemplate

=== modified file 'lib/lp/app/templates/base-layout-macros.pt'
--- lib/lp/app/templates/base-layout-macros.pt	2012-07-13 01:55:27 +0000
+++ lib/lp/app/templates/base-layout-macros.pt	2012-07-16 15:47:24 +0000
@@ -89,7 +89,7 @@
 
   <tal:js-loader condition="request/features/js.combo_loader.enabled">
    <script type="text/javascript"
-        tal:attributes="src string:${combo_url}/?yui/yui/yui-min.js&amp;lp/meta.js&amp;yui/loader/loader-min.js"></script>
+        tal:attributes="src string:${combo_url}/?${yui_version}/yui/yui-min.js&amp;lp/meta.js&amp;${yui_version}/loader/loader-min.js"></script>
    <script type="text/javascript" tal:content="string:
         var raw = null;
         if (LP.devmode) {
@@ -98,10 +98,11 @@
         YUI.GlobalConfig = {
             combine: true,
             comboBase: '${combo_url}/?',
-            root: 'yui/',
+            root: '${yui_version}/',
             filter: raw,
             debug: ${yui_console_debug},
             fetchCSS: false,
+            maxURLLength: 2500,
             groups: {
                 lp: {
                     combine: true,


Follow ups