← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wallyworld/launchpad/person-index-timeout-931771 into lp:launchpad

 

The proposal to merge lp:~wallyworld/launchpad/person-index-timeout-931771 into lp:launchpad has been updated.

Description changed to:

== Implementation ==

The root cause of the bug is that the page iterates over all person ppas checking for launchpad.View permission. Each permission check does several queries. I refactored the implementation as follows:

I looked at the permission checking code in the security adaptor and gathered all the rules used to formulate the final database query done for each archive. I coded these rules in a method called get_enabled_archive_filter(). There is a new method on IPerson called getVisiblePPAs() which uses this filter to load in one query all the PPAs visible to the caller. This single call replaces the individual calls to the security adaptor.

The TAL and view have been refactored to use the new API. To ensure property caching works, I eliminated the subview and converted it to a macro, thus allowing the visible ppas to be loaded once and passed via a variable declaration to the macro.

Finally, I converted other permission checks IArchive in the security adaptors to use the new filter. This was simply to ensure that a common code base was used for the permission checks.

I got wgrant to run the queries on DF to ensure performance was acceptable and a few tweaks were need due to Postgres being "special".

== Tests ==

This is an internal change, so rely on existing tests.

== Lint ==

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/security.py
  lib/lp/registry/browser/person.py
  lib/lp/registry/interfaces/person.py
  lib/lp/registry/model/person.py
  lib/lp/soyuz/browser/archive.py
  lib/lp/soyuz/browser/configure.zcml
  lib/lp/soyuz/model/archive.py
  lib/lp/soyuz/templates/archive-activate.pt
  lib/lp/soyuz/templates/archive-macros.pt
  lib/lp/soyuz/templates/person-portlet-ppas.pt

For more details, see:
https://code.launchpad.net/~wallyworld/launchpad/person-index-timeout-931771/+merge/132446
-- 
https://code.launchpad.net/~wallyworld/launchpad/person-index-timeout-931771/+merge/132446
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wallyworld/launchpad/person-index-timeout-931771 into lp:launchpad.


References