Merge lp:~henninge/launchpad/bug-509557-invoke-pottery into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Henning Eggers | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | not available | ||||
Proposed branch: | lp:~henninge/launchpad/bug-509557-invoke-pottery | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
694 lines (+225/-208) 10 files modified
lib/canonical/buildd/debian/changelog (+6/-0) lib/canonical/buildd/debian/rules (+8/-15) lib/canonical/buildd/generate-translation-templates (+54/-0) lib/canonical/buildd/pottery/generate_translation_templates.py (+17/-10) lib/canonical/buildd/template-buildd-slave.conf (+3/-0) lib/canonical/buildd/tests/test_generate_translation_templates.py (+10/-6) lib/canonical/buildd/tests/test_translationtemplatesbuildmanager.py (+77/-48) lib/canonical/buildd/translationtemplates.py (+48/-127) lib/lp/translations/tests/test_pottery_detect_intltool.py (+1/-1) scripts/rosetta/pottery-generate-intltool.py (+1/-1) |
||||
To merge this branch: | bzr merge lp:~henninge/launchpad/bug-509557-invoke-pottery | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer (community) | code | Approve | |
Review via email: mp+21172@code.launchpad.net |
Commit message
Build slave for translation templates generation now mostly working.
Description of the change
= Bug 509557 =
Connects all dots within the build slave to get translation templates build jobs working. It undoes some things done in previous branches, namely:
- Moves pottery code from lp.translations
- The build manager that drives the slave through a state machine is now based on DebianBuildManager because it shares most of it's requirements and thus code. Made the TranslationTemp
Another big change is the introduction of the generate-
== Implementation details ==
=== modified file 'lib/canonical/
The package received a new version number.
=== modified file 'lib/canonical/
Removed getting the pottery code from the lp tree. Actually, just one new line is left in the file; it copies the pottery directory into the package.
=== added file 'lib/canonical/
The new shell script that prepares the chroot to run the python script that generates the templates.
=== added directory 'lib/canonical/
=== added file 'lib/canonical/
The new home for the slave-side pottery code
=== renamed file 'lib/canonical/
The script is now part of the package to be copied into the chroot with it. Also it's use of the HOME dir as temporary build directory does not go down well with tests. It's OK on the build slave, though, so I made that setting overridable.
=== renamed file 'lib/lp/
The file was named to "intltool.py" because it specifically generates templates using intltool. Other tools will get there own module here.
=== modified file 'lib/canonical/
The TranslationTemp
=== modified file 'lib/canonical/
New paths and use of temporary directory.
=== modified file 'lib/canonical/
Oh yeah, big changes here. This is testing the state machine of the build manager. Since the new build manager only implements two states, this test was reduced to test just those. But to get proper coverage I also added tests to check the fail behaviour.
The FakeSlave had to be pimped to react friendly to methods that it doesn't know about. It now even keeps track of those so that the test can see that build manager properly told the slave about a failure. I think that's cool.
=== modified file 'lib/canonical/
So, this is where it all happens. As mentioned earlier, most of this is deletion because most of the states are already implemented correctly in DebianBuildManager. This adds states for installation of extra packages (bzr and intltool) and calling the generate script.
DebianBuildManager calls doRunBuild to start the build but ist starts with doInstall here before it goes to doGenrate, so I added an alias to doInstall so that DebianBuildManager can find it.
Also, runInChroot was removed because it was flawed and only one usage remains inthe file (in doInstall) which is better done directly now.
I expect another state to be added soon to retrieve the generated templates.
=== modified file 'lib/lp/
=== modified file 'scripts/
New paths for old files.
= Test =
Oh yeah, that ... I tested this code using the steps I described here:
https:/
In addition, run the tests mentioned here:
bin/text -vvt generate_
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files:
lib/canonical
lib/canonical
lib/canonical
lib/canonical
lib/canonical
lib/canonical
lib/canonical
lib/canonical
lib/canonical
lib/canonical
lib/lp/
scripts/
== Pylint notices ==
scripts/
8: [W0403] Relative import '_pythonpath'
Looks good. I'm a little wary of adding new things to lib/canonical but it looks like it's a necessity to getting things done right now, and is not adding any more technical debt.