Merge lp:~leonardr/launchpad/multiversion-integration into lp:launchpad/db-devel
| Status: | Merged |
|---|---|
| Approved by: | Eleanor Berger on 2010-02-15 |
| Approved revision: | not available |
| Merged at revision: | not available |
| Proposed branch: | lp:~leonardr/launchpad/multiversion-integration |
| Merge into: | lp:launchpad/db-devel |
| Diff against target: |
1348 lines (+301/-233) (has conflicts) 32 files modified
lib/canonical/launchpad/configure.zcml (+2/-0) lib/canonical/launchpad/interfaces/launchpad.py (+2/-1) lib/canonical/launchpad/javascript/bugs/bugtask-index.js (+1/-1) lib/canonical/launchpad/javascript/client/client.js (+3/-3) lib/canonical/launchpad/javascript/lp/comment.js (+1/-1) lib/canonical/launchpad/pagetests/webservice/xx-service.txt (+43/-14) lib/canonical/launchpad/rest/configuration.py (+4/-5) lib/canonical/launchpad/testing/pages.py (+2/-0) lib/canonical/launchpad/webapp/servers.py (+9/-3) lib/canonical/launchpad/webapp/tests/__init__.py (+0/-27) lib/canonical/launchpad/webapp/tests/test_dbpolicy.py (+3/-3) lib/canonical/launchpad/webapp/tests/test_servers.py (+41/-25) lib/canonical/launchpad/windmill/jstests/launchpad_ajax.js (+15/-15) lib/canonical/launchpad/zcml/webservice.zcml (+6/-1) lib/canonical/lazr/doc/folder.txt (+13/-13) lib/canonical/lazr/doc/menus.txt (+1/-1) lib/canonical/widgets/lazrjs.py (+9/-4) lib/lp/bugs/adapters/bug.py (+5/-2) lib/lp/code/browser/configure.zcml (+6/-0) lib/lp/code/browser/diff.py (+12/-4) lib/lp/code/browser/tests/test_tales.py (+12/-1) lib/lp/code/model/branch.py (+1/-1) lib/lp/code/model/tests/test_branch.py (+1/-1) lib/lp/code/stories/branches/xx-bug-branch-links.txt (+31/-5) lib/lp/code/templates/branch-delete.pt (+1/-1) lib/lp/registry/doc/sourcepackage.txt (+38/-61) lib/lp/registry/model/sourcepackage.py (+9/-28) lib/lp/testing/factory.py (+9/-0) lib/lp/testopenid/browser/server.py (+3/-6) lib/lp/testopenid/interfaces/server.py (+12/-0) lib/lp/testopenid/testing/helpers.py (+2/-2) versions.cfg (+4/-4) Text conflict in lib/lp/testing/factory.py |
| To merge this branch: | bzr merge lp:~leonardr/launchpad/multiversion-integration |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Eleanor Berger (community) | code | 2010-02-15 | Approve on 2010-02-15 |
|
Review via email:
|
|||
| Leonard Richardson (leonardr) wrote : | # |
| Leonard Richardson (leonardr) wrote : | # |
I'm afraid I need a follow-up review. I had some Javascript test failures because lazr.restful was generating URLs to the most recent version of the web service ("/api/
After consultation with flacoste, gary, and mars, we decided to make Launchpad start using the bleeding edge version of the web serice. flacoste says our test coverage is good enough that when we make a backwards-
The two advantages of using /api/devel in the future are that 1) we won't have to have "porting sessions" where we're about to deprecate version N so we have to port all of Launchpad to version N+1. It'll happen over time as we make the backwards-
I'll also be changing versions.txt to use lazr.restful 0.9.20, but I haven't actually created that version yet--the branch is still in review.
| Leonard Richardson (leonardr) wrote : | # |
Unfortunately I'm experiencing still more test failures. The work continues!
| Leonard Richardson (leonardr) wrote : | # |
OK, ready for another review. The changes:
1. The folder tests were creating a FakeRequest that wasn't associated with any particular version. This was croaking lazr.restful, which always needs to know the version of an incoming request.
2. The Javascript widgets were poking into the lazr.restful internals and looking at the annotations. The 'mutated_by' annotation was changed in the multiversion code to a dict of 'mutator_
3. Changed Launchpad to use the new 0.9.21 release of lazr.restful, which fixes many other test failures.
| Leonard Richardson (leonardr) wrote : | # |
4. The new version of lazr.restful changed the implementation of get_current_
| Leonard Richardson (leonardr) wrote : | # |
http://
Hopefully this will be the last one. The other times I had to go back and do a new release of lazr.restful, and the changes in that new release broke some additional tests in Launchpad. This time I have only made changes to Launchpad, so this shouldn't happen again. (Though I should be making changes to lazr.restful eventually, it doesn't have to be now.)
The major failure here was in servers.py, the unit test of the web service traversal code. This was a subclass of DummyConfigurat
In the new version of lazr.restful, a small IWebServiceConf
Fortunately, I already ran into this problem with lazr.restful's unit tests, and created a test class that sets up a fake web service, WebServiceTestCase. In this branch, I replace DummyConfigurat
Since WebServiceTestCase has everything found in DummyConfigurat
However, WebServiceTestCase (along with IGenericCollection and everything else imported from lazr.restful.
I plan to move that code to lazr.restful.

This branch depends on updated releases of httplib2, lazr.restful, lazr.restfulclient, and launchpadlib. The new launchpadlib release has not been finalized yet, but you can find the code here: https:/ /code.edge. launchpad. net/~leonardr/ launchpadlib/ multiversion/ +merge/ 19343
This branch integrates the multi-versioning lazr.restful code into Launchpad.
0. I change IWebServiceAppl ication so it subclasses IServiceRootRes ource; lazr.restful now requires the root resource to be registered as a utility, and the IWSA is already a utility.
1. I run grok on the canonical. launchpad. rest directory so that certain code will run. This is the code that looks in IWebServiceConf iguration. active_ versions and generates a marker interface for each version.
2. I create a "1.0" web service between "beta" and "devel". To avoid massive changes to tests due to changed URLs, I change the LaunchpadWebSer viceCaller so that it still makes requests to the 'beta' web service.
3. I changed Launchpad's test request object to take a version name as an argument, and stamp the request object with that version name and with the corresponding marker interface. lazr.restful takes care of this for normal HTTP requests, but test requests don't go through the normal traversal code.
4. I changed bugcomment_to_entry from a simple IEntry adapter to a multi-adapter that adapts an object and a version marker interface. (All IEntry lookups are now multi-adapter lookups.)
5. I added a test that proves Launchpad responds to all the versions. Since there are as yet no differences between the versions, that's all it tests.