[WIP] Extension handler app: New eggs can be installed on the fly with a remote URL.

Review Request #3795 — Created Feb. 2, 2013 and discarded — Latest diff uploaded

Information

Djblets
master

Reviewers

Started on the extension handler module for djblets. Christian suggested that the extension browse/install/remove be a new app. These changes bring in a new app to djblets called "exthandler".

Currently, you can visit <rb>/admin/extensions/manager to view the changes. For now, you can install an extension on the fly. Point the URL field to an archive containing a RB extension (or any python egg for that matter), provide the package name and it'll be installed in the background. Once done, you can enable the newly installed extension at /admin/extensions. 

Known issues/limitations:
-If you try to install an extension that has previously been installed, it doesn't handle it quite well. Some searching ( http://trac.edgewall.org/ticket/7014 ) shows that it's a known issue. Since the already installed extension is being imported by the code elsewhere, the request fails. I'm yet to fix this.
-The archive you input has to have the setup.py file directly within; not in a subdirectory.
-If you enter a malformed URL (say a random page which leads to a 404) it isn't handled well. I'm yet to fix this too.


Some changes are dependant on reviewboard codebase too -- a new URL is added to the RB url.py that handles all /admin/extensions/manager/* urls to exthandler and the app exthandler itself has to be added to RB's settings.py under INSTALLED_APPS otherwise the templating fails.

Also fixed entry_points issue on the main extension module and hence the changes to djblets/extensions/base.py.
Tested with two RB extensions.

To test make sure you *don't* have reviewbot and/or rbxmlreview installed and they don't show up at /admin/extensions/

1) Test with rbxmlreview. Provide "http://andromeda.ayrus.net/rbxmlreview.zip" as the URL and "rbxmlreview" as the package name. A success message is expected. Click on the activate link and rbxmlreview should be added to the extensions list on the interface.

2) Test with Review Bot. Provide "http://andromeda.ayrus.net/extension.zip" as the URL and "review-bot-extension" as the package name. A success message is expected. Click on the activate link and Review Bot should be added to the extensions list on the interface.