Merge lp:~jtv/launchpad/bug-580337 into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Edwin Grubbs | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 11083 | ||||
Proposed branch: | lp:~jtv/launchpad/bug-580337 | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
378 lines (+184/-45) 4 files modified
lib/canonical/buildd/debian/changelog (+6/-0) lib/canonical/buildd/pottery/intltool.py (+33/-8) lib/canonical/buildd/translationtemplates.py (+3/-1) lib/lp/translations/tests/test_pottery_detect_intltool.py (+142/-36) |
||||
To merge this branch: | bzr merge lp:~jtv/launchpad/bug-580337 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Edwin Grubbs (community) | Approve | ||
Canonical Launchpad Engineering | code | Pending | |
Review via email: mp+28880@code.launchpad.net |
Commit message
Make pottery deal with quotes.
Description of the change
= Bug 580337 =
The pottery code, which runs on build-farm slaves in order to generate translation templates from branches, was failing in some cases. The reason was that it attempts to extract a project name from the configure/
Here I add a bit of quote-stripping logic. It's pretty naïve, since project names are expected to be simple identifiers. After discussion with Henning, I applied it to both function parameters and variables, and removed the old special-case trick for removing M4-style bracket quotes.
A lot of the diff is actually a cleanup of the unit tests. The existing unit test created a single sample configuration file as part of its setup, for use as implicit state in the tests. Each test then verified one expected result from querying the file. This is poorly maintainable: a lot of what is being tested remains implicit ("the weird bit in this line doesn't affect how we deal with that line"). Such tests are easily broken by future maintenance of the test, or you find you can test one thing or the other but not both because they both need something different to be in the first/last place in a list etc. So I broke it up into individual explicit tests without reference to hidden state.
To exercise the tests:
{{{
./bin/test -vv -m lp.translations -t pottery
}}}
To Q/A, roll out this patch to the dogfood build slaves and generate some templates from branches. This is to verify that the existing functionality is still there. Then, do the same with lp:zeitgeist to see if that one has started working.
No lint.
Jeroen
Hi Jeroen,
Looks good. Just one comment below.
-Edwin
>=== modified file 'lib/canonical/ buildd/ pottery/ intltool. py' buildd/ pottery/ intltool. py 2010-05-07 09:54:50 +0000 buildd/ pottery/ intltool. py 2010-06-30 14:44:01 +0000
>--- lib/canonical/
>+++ lib/canonical/
>@@ -86,10 +86,9 @@
> if params is None or len(params) < 2:
> return None
> if len(params) < 4:
>- value = params[0]
>+ return params[0]
> else:
>- value = params[3]
>- return value.strip("[]")
>+ return params[3]
>
The docstring for _get_AC_ PACKAGE_ NAME still says:
"They may be enclosed in []."