Merge lp:~jtv/launchpad/bug-668194-fix-api into lp:launchpad
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Jeroen T. Vermeulen on 2010-10-29 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | 11829 | ||||
| Proposed branch: | lp:~jtv/launchpad/bug-668194-fix-api | ||||
| Merge into: | lp:launchpad | ||||
| Prerequisite: | lp:~jtv/launchpad/bug-668194-split-interfaces | ||||
| Diff against target: |
562 lines (+94/-78) 22 files modified
lib/lp/registry/configure.zcml (+0/-12) lib/lp/registry/interfaces/distribution.py (+5/-2) lib/lp/registry/interfaces/distroseries.py (+5/-1) lib/lp/registry/interfaces/person.py (+4/-1) lib/lp/registry/interfaces/product.py (+7/-3) lib/lp/registry/interfaces/productseries.py (+4/-1) lib/lp/registry/interfaces/sourcepackage.py (+4/-1) lib/lp/registry/model/distribution.py (+1/-1) lib/lp/registry/model/distroseries.py (+3/-3) lib/lp/registry/model/person.py (+1/-1) lib/lp/registry/model/product.py (+3/-3) lib/lp/registry/model/productseries.py (+3/-3) lib/lp/registry/model/sourcepackage.py (+3/-3) lib/lp/translations/browser/hastranslationimports.py (+3/-2) lib/lp/translations/interfaces/hastranslationimports.py (+1/-1) lib/lp/translations/interfaces/webservice.py (+0/-2) lib/lp/translations/model/approver.py (+4/-4) lib/lp/translations/model/hastranslationimports.py (+36/-0) lib/lp/translations/model/pofile.py (+3/-3) lib/lp/translations/model/translationimportqueue.py (+0/-26) lib/lp/translations/tests/test_translationtemplatesbuildbehavior.py (+4/-4) lib/lp/translations/utilities/tests/test_xpi_search.py (+0/-1) |
||||
| To merge this branch: | bzr merge lp:~jtv/launchpad/bug-668194-fix-api | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Abel Deuring (community) | code | 2010-10-29 | Approve on 2010-10-29 |
|
Review via email:
|
|||
Commit Message
Export IHasTranslation
Description of the Change
= Bug 668194: IHasTranslation
You may find this bug easier to review one commit at a time. I went through three stages:
1. Add IHasTranslation
2. Move HasTranslationT
3. Clean up pre-existing lint, insofar as it affected Translations. Not particularly interesting.
The first step is the crux of this branch. Previously, various classes that have translation import queues associated with them implement IHasTranslation
Unfortunately, setting things up this way created a useless new class on the API, corresponding to IHasTranslation
The second step is really just there to finish a forgotten piece of the preparatory work. The lint fixes I limited to Translations files because otherwise the diff would get out of hand just like that of the preparatory branch.
Besides the 20th-century-school inheritance setup, two other things are not really to my liking in this branch.
First: I can't test the fix. The current test uses the webservice object to test the presence of the new method, but the webservice object doesn't care about interfaces as specified in the WADL. So it was perfectly happy to call the method and thus prove that it worked, even though launchpadlib won't see it at all. I filed that as bug 668190.
I tried complementing and even re-writing the test to use launchpadlib instead of the webservice object. But the cost was entirely unacceptable—25 seconds or so. The proper place to test this is in the webservice object, not in the tests for each element of the web service API and especially not at such an enormous cost per.
That said, of course I did verify the fix manually and will do so again in Q/A.
Second thing I don't like: IHasTranslation
To run the test, such as it is (though I actually ran all Translations tests apart from the windmill ones):
{{{
./bin/test -vvc lp.translations
}}}
Jeroen

Hi Henning,
the code changes look overall good, but I am not very happy that we lie to our users. Would it be very difficult to tell people who don't have the permission to view the branch: "yes, there is a branch for synchronization, but sorry, you can't look at it."?
Did you discuss the different options with somebody?
Anyway, if there is an sort of agreement that it is OK to give the somehwat misleading message "no synchronization branch linked", I'll approve the branch. But could you change the doc string for has_import_enabled so that it says that the user permissions are "mixed into" the result value. And could you add such a doc string (or coemment) for has_exports_enabled and uses_bzr_sync?
Otherwise, developers might also be surprised if they use these properties without careful looking ;) (OK, I know that the code documented by the doc string/comment is just two lines below -- but at least I read somehwat selectively and could easily miss the additional clauses...