Translation Templates from Branch
This is an attempt to guide you through a manual test of the nascent mechanism to produce translation templates based on a bzr branch.
It still needs lots of work.
Enabling local branch access
mkdir -p /var/tmp/bazaar.launchpad.dev/static mkdir -p /var/tmp/ppa
There's a bug somewhere in Windmill that may break access to local branches through http.
To see if this is biting you, look in your Apache error log (/var/log/apache2/error.log) for a traceback ending with something like this (your home directory and the version numbers will vary):
File "/home/me/canonical/lp-sourcedeps/eggs/windmill-1.3beta3_lp_r1440-py2.5.egg/windmill/dep/_mozrunner/global_settings.py", line 42, in <module> def findInPath(fileName, path=os.environ['PATH']): File "/usr/lib/python2.5/UserDict.py", line 22, in __getitem__ raise KeyError(key) KeyError: 'PATH'
Near the top of the traceback you'll find mention of a Launchpad branch, probably canonical/lp-branches/devel or canonical/lp-branches/trunk. From that branch, remove two imports:
From lib/lp/testing/__init__.py remove this import:
from windmill.authoring import WindmillTestClient
From lib/canonical/testing/layers.py remove this:
from windmill.bin.admin_lib import ( start_windmill, teardown as windmill_teardown)
Now restart Apache.
Getting branch updates noticed
- Create a Launchpad source tree, and cd into it.
- Substituting your email address, run (parts may fail, but it's probably okay):
utilities/start-dev-soyuz.sh utilities/soyuz-sampledata-setup.py -e <your@email.address> make run_codehosting >/dev/null 2>&1 &
Open launchpad.dev in browser, log in as <your@email.address>, with password "test"
Create project "bf-test" for ppa-user at https://launchpad.dev/projects/+new
Register hosted branch "bf-test" for trunk at https://code.launchpad.dev/bf-test/trunk/+addbranch
Link branch to trunk at https://launchpad.dev/bf-test/trunk/+linkbranch
Enable translations for project at https://launchpad.dev/bf-test/+edit
Enable template imports for trunk at https://translations.launchpad.dev/bf-test/trunk/+translations-settings
- Create branch. Just paste into a terminal (you may be prompted for your GPG passphrase):
pushd /tmp bzr init bf-test cd bf-test cat <<EOF >test.c #include <gettext-po.h> #include <stdio.h> main(){puts(_("Hi"));} EOF mkdir po echo test.c >po/POTFILES.in bzr add test.c bzr add po bzr add po/POTFILES.in bzr commit -m "Setting up fake intltool branch." bzr push lp://dev/bf-test --remember --use-existing-dir popd
Back in your branch: make sync_branches
Now you should have a TranslationTemplatesBuildJob sitting in the BranchJob table. You should see a very wide line of data coming out of:
psql launchpad_dev -c ' select * from branchjob join job on job.id=branchjob.job join buildqueue on buildqueue.job=job.id where branchjob.job_type=6'
Preparing the slave
Follow the instructions for setting up a local buildd slave at BuildFarm/TryOutBuildSlave. Skip the part where it tells you to run Launchpad, since you're already running it.
Unfortunately the branch_url parameter you see in the json_data will not work on a dev system. So we have to hack it up a bit:
psql launchpad_dev -c " update branchjob set json_data = '{\"branch_url\": \"http://code.launchpad.dev/bf-test\"}' where branchjob.job_type=6 and json_data like '%http://bazaar.launchpad.dev/~ppa-user/bf-test/bf-test%'"
XXX: Actually that won't work either because the slave doesn't know about code.launchpad.dev. Have to get bazaar.launchpad.dev working.
Cleanup
To undo the changes made by utilities/soyuz-sampledata-setup.py:
rm -f /var/tmp/zeca/*
make schema