Merge lp:~sinzui/launchpad/rdf-links-0 into lp:launchpad
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 11630 | ||||||||
Proposed branch: | lp:~sinzui/launchpad/rdf-links-0 | ||||||||
Merge into: | lp:launchpad | ||||||||
Diff against target: |
549 lines (+86/-194) 13 files modified
lib/lp/registry/browser/__init__.py (+28/-0) lib/lp/registry/browser/person.py (+5/-41) lib/lp/registry/browser/product.py (+6/-21) lib/lp/registry/browser/productrelease.py (+8/-23) lib/lp/registry/browser/productseries.py (+5/-21) lib/lp/registry/browser/project.py (+5/-20) lib/lp/registry/stories/person/xx-person-rdf.txt (+9/-46) lib/lp/registry/stories/product/xx-product-rdf.txt (+1/-6) lib/lp/registry/stories/project/xx-project-rdf.txt (+1/-6) lib/lp/registry/templates/person-rdf-contents.pt (+3/-4) lib/lp/registry/templates/product-rdf.pt (+5/-2) lib/lp/registry/templates/productrelease-rdf.pt (+5/-2) lib/lp/registry/templates/project-rdf.pt (+5/-2) |
||||||||
To merge this branch: | bzr merge lp:~sinzui/launchpad/rdf-links-0 | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Abel Deuring (community) | code | Approve | |
Review via email: mp+36475@code.launchpad.net |
Description of the change
This is my branch to reduce the work performed in +rdf views to prevent
timeouts.
lp:~sinzui/launchpad/rdf-links-0
Diff size: 550
Launchpad bug:
https:/
https:/
Test command: ./bin/test -vv \
-t stories/.*rdf
Pre-
Target release: 10.10
Reduce the work performed in +rdf views to prevent timeouts
-------
The example project RDF that times out are those owned by large teams. The
template uses a macro that renders the personal data for each member. Though
the method is optimised for a small team, it sill never scale to a large
team. Instead of using the macro to expand the owner, use a reference to the
person/team's rdf entry.
This problem is larger than to reported oopses. Project pages are indexed by
bots following links. The RDF for the owning teams also times out if you
try to access it; the link in in the head, not body of the page.
This branch also introduces a base class for RDF views because the
implementations are identical except for template and filename.
Rules
-----
* Update the RDF templates to include a reference to owner instead
embedding personal data.
* Remove the method that tries to collect team member information since
it will not be used
ADDENDUM
* Extract a base class for the RDF views. Each subclass must provide
a template and a filename.
QA
--
* Visit https:/
* Verify the page does not timeout
* Visit https:/
* Verify the page does not timeout
Lint
----
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
^ Lint reports a lot in indentation and line length issues un the rdf tests.
I will fix these after the review because the fix will make it appear that
I changed the entire file.
Test
----
Updated the tests to verify that members are referenced as resources instead
of being embedded.
* lib/lp/
* lib/lp/
* lib/lp/
* Updated the ascii test to use carlos directly since he is not embedded
in the team RDF.
* Removed the embedded member in team test for mugshots. The image
tests for users continue to work.
Implementation
--------------
Updated the templates to reference the person/team instead of embedding
the person/member's information. Remove trailing whitespace from some
templates and removed the definition of the macro used to expand members.
* lib/lp/
* lib/lp/
* lib/lp/
* lib/lp/
Extracted BaseRdfView view and updated the views to inherit. The existing
tests verify the filename and content types.
* lib/lp/
* lib/lp/
* lib/lp/
* lib/lp/
* lib/lp/
* lib/lp/
* Also removed buildMemberData() which is not needed.