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
1=== modified file 'Makefile'
2--- Makefile 2012-06-02 02:12:21 +0000
3+++ Makefile 2012-07-12 13:52:23 +0000
4@@ -189,11 +189,11 @@
5 endif
6
7 combobuild:
8+ bin/combo-rootdir build/js
9 utilities/js-deps -n LP_MODULES -s build/js/lp -x '-min.js' -o build/js/lp/meta.js >/dev/null
10 utilities/check-js-deps
11
12-jsbuild: $(PY) $(JS_OUT)
13- bin/combo-rootdir build/js
14+jsbuild: $(PY) combobuild jsbuild_widget_css $(JS_OUT)
15
16 eggs:
17 # Usually this is linked via link-external-sourcecode, but in
18
19=== modified file 'buildout-templates/bin/combo-rootdir.in'
20--- buildout-templates/bin/combo-rootdir.in 2012-02-23 12:15:01 +0000
21+++ buildout-templates/bin/combo-rootdir.in 2012-07-12 13:52:23 +0000
22@@ -14,6 +14,7 @@
23
24 # Populate YUI.
25 if [ ! -h $BUILD_DIR/yui ]; then
26+ ./bin/lpyui -d $BUILD_DIR extract
27 ln -sf yui-${versions:yui} $BUILD_DIR/yui
28 fi
29
30
31=== modified file 'buildout.cfg'
32--- buildout.cfg 2012-07-02 04:21:44 +0000
33+++ buildout.cfg 2012-07-12 13:52:23 +0000
34@@ -40,25 +40,12 @@
35 [yui]
36 recipe = plone.recipe.command
37 command =
38- mkdir -p ${buildout:yui-directory}/yui-${:yui_version}
39- rm -rf ${buildout:yui-directory}/yui-${:yui_version}/*
40- tar -zxf download-cache/dist/yui-${:yui_version}.tar.gz \
41- --wildcards --strip-components 2 \
42- -C ${buildout:yui-directory}/yui-${:yui_version} \
43- '*/build'
44+ mkdir -p ${buildout:yui-directory}
45
46 [yui-default]
47 <= yui
48 yui_version = ${versions:yui}
49
50-[yui-3.4]
51-<= yui
52-yui_version = 3.4.1
53-
54-[yui-3.5]
55-<=yui
56-yui_version = 3.5.0pr1
57-
58 [filetemplates]
59 recipe = z3c.recipe.filetemplate
60 source-directory = buildout-templates
61@@ -70,6 +57,7 @@
62 funkload
63 zc.zservertracelog
64 pyinotify
65+ launchpad_yui
66 lpjsmin
67 jsautobuild
68 lazr.jobrunner
69@@ -89,6 +77,7 @@
70 entry-points = stxdocs=zope.configuration.stxdocs:main
71 googletestservice=lp.services.googlesearch.googletestservice:main
72 tracereport=zc.zservertracelog.tracereport:main
73+ lpyui=launchpad_yui:main
74
75 [iharness]
76 recipe = z3c.recipe.scripts
77
78=== modified file 'lib/lp/app/templates/base-layout-macros.pt'
79--- lib/lp/app/templates/base-layout-macros.pt 2012-06-25 15:26:12 +0000
80+++ lib/lp/app/templates/base-layout-macros.pt 2012-07-12 13:52:23 +0000
81@@ -89,7 +89,7 @@
82
83 <tal:js-loader condition="request/features/js.combo_loader.enabled">
84 <script type="text/javascript"
85- tal:attributes="src string:${combo_url}/?yui/yui/yui-min.js&amp;lp/meta.js&amp;yui/loader/loader-min.js"></script>
86+ tal:attributes="src string:${combo_url}/?${yui_version}/yui/yui-min.js&amp;lp/meta.js&amp;${yui_version}/loader/loader-min.js"></script>
87 <script type="text/javascript" tal:content="string:
88 var raw = null;
89 if (LP.devmode) {
90@@ -98,10 +98,11 @@
91 YUI.GlobalConfig = {
92 combine: true,
93 comboBase: '${combo_url}/?',
94- root: 'yui/',
95+ root: '${yui_version}/',
96 filter: raw,
97 debug: ${yui_console_debug},
98 fetchCSS: false,
99+ maxURLLength: 2500,
100 groups: {
101 lp: {
102 combine: true,
103
104=== modified file 'utilities/check-js-deps'
105--- utilities/check-js-deps 2012-02-15 04:14:02 +0000
106+++ utilities/check-js-deps 2012-07-12 13:52:23 +0000
107@@ -13,4 +13,3 @@
108 fi
109 done
110 exit $error
111-
112
113=== modified file 'versions.cfg'
114--- versions.cfg 2012-07-10 09:56:38 +0000
115+++ versions.cfg 2012-07-12 13:52:23 +0000
116@@ -43,6 +43,7 @@
117 keyring = 0.6.2
118 kombu = 2.1.1
119 launchpadlib = 1.10.2
120+launchpad-yui = 0.1
121 lazr.amqp = 0.1
122 lazr.authentication = 0.1.1
123 lazr.batchnavigator = 1.2.10