Merge lp:~jtv/launchpad/bug-611217 into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Māris Fogels | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 12216 | ||||
Proposed branch: | lp:~jtv/launchpad/bug-611217 | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
328 lines (+129/-74) 6 files modified
lib/lp/translations/browser/tests/translationimportqueue-views.txt (+2/-2) lib/lp/translations/browser/translationimportqueue.py (+59/-56) lib/lp/translations/model/pofile.py (+16/-15) lib/lp/translations/model/translationimportqueue.py (+2/-1) lib/lp/translations/tests/test_autoapproval.py (+31/-0) lib/lp/translations/tests/test_pofile.py (+19/-0) |
||||
To merge this branch: | bzr merge lp:~jtv/launchpad/bug-611217 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Māris Fogels (community) | Approve | ||
Launchpad code reviewers | code | Pending | |
Review via email: mp+45883@code.launchpad.net |
Commit message
[r=mars][ui=none][bug=611217] Ignore POFiles for obsolete POTemplates during upload approval.
Description of the change
= Bug 611217 =
Not for the first time, the translations import queue gardener broke down recently because of name clashes.
The problem is this: a queue entry contains a translation file for a given productseries or source package (in this case it happened to be git in Ubuntu 10.10). The gardener's auto-approval code tries to match this to an existing POFile, based on a path match in that productseries or source package. POFileSet.
That combination of path and productseries/
Actually we have no particular interest in auto-approving translations for obsolete templates anyway. So in this branch I make _guessed_
In addition to this, I cleaned up some browser code that unnecessarily duplicated the logic of figuring out filename extensions (which is also done by the importer). I also found that it clashed with our coding standards and could generally be simpler, so that turned into a bit of a local rewrite. The only practical effect is that the notions of "template file" and "translation file" are no longer directly coupled to gettext ".po" and ".pot" files, respectively.
I ran various tests, but this should just about cover it:
{{{
./bin/test -vvc lp.translations -t queue -t approv -t test_pofile
}}}
The sign that this works will be that we no longer get these crises where Ubuntu and manual translation uploads stop being approved. For active Q/A, we'll want to make sure that manual uploads are still approved automatically in each of 3 scenarios:
* There is a POFile with a matching path.
* There is a POFile for the language, but with a different path.
* There is no POFile for the language.
No lint,
Jeroen
Hi Jeroen,
This change looks great, r=mars.
I think you have one stray if-statement around line 72 of the diff: you can probably collapse that into a straight if/elif instead of nested statements.
Looks good!