Merge lp:~jtv/launchpad/bug-507681 into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Jeroen T. Vermeulen on 2010-02-19 |
| Approved revision: | not available |
| Merged at revision: | not available |
| Proposed branch: | lp:~jtv/launchpad/bug-507681 |
| Merge into: | lp:launchpad |
| Diff against target: |
566 lines (+288/-51) 9 files modified
configs/testrunner/launchpad-lazr.conf (+3/-0) lib/canonical/config/schema-lazr.conf (+4/-0) lib/lp/code/interfaces/branchjob.py (+24/-0) lib/lp/code/model/branchjob.py (+24/-41) lib/lp/codehosting/scanner/branch_scanner.py (+3/-1) lib/lp/codehosting/scanner/bzrsync.py (+11/-4) lib/lp/translations/interfaces/translationtemplatesbuildjob.py (+10/-0) lib/lp/translations/model/translationtemplatesbuildjob.py (+45/-1) lib/lp/translations/tests/test_translationtemplatesbuildjob.py (+164/-4) |
| To merge this branch: | bzr merge lp:~jtv/launchpad/bug-507681 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Paul Hummer (community) | code | 2010-02-17 | Approve on 2010-02-19 |
|
Review via email:
|
|||
Commit Message
Generate TranslationTemp
| Jeroen T. Vermeulen (jtv) wrote : | # |
| Paul Hummer (rockstar) wrote : | # |
I think this branch is quite good. I just have one piece of input, and that's a recent change to the branch scanner. I made the change, and anyone outside the code team probably wasn't aware, so it's probably good you changed.
branch_scanner.py is about to get deleted. We no longer use that codepath, and instead, use the BranchScanJob in lib/lp/
I promise this time I'll take a look tomorrow at the changes, and not let this branch go out as far as the last one (which I feel pretty sheepish about).
| Jeroen T. Vermeulen (jtv) wrote : | # |
I've added the event handler to branchjob, but left the obsolete code as I had it so there's some pointless duplication. Better than courting disaster if things evolve further before the obsolete code is culled.
Is it okay now?

= Bug 507681 =
This is the main work bug 507681, which in turn is part of the effort to generate translation templates on the build farm, based on source in a bzr tree.
This branch gets the branch scanner to create TranslationTemp lateBuildJobs for branch changes that may require new translation templates to be generated.
You'll see occasional reference to what we call "pottery." Pottery is a Translations module that deals with detecting various types of translation setup in a source code branch (we only support certain intltool setups at the moment) and generating templates from them.
Going through the diff step by step:
configs/ testrunner/ launchpad- lazr.conf config/ schema- lazr.conf
lib/canonical/
A new configuration item, rosetta. generate_ templates, enables or disables the generation of these jobs. It's off by default, to avoid interfering with Soyuz operation unnecessarily before these new jobs become useful. However the feature is enabled on the test runner.
lib/lp/ code/interfaces /branchjob. py code/model/ branchjob. py
lib/lp/
Two of the IRosettaUploadJ obSource utility methods were published in its interface. I changed their names to follow our naming style, and (after consultation with Henning) hopefully made the docstrings a bit clearer.
These two methods are used to control importing of templates and POFiles from a branch into a productseries' translations. Normally those imports are triggered by a change to the branch, but the user can also request a one-time import on the productseries.
For the one-time imports, a parameter force_translati ons_upload is set to True. When it's set, the importer ignores whether a productseries attached to the branch wants automatic translation imports from it and just uploads anyway.
This is strictly speaking a bug; it does the wrong thing when multiple productseries use the same branch. I isolated the brokenness a tiny bit by not passing on the force_translati ons_upload parameter to the "are there any productseries using this branch" method in the utility. Since force_translati ons_upload is an option on the productseries using the branch, it's safe to skip the check for productseries when the parameter is True.
In findProductSeries (née _find_product_ series) , I unified the two alternative queries to express that there is really only a very small difference.
lib/lp/ codehosting/ scanner/ branch_ scanner. py codehosting/ scanner/ bzrsync. py
lib/lp/
Here is where I registered an extra hook that runs when changes are pushed to a branch. This is similar to what other branch jobs already do; the real logic is in the ITranslationTem platesBuildJobS ource utility for ease of testing.
lib/lp/ translations/ interfaces/ translationtemp latesbuildjob. py translations/ model/translati ontemplatesbuil djob.py
lib/lp/
A bit more logic to see whether Launchpad should try to generate templates for a branch. For now we decided not to introduce a separate setting for this; we'll simply try to generate templates for each branch that has translation series importing templates from it.
Except that pottery has a function to check whether it's worth trying this. It makes no sense to bother a build-farm slave if a branch c...