← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~rharding/launchpad/lpyui-dep into lp:launchpad

 

Richard Harding has proposed merging lp:~rharding/launchpad/lpyui-dep into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~rharding/launchpad/lpyui-dep/+merge/114430

= 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 and Curtis on methods of packaging up the YUI depenency.
Using the new launchpad_yui package to extract out the current working library
versions.


== Implementation Notes ==

Since we're loading YUI out of the python package we have to update our
versions.cfg/buildout to use it. It installs the lpyui command into bin which
we then use in combo-rootdir to extract the YUI versions. This moves the
responsiblity for populating the build dir from buildout to the combo-rootdir
script.

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 ==

This is a negative LoC impact.
-- 
https://code.launchpad.net/~rharding/launchpad/lpyui-dep/+merge/114430
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~rharding/launchpad/lpyui-dep into lp:launchpad.
=== modified file 'Makefile'
--- Makefile	2012-06-02 02:12:21 +0000
+++ Makefile	2012-07-12 13:52:23 +0000
@@ -189,11 +189,11 @@
 endif
 
 combobuild:
+	bin/combo-rootdir build/js
 	utilities/js-deps -n LP_MODULES -s build/js/lp -x '-min.js' -o build/js/lp/meta.js >/dev/null
 	utilities/check-js-deps
 
-jsbuild: $(PY) $(JS_OUT)
-	bin/combo-rootdir build/js
+jsbuild: $(PY) combobuild jsbuild_widget_css $(JS_OUT)
 
 eggs:
 	# Usually this is linked via link-external-sourcecode, but in

=== modified file 'buildout-templates/bin/combo-rootdir.in'
--- buildout-templates/bin/combo-rootdir.in	2012-02-23 12:15:01 +0000
+++ buildout-templates/bin/combo-rootdir.in	2012-07-12 13:52:23 +0000
@@ -14,6 +14,7 @@
 
 # Populate YUI.
 if [ ! -h $BUILD_DIR/yui ]; then
+    ./bin/lpyui -d $BUILD_DIR extract
     ln -sf yui-${versions:yui} $BUILD_DIR/yui
 fi
 

=== modified file 'buildout.cfg'
--- buildout.cfg	2012-07-02 04:21:44 +0000
+++ buildout.cfg	2012-07-12 13:52:23 +0000
@@ -40,25 +40,12 @@
 [yui]
 recipe = plone.recipe.command
 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'
+    mkdir -p ${buildout:yui-directory}
 
 [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
-
 [filetemplates]
 recipe = z3c.recipe.filetemplate
 source-directory = buildout-templates
@@ -70,6 +57,7 @@
     funkload
     zc.zservertracelog
     pyinotify
+    launchpad_yui
     lpjsmin
     jsautobuild
     lazr.jobrunner
@@ -89,6 +77,7 @@
 entry-points = stxdocs=zope.configuration.stxdocs:main
     googletestservice=lp.services.googlesearch.googletestservice:main
     tracereport=zc.zservertracelog.tracereport:main
+    lpyui=launchpad_yui:main
 
 [iharness]
 recipe = z3c.recipe.scripts

=== modified file 'lib/lp/app/templates/base-layout-macros.pt'
--- lib/lp/app/templates/base-layout-macros.pt	2012-06-25 15:26:12 +0000
+++ lib/lp/app/templates/base-layout-macros.pt	2012-07-12 13:52:23 +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,

=== modified file 'utilities/check-js-deps'
--- utilities/check-js-deps	2012-02-15 04:14:02 +0000
+++ utilities/check-js-deps	2012-07-12 13:52:23 +0000
@@ -13,4 +13,3 @@
     fi
 done
 exit $error
-

=== modified file 'versions.cfg'
--- versions.cfg	2012-07-10 09:56:38 +0000
+++ versions.cfg	2012-07-12 13:52:23 +0000
@@ -43,6 +43,7 @@
 keyring = 0.6.2
 kombu = 2.1.1
 launchpadlib = 1.10.2
+launchpad-yui = 0.1
 lazr.amqp = 0.1
 lazr.authentication = 0.1.1
 lazr.batchnavigator = 1.2.10


Follow ups