Merge lp:~sinzui/launchpad/librarian-merge-proposal into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | j.c.sackett on 2012-11-29 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 16330 |
| Proposed branch: | lp:~sinzui/launchpad/librarian-merge-proposal |
| Merge into: | lp:launchpad |
| Diff against target: |
546 lines (+163/-75) 10 files modified
lib/lp/code/browser/branchmergeproposal.py (+13/-0) lib/lp/code/browser/tests/test_branchmergeproposal.py (+23/-0) lib/lp/code/model/branchmergeproposal.py (+1/-1) lib/lp/code/model/diff.py (+25/-1) lib/lp/code/model/tests/test_diff.py (+28/-0) lib/lp/code/templates/branchmergeproposal-diff.pt (+4/-0) lib/lp/scripts/utilities/importfascist.py (+44/-67) lib/lp/services/librarian/interfaces/client.py (+4/-1) lib/lp/services/librarian/tests/test_client.py (+20/-5) lib/lp/services/webapp/adapter.py (+1/-0) |
| To merge this branch: | bzr merge lp:~sinzui/launchpad/librarian-merge-proposal |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| j.c.sackett (community) | 2012-11-29 | Approve on 2012-11-29 | |
|
Review via email:
|
|||
Commit Message
Allow merge proposals to operate without the launchpad librarian.
Description of the Change
When the librarian is not available, merge proposal pages will not
load at all. We expect the librarian to not be available for as much
as an hour when it is upgraded to precises, but we want Lp to be
operational.
-------
RULES
Pre-
* Diff.text opens the LFA, self.diff_
the timeout.
* the default timeout is 5 seconds, which is the entire time Lp
allocates to a request. The 5s timeout was added when Lp had a
30s request time in 2009. It is impossible for the timeout to be
raised from with the webapp. Maybe the default should be 4 seconds.
when the the webapp is making the request.
* Diff.text can pass a timout that is 1s or 5s minus the remaing
time to ensure that the request time does not run out. After
some discussion, we believe 2s is more than amp for the
the librarian.
in the page.
* The LibrarianServer
* DiffRenderingMi
sanitise and recover from exceptions.
* The property could catch the LibrarianServer
open attempts exceed the timeout.
* The diff_oversized property just counts lines to return a bool.
It could return True if preview_diff_text handled the timeout.
ADDENDUM:
* I had a fight with with the import fascist. I won, by removing
all th ancient cruft, but had to give some ground by acknowledging
that there are dubious imports in some browser modules.
* There was more lint then expected in the old modules.
QA
* Visit https:/
* Verify the page loads and that it states that the diff could not
be retrieved at this time.
LINT
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
LoC
I have more than 16,000 line credit.
TEST
./bin/test -vvc lp.code.
./bin/test -vvc lp.code.
./bin/test -vvc lp.services.
IMPLEMENTATION
I updated view to try and recover from a failure to get the diff from
the librarian. The page will explain that the diff wasn't available, but
the user can reload or download it.
lib/
lib/
lib/
I changed the model to pass the timeout time to the LibrarianFileAlias. The
rules are a but complicated. Scripts run without timeouts. The webapp
should get the diff within 2 seconds -- otherwise something is very wrong.
If there is less that 2 seconds left in the request, the code shaves a bit
of time to set the timeout.
lib/
lib/
lib/
I exported the LibrarianServer
lib/
lib/
I removed all the checks for non-existent paths. The changes illustrate
how much Lp has changes since 2009. I re-enabled the database checks,
but the rules are clearly difficult to enforce. I added a list of
dubious imports so that the code continues to build even though
we think the design is wrong.
lib/

With the fix of the typo and comments we discussed in IRC, this looks good.
Thanks.