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

Proposed by Richard Harding
Status: Merged
Approved by: Richard Harding
Approved revision: no longer in the source branch.
Merged at revision: 15615
Proposed branch: lp:~rharding/launchpad/lpyui-dep
Merge into: lp:launchpad
Diff against target: 123 lines (+10/-19)
6 files modified
Makefile (+2/-2)
buildout-templates/bin/combo-rootdir.in (+1/-0)
buildout.cfg (+3/-14)
lib/lp/app/templates/base-layout-macros.pt (+3/-2)
utilities/check-js-deps (+0/-1)
versions.cfg (+1/-0)
To merge this branch: bzr merge lp:~rharding/launchpad/lpyui-dep
Reviewer Review Type Date Requested Status
j.c.sackett (community) Approve
Review via email: mp+114430@code.launchpad.net

Commit message

Wire up the js.yui_version feature flag and have combo-rootdir use the launchpad_yui package for extracting YUI.

Description of the change

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

To post a comment you must log in.
Revision history for this message
j.c.sackett (jcsackett) wrote :

This looks ok to me, but I'll be the first to point out that I'm not a make/buildout expert. It may be worth following up with others with more experience in this part of our code.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile'
--- Makefile 2012-06-02 02:12:21 +0000
+++ Makefile 2012-07-12 13:52:23 +0000
@@ -189,11 +189,11 @@
189endif189endif
190190
191combobuild:191combobuild:
192 bin/combo-rootdir build/js
192 utilities/js-deps -n LP_MODULES -s build/js/lp -x '-min.js' -o build/js/lp/meta.js >/dev/null193 utilities/js-deps -n LP_MODULES -s build/js/lp -x '-min.js' -o build/js/lp/meta.js >/dev/null
193 utilities/check-js-deps194 utilities/check-js-deps
194195
195jsbuild: $(PY) $(JS_OUT)196jsbuild: $(PY) combobuild jsbuild_widget_css $(JS_OUT)
196 bin/combo-rootdir build/js
197197
198eggs:198eggs:
199 # Usually this is linked via link-external-sourcecode, but in199 # Usually this is linked via link-external-sourcecode, but in
200200
=== 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 @@
1414
15# Populate YUI.15# Populate YUI.
16if [ ! -h $BUILD_DIR/yui ]; then16if [ ! -h $BUILD_DIR/yui ]; then
17 ./bin/lpyui -d $BUILD_DIR extract
17 ln -sf yui-${versions:yui} $BUILD_DIR/yui18 ln -sf yui-${versions:yui} $BUILD_DIR/yui
18fi19fi
1920
2021
=== 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 @@
40[yui]40[yui]
41recipe = plone.recipe.command41recipe = plone.recipe.command
42command =42command =
43 mkdir -p ${buildout:yui-directory}/yui-${:yui_version}43 mkdir -p ${buildout:yui-directory}
44 rm -rf ${buildout:yui-directory}/yui-${:yui_version}/*
45 tar -zxf download-cache/dist/yui-${:yui_version}.tar.gz \
46 --wildcards --strip-components 2 \
47 -C ${buildout:yui-directory}/yui-${:yui_version} \
48 '*/build'
4944
50[yui-default]45[yui-default]
51<= yui46<= yui
52yui_version = ${versions:yui}47yui_version = ${versions:yui}
5348
54[yui-3.4]
55<= yui
56yui_version = 3.4.1
57
58[yui-3.5]
59<=yui
60yui_version = 3.5.0pr1
61
62[filetemplates]49[filetemplates]
63recipe = z3c.recipe.filetemplate50recipe = z3c.recipe.filetemplate
64source-directory = buildout-templates51source-directory = buildout-templates
@@ -70,6 +57,7 @@
70 funkload57 funkload
71 zc.zservertracelog58 zc.zservertracelog
72 pyinotify59 pyinotify
60 launchpad_yui
73 lpjsmin61 lpjsmin
74 jsautobuild62 jsautobuild
75 lazr.jobrunner63 lazr.jobrunner
@@ -89,6 +77,7 @@
89entry-points = stxdocs=zope.configuration.stxdocs:main77entry-points = stxdocs=zope.configuration.stxdocs:main
90 googletestservice=lp.services.googlesearch.googletestservice:main78 googletestservice=lp.services.googlesearch.googletestservice:main
91 tracereport=zc.zservertracelog.tracereport:main79 tracereport=zc.zservertracelog.tracereport:main
80 lpyui=launchpad_yui:main
9281
93[iharness]82[iharness]
94recipe = z3c.recipe.scripts83recipe = z3c.recipe.scripts
9584
=== 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 @@
8989
90 <tal:js-loader condition="request/features/js.combo_loader.enabled">90 <tal:js-loader condition="request/features/js.combo_loader.enabled">
91 <script type="text/javascript"91 <script type="text/javascript"
92 tal:attributes="src string:${combo_url}/?yui/yui/yui-min.js&amp;lp/meta.js&amp;yui/loader/loader-min.js"></script>92 tal:attributes="src string:${combo_url}/?${yui_version}/yui/yui-min.js&amp;lp/meta.js&amp;${yui_version}/loader/loader-min.js"></script>
93 <script type="text/javascript" tal:content="string:93 <script type="text/javascript" tal:content="string:
94 var raw = null;94 var raw = null;
95 if (LP.devmode) {95 if (LP.devmode) {
@@ -98,10 +98,11 @@
98 YUI.GlobalConfig = {98 YUI.GlobalConfig = {
99 combine: true,99 combine: true,
100 comboBase: '${combo_url}/?',100 comboBase: '${combo_url}/?',
101 root: 'yui/',101 root: '${yui_version}/',
102 filter: raw,102 filter: raw,
103 debug: ${yui_console_debug},103 debug: ${yui_console_debug},
104 fetchCSS: false,104 fetchCSS: false,
105 maxURLLength: 2500,
105 groups: {106 groups: {
106 lp: {107 lp: {
107 combine: true,108 combine: true,
108109
=== 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 @@
13 fi13 fi
14done14done
15exit $error15exit $error
16
1716
=== 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 @@
43keyring = 0.6.243keyring = 0.6.2
44kombu = 2.1.144kombu = 2.1.1
45launchpadlib = 1.10.245launchpadlib = 1.10.2
46launchpad-yui = 0.1
46lazr.amqp = 0.147lazr.amqp = 0.1
47lazr.authentication = 0.1.148lazr.authentication = 0.1.1
48lazr.batchnavigator = 1.2.1049lazr.batchnavigator = 1.2.10