- Change Summary:
-
Found a spot in djblets/webapi/resources.py where I'd gone back to 2 spaces. Fixed.
- Diff:
-
Revision 2 (+335 -67)
Extension enabling/disabling API, with UI
Review Request #1618 — Created May 28, 2010 and submitted
This review request combines and modifies both http://reviews.reviewboard.org/r/1594 and http://reviews.reviewboard.org/r/1590/ . These requests have since been discarded. I've created an Extensions resource for the Djblets API. Authorized users can get the entire list of extensions from a GET on /api/extensions/, or info on a particular extension through a GET on /api/extensions/[extension id]/. Enabling and disabling extensions is accomplished through a PUT on /api/extensions/[extension id]/ with an "enabled" boolean parameter. The UI has been updated to use this API through AJAX queries. Errors during enabling/disabling should be displayed in a modal dialog box (see screenshot). Some of the CSS, and a few of the images have been copied from the RB project. Not sure if we want that duplication. Just a heads up. Another note - I've added a new field to the RegisteredExtensions table. This means, if you're following along with me, you'll need to perform an evolve on your DB. All feedback welcome.
All manual at this point. Which is unfortunate. :(
- Change Summary:
-
Adding the appropriate review group.
- Groups:
- Change Summary:
-
I've based this diff off of the current extensions branch - should be easier to apply now.
- Diff:
-
Revision 3 (+347 -37)
- Change Summary:
-
A return statement got cut off. Fixed.
- Diff:
-
Revision 4 (+348 -37)
-
-
-
-
-
-
-
-
I think the original formatting is fine, as that's the standard way it's done with Django urls.py files.
-
-
Since we're just reusing the default constructor, these can just be: class EnablingExtensionError(Exception): pass
-
-
Multi-line comments should be in this form: /* * Comment line 1 * Comment line 2 */ Also, this comment will be repeated per-extension. It should be moved out before the for loop.
-
-
-
-
-
This shouldn't say what value it returns specifically in the summary. More like: "Returns whether or not an extension has one or more disabled requirements."
-
-
-
-
I prefer not to have words like "can't" in a name. Maybe "ENABLE_EXTENSION_FAILED" and "DISABLE_EXTENSION_FAILED"
-
Constructor initialization should be first. Also, should user super() to initialize the parent class.
-
Try formatting it like: ext_class = self.extension_manager.get_installed_extension( registered_extension.class_name)
-
Doesn't enable_extension take care of this? If the problem is that our version is stale, then we should just re-fetch it on returning it, instead of faking the value.
- Change Summary:
-
Thanks for the feedback - updated.
- Diff:
-
Revision 5 (+327 -35)
- Change Summary:
-
Gave WebAPIError a with_message method, to return a copy of itself with a contextual message to override the default. InvalidExtensionError also now reports the ID of the extension that isn't recognized. InvalidExtensionErrors are now caught and handled through the ExtensionResource.
- Diff:
-
Revision 6 (+407 -37)
-
Can you re-pull and merge your branches and update this? It seems to include bits of other changes. Otherwise, looks good to me. I'll commit it once there's an updated patch.
- Change Summary:
-
Alright, I think I merged up this one properly. I think. Let me know if I didn't.
- Diff:
-
Revision 7 (+336 -33)
-
This patch is available here: http://github.com/mikeconley/djblets/commits/rr1618_extension_enabling_disabling_api
- Change Summary:
-
Patch updated for latest extensions branch
- Diff:
-
Revision 9 (+336 -34)