Extension browser module with search/install feature from a remote store.
Review Request #3906 — Created Feb. 23, 2013 and discarded
Extension browser module - Supports searching and installing extensions. Extensions are retrieved from a remote extension store and are accessed through the store's API. JSON responses are expected back. This review request follows: http://www.youtube.com/watch?v=Xvntl7ksjPA&hd=1 (partially). Change is also dependant on a modification to djblets/extensions/base.py -- method which performs an installation through easy_install given a remote archive containting an egg -- as on /r/3973
Description | From | Last Updated |
---|---|---|
One thing that strikes me is that when you switch from tab to tab, the size of the modal changes, … |
mike_conley | |
Detail - tabs should touch their content. |
mike_conley | |
Er, isn't this a change from one of your original easyfix bugs? |
mike_conley | |
Imports are always in up to 3 groups: 1) Python-bundled modules 2) Third-party modules (like simplejson) 3) Project's modules (like … |
chipx86 | |
Shouldn't use simplejson. Instead, for now, use django.utils.simplejson. (This is going away, but let's be consistent for now.) |
chipx86 | |
We now have multiple things named Extension. Let's change this one to StoreExtensionInfo. |
chipx86 | |
This is very technical and too specific to the current workflow. This level of code should not know how it … |
chipx86 | |
This is the kind of thing that should be handled by the rendering, not core logic. I'd say just nuke … |
chipx86 | |
The JSON response part is an implementation detail, and not something that needs to be known to consumers of the … |
chipx86 | |
Remove the blank line. |
chipx86 | |
Generally when a list comprehension spans multiple lines, we like to do: self.foo = [ ext.dist.project_name.lower() for ext in .... … |
chipx86 | |
Col: 21 E128 continuation line under-indented for visual indent |
reviewbot | |
Use format strings. They're cheaper for Python. |
chipx86 | |
Same. In fact, combine this with the previous line, too. |
chipx86 | |
What happens when/if this fails? |
chipx86 | |
Make sure to change the "Extension" part when renaming the class. |
chipx86 | |
typo: corresponding |
mike_conley | |
Since we're using a dictionary, does this mean we can't rely on any certain ordering from the server? |
chipx86 | |
If an extension manager wasn't passed to the constructor, self.installed_extensions will be None, which is not iterable. |
mike_conley | |
Given how many arguments we have, and that this will likely grow, can you instead use keyword arguments for this? … |
chipx86 | |
typo: package |
mike_conley | |
It may not be a zip file. It could be an egg, or tar.gz, or whatever. Best not to be … |
chipx86 | |
We're repeating the whole HTTP code a couple times. Can this be consolidated into a wrapper function? |
chipx86 | |
One-line summaries shouldn't have both """ on the same line. In this function, though, there's no documentation on what this … |
chipx86 | |
Wouldn't we want to pass the error on to the caller instead of swallowing it silently? |
mike_conley | |
Shouldn't have the ":" in the label. That's a rendering detail. |
chipx86 | |
See about using {% static %} for this, since {% admin_media_prefix %} is going away. |
chipx86 | |
Shouldn't use either of these. Instead, use {% compressed_css %} with some name, which you'll register in settings.py in PIPELINE_CSS. … |
chipx86 | |
Should be scripts-post, so that we load this after rendering the page. |
chipx86 | |
Blank line before this. |
chipx86 | |
Always use {% url %} instead of hard-coding URLs. |
chipx86 | |
All of the strings in here should be wrapped in trans blocks |
mike_conley | |
Indentation is screwy. |
chipx86 | |
Use {% trans %} |
chipx86 | |
Any IDs we don't need should be removed. Any we do should be properly namespaced. |
chipx86 | |
Use {% trans %} for all these strings. Go through the files and make sure you're always localizing. |
chipx86 | |
Seem to have some tab vs. space problems. Make sure this file has no tabs, and no trailing whitespace. |
chipx86 | |
Classes always use -, not _ |
chipx86 | |
Never use . Any styling is up to a stylesheet. |
chipx86 | |
Never use , for the same reason as . |
chipx86 | |
Trans blocks for the strings in here. |
mike_conley | |
Don't use . Should use . |
chipx86 | |
Why do you need this? It feels wrong having it. |
chipx86 | |
Col: 5 E128 continuation line under-indented for visual indent |
reviewbot | |
Two things URLs should always have: 1) A trailing / 2) A name= parameter. |
chipx86 | |
Should be separated by a blank line. |
chipx86 | |
No blank line. |
chipx86 | |
Would you mind maybe putting a "_ajax" suffix on any functions like this? Actually though, I think this function would … |
chipx86 | |
No blank line. |
chipx86 | |
We do this more than once. Best to pull it out in the beginning. |
chipx86 | |
typo: sanitizing |
mike_conley | |
No blank line. |
chipx86 | |
typo: obtaining |
mike_conley | |
A good thing of polish would be to change these error strings. They should be more human-readable, less technical, and … |
chipx86 | |
This is kind of funky. I'd suggest getting the extension manager first, then operating on it. If you still need … |
chipx86 | |
Remove the blank line. |
chipx86 | |
Best to use format strings. |
chipx86 | |
Did it? If we catch an Exception on lines 57-58, we'll store the error string in response, but the status … |
mike_conley | |
Remove the blank line. |
chipx86 | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
Some of the same comments. |
chipx86 | |
Go through and apply the same blank line removal as the previous change. Blank lines are good, but there shouldn't … |
chipx86 | |
This should default to None. You can override it in your own settings_local.py. |
chipx86 | |
As Mike mention, this should be a .less file. Also make sure ou are following our style. At a quick … |
chipx86 | |
"Listener" Same elsewhere. Note that you should be using 4 space indentation (no tabs!) everywhere. |
chipx86 | |
Space before { Same throughout the file. Also, you're fetching .item_actions more than once. This will traverse the entire DOM. … |
chipx86 | |
jQuery does chaining, so you can do: $('#' + id) .hide() .after(...) Note that you shouldn't be building HTML though. |
chipx86 | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Should have a trailing slash after "browser" I would change "browser" to "browse" in the URL, though. Also, this is … |
chipx86 | |
reviewboard.extensionbrowser isn't being recognized as a module because there's no __init__.py under reviewboard/extensionbrowser. You probably have one locally, but haven't … |
mike_conley | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 80 E501 line too long (95 > 79 characters) |
reviewbot | |
"Keywords" should maybe be wrapped in an underscore function. Also, not sure "Keywords" is the right word to use here. … |
mike_conley | |
"Search" should be in a trans tag |
mike_conley | |
Mind if I ask why a wasn't used here instead? I know we didn't want it to *look* like a … |
mike_conley | |
Col: 5 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 8 W292 no newline at end of file |
reviewbot | |
We use 2 spaces indentation in our .css, and I think you've used tabs. Also, please put your properties in … |
mike_conley | |
id:, as opposed to id : |
mike_conley | |
Space before { |
mike_conley | |
Please remove this log |
mike_conley | |
Modals are not usually the best way to handle things. We have a thing that drops down from the top … |
mike_conley | |
Space before { after function() - true for the rest of these Javascript files too. |
mike_conley | |
I wonder if instead of tossing this into the view, we render this as a hidden node in the page. … |
mike_conley | |
remove the newline |
mike_conley | |
remove the newline |
mike_conley | |
No newline. |
mike_conley | |
Yes please. :) |
mike_conley | |
See my other comment, re the "Loading" banner. |
mike_conley | |
No newline. |
mike_conley | |
var targets = ["ext-information", "ext-screenshots", etc]; is preferable over new Array. |
mike_conley | |
Again, I wonder if these should be in the rendered HTML instead, in something like this: ... Instead, for translation, … |
mike_conley | |
[] as opposed to new Array. Also, this looks related to the array on line 91. If we end up … |
mike_conley | |
Col: 35 W291 trailing whitespace |
reviewbot | |
These should be in alphabetical order, so DOES_NOT_EXIST, EXTENSION_INSTALLED, INVALID_FORM_DATA, NOT_LOGGED_IN, PERMISSION_DENIED. |
mike_conley | |
EXTENSION_INSTALLED does not seem to exist in either this patch, or in the patch in /r/3973 |
mike_conley | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
Needs documentation - see ServerInfoResource, for example. |
mike_conley | |
Needs documentation. I guess that's what this handy newline is supposed to indicate. :) |
mike_conley | |
Might be worth logging the error details too. |
mike_conley | |
Needs documentation |
mike_conley | |
Needs documentation |
mike_conley | |
Col: 21 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 21 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 17 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
We should probably log this error. |
mike_conley | |
Does this need to get wrapped in an underscore translation function? |
mike_conley | |
We should definitely log this, and maybe throw a new INSTALL_EXTENSION_FAILED error? |
mike_conley | |
Documentation needed. |
mike_conley | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 57 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 5 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 59 W291 trailing whitespace |
reviewbot | |
Col: 13 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 52 E502 the backslash is redundant between brackets |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 53 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 5 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 83 W291 trailing whitespace |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 61 W291 trailing whitespace |
reviewbot | |
Col: 53 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 5 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot | |
[comment deleted] |
mike_conley | |
[comment deleted] |
mike_conley | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
On attempting a search with this latest patch, I'm getting this trace: http://pastie.org/7308158 Apparently, json.JSONDecodeError doesn't exist for my version … |
mike_conley | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
[comment deleted] |
mike_conley | |
[comment deleted] |
mike_conley | |
Col: 53 E127 continuation line over-indented for visual indent |
reviewbot | |
Trailing whitespace. |
mike_conley | |
Trailing whitespace |
mike_conley | |
Col: 5 E128 continuation line under-indented for visual indent |
reviewbot | |
Trailing whitespace |
mike_conley | |
var TabbedModalBoxView |
mike_conley | |
typo: install -> installs |
mike_conley | |
var InfoView |
mike_conley | |
Trailing whitespace |
mike_conley | |
Nit - indent one more space. |
mike_conley | |
Swap INVALID_FORM_DATA and INSTALL_EXTENSION_FAILED. |
mike_conley | |
Col: 13 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot | |
Can we pull this out into its own patch? I'd like to get it into a release. Also, I think … |
chipx86 | |
No blank line here. |
chipx86 | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
We should rename 'id' to something else. id is a reserved keyword. |
chipx86 | |
These blank lines should be removed. |
chipx86 | |
Blank line before this. |
chipx86 | |
There are alignment problems here. |
chipx86 | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Comma after "dependencies" |
chipx86 | |
Blank line before. |
chipx86 | |
Generally we'll do: return { 'error': ..., } |
chipx86 | |
Kind of awkwardly formatted. I'd prefer: response[1][....] = \ package_name in self.installed_extension |
chipx86 | |
Col: 53 E127 continuation line over-indented for visual indent |
reviewbot | |
Space before the "/>" |
chipx86 | |
IDs like "results" make me nervous. Far too generic. Prefixing a lot of these IDs with something to make them … |
chipx86 | |
These should be indented relative to other template tags. They're too far indented right now. Same with the other nearby … |
chipx86 | |
Missing {% trans %} tags. |
chipx86 | |
You shouldn't need the "./" part. |
chipx86 | |
Blank line before this. |
chipx86 | |
Indent "compressed_js" one space. |
chipx86 | |
Col: 5 E128 continuation line under-indented for visual indent |
reviewbot | |
Blank line before this. |
chipx86 | |
Blank line before this. |
chipx86 | |
No blank line here. |
chipx86 | |
Should be formatted like: params = { 'query': ..., 'offset': ..., } |
chipx86 | |
Blank line before this. |
chipx86 | |
Comma after. |
chipx86 | |
Swap these. Alphabetical order. |
chipx86 | |
Should be nesting these better in the li above, like: li { ... &.header div { ... } div { … |
chipx86 | |
Can this be removed now? |
chipx86 | |
The name should be a bit more specific, name-wise. I'd also feel better with this file not being here in … |
chipx86 | |
Defaults goes first. |
chipx86 | |
This is an unsafe assumption. You should use: SITE_ROOT + "api/..." |
chipx86 | |
No blank line here. |
chipx86 | |
Only one model per file. This needs to be in a separate file. |
chipx86 | |
defaults goes first. |
chipx86 | |
Same comment as above. |
chipx86 | |
Why's this blank? |
chipx86 | |
No blank line. |
chipx86 | |
Remove this. We get it by default. |
chipx86 | |
I'm not sure we need this. I'd prefer not using _bindAll unless we have specific uses. In general, we should … |
chipx86 | |
As in my previous comment, this should be using _.template, and joining an array of lines. |
chipx86 | |
One var statement per function, at the top of the function, with each parameter being on its own line, comma-separated. … |
chipx86 | |
Should be: this.$el .html(template) .modalBox(); As for the class, that should go in the className field at the top of … |
chipx86 | |
Should be: new InfoView({ model: this.model }) |
chipx86 | |
No blank line. |
chipx86 | |
Each template should be compiled here, once, and not later. |
chipx86 | |
Remove this. We get it by default. |
chipx86 | |
Same comment as above. |
chipx86 | |
render shouldn't take an ID. I think if we have this one thing representing different tabs, we should really just … |
chipx86 | |
Should be done inline above, so it's only ever done once per page. |
chipx86 | |
this.$el |
chipx86 | |
A view should never pack itself. That's up to the code creating and rendering the class. |
chipx86 | |
The dictionary fields should be indented 1 level from the "var extension_install". Also, extension_install should be extensionInstallInfo. (No underscores in … |
chipx86 | |
No need for the 'self'. Instead, pass 'this' as the second parameter to save(), which will bind the proper context. |
chipx86 | |
Alphabetical order. |
chipx86 | |
No blank line. |
chipx86 | |
This is too generic, given the context. This file's too big. I'd recommend we start breaking this out. Maybe put … |
chipx86 | |
Summaries can only be one line. |
chipx86 | |
There should be a has_access_permissions function that does this, and the get function should call that. |
chipx86 | |
Put package_name in the parameter list for the function, and then pass to get_links below. |
chipx86 | |
Blank line before this. |
chipx86 | |
Not enough context in the log statement. |
chipx86 | |
Should be removed. |
chipx86 | |
The fields should be on their own lines, just like other resources. |
chipx86 | |
This shouldn't be able to work. It will turn into ('P', 'O', 'S', 'T'). Make sure it's ('POST',) |
chipx86 | |
Same comment as above. |
chipx86 | |
Alignment issue. The _entrypoint_iterator() is private and shouldn't be used. There'd need to be an accessor. |
chipx86 | |
Col: 13 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot | |
The wrapping is weird. You're calling get_extension_manager() a lot. Call it once and just use that variable. |
chipx86 | |
There needs to be more context. I think, though, that install_extension should be logging. |
chipx86 | |
Summaries can only be one line. |
chipx86 |
-
Surya: This is really coming along nicely. Just some high-level suggestions / notes, along with some typos I noticed. There are a few style things also worth fixing, but we'll bring those up when you're out of WIP. Let me know if you have any questions. Thanks, -Mike
-
-
-
-
If an extension manager wasn't passed to the constructor, self.installed_extensions will be None, which is not iterable.
-
-
-
-
-
-
-
Did it? If we catch an Exception on lines 57-58, we'll store the error string in response, but the status will be 204? That doesn't sound right.
-
You might want to check out how we use LessCSS to compile our CSS and use things like variables to use common colours, etc.
-
This is looking cool, but there's a lot of stylistic stuff to fix up, and some more important architectural stuff. We're moving all our JavaScript to be Model/View based, using Backbone.js. I want to see all new JavaScript fit this. Start thinking in terms of objects that contain data/core logic, and objects that render (using templates, building jQuery elements, etc.). You can look at some of our other code to see how we're doing this, and of course talk to us if you need help structuring it.
-
Imports are always in up to 3 groups: 1) Python-bundled modules 2) Third-party modules (like simplejson) 3) Project's modules (like reviewboard) Separated by blank lines. Also, never import from reviewboard.settings. This should be using: from django.conf import settings They're too very different things. One is our settings file, another is a wrapper that may be modified dynamically (by siteconfig).
-
Shouldn't use simplejson. Instead, for now, use django.utils.simplejson. (This is going away, but let's be consistent for now.)
-
-
This is very technical and too specific to the current workflow. This level of code should not know how it will be used (as that may change). Instead, it should just say what it is and what, in general, it's meant to represent.
-
This is the kind of thing that should be handled by the rendering, not core logic. I'd say just nuke this function and do this in the template.
-
The JSON response part is an implementation detail, and not something that needs to be known to consumers of the API.
-
-
Generally when a list comprehension spans multiple lines, we like to do: self.foo = [ ext.dist.project_name.lower() for ext in .... ]
-
-
-
-
-
Since we're using a dictionary, does this mean we can't rely on any certain ordering from the server?
-
Given how many arguments we have, and that this will likely grow, can you instead use keyword arguments for this? And then wrap the values so they're indented 1 level from the previous line, with one keyword argument per line.
-
-
We're repeating the whole HTTP code a couple times. Can this be consolidated into a wrapper function?
-
One-line summaries shouldn't have both """ on the same line. In this function, though, there's no documentation on what this extension information is.
-
-
-
Shouldn't use either of these. Instead, use {% compressed_css %} with some name, which you'll register in settings.py in PIPELINE_CSS. This will list all the CSS files you use. This ties into our build system, so that 3 files can be turned into one minified file.
-
-
-
-
-
-
-
-
-
Seem to have some tab vs. space problems. Make sure this file has no tabs, and no trailing whitespace.
-
-
-
-
-
-
-
-
-
Would you mind maybe putting a "_ajax" suffix on any functions like this? Actually though, I think this function would be best done as an API resource. Maybe a next step on top of this change. That way, we can continue to use our API as the one true way to talk to Review Board for most things, and admins can script installation of extensions.
-
-
-
-
A good thing of polish would be to change these error strings. They should be more human-readable, less technical, and say roughly what went wrong, maybe even what to do about it.
-
This is kind of funky. I'd suggest getting the extension manager first, then operating on it. If you still need to wrap, wrap at the argument level.
-
-
-
-
-
Go through and apply the same blank line removal as the previous change. Blank lines are good, but there shouldn't be one in the following cases: 1) At the start of a function. 2) Before an else/elif block.
-
-
As Mike mention, this should be a .less file. Also make sure ou are following our style. At a quick glance: 1) Always have a space before { 2) Indent with 2 spaces.
-
-
Space before { Same throughout the file. Also, you're fetching .item_actions more than once. This will traverse the entire DOM. Best to fetch that only once (and within some known parent element), and then fetch whatever else you need from it.
-
jQuery does chaining, so you can do: $('#' + id) .hide() .after(...) Note that you shouldn't be building HTML though.
-
Should have a trailing slash after "browser" I would change "browser" to "browse" in the URL, though. Also, this is longer than 80 chars, so wrap the include to the next line.
- Change Summary:
-
The details of a extension are now shown within a tabbed modal box. (see screenshots) Ported existing (and added new features) AJAX calls to Backbone models/views. Seeking details of an extension and installing an extension from a remote source is now part of the API. Most predominant changes are within the webAPI and Backbone additions. Some other questions: -Should the installation endpoint be within the resource /api/extension/install? This would make more sense. -I have added some error handling questions in the codebase with "XXX:".
- Description:
-
Extension browser module - Supports searching and installing extensions. Extensions are retrieved from a remote extension store and are accessed through the store's API. JSON responses are expected back.
This review request follows: http://www.youtube.com/watch?v=Xvntl7ksjPA&hd=1
~ Change is also dependant on a modification to djblets/extensions/base.py -- method which performs an installation through easy_install given a remote ZIP file containting an egg.
~ Change is also dependant on a modification to djblets/extensions/base.py -- method which performs an installation through easy_install given a remote archive containting an egg.
- Diff:
-
Revision 2 (+1183 -1)
- Added Files:
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/settings.py reviewboard/webapi/resources.py reviewboard/extensionbrowser/base.py reviewboard/extensionbrowser/forms.py reviewboard/extensionbrowser/views.py reviewboard/urls.py reviewboard/extensionbrowser/urls.py Ignored Files: reviewboard/static/rb/css/images/ui-icons_2e83ff_256x240.png reviewboard/static/rb/css/images/ui-bg_glass_95_fef1ec_1x400.png reviewboard/static/rb/css/images/ui-icons_469bdd_256x240.png reviewboard/static/rb/css/images/ui-bg_inset-hard_100_fcfdfd_1x100.png reviewboard/static/rb/css/images/ui-icons_f9bd01_256x240.png reviewboard/static/rb/css/extensionbrowser.css reviewboard/static/rb/css/images/ui-icons_217bc0_256x240.png reviewboard/static/rb/css/images/ui-icons_d8e7f3_256x240.png reviewboard/static/rb/css/jquery-ui-1.10.1.custom.css reviewboard/extensionbrowser/templates/extensionbrowser/extension_browser.html reviewboard/static/rb/js/models/extensionInformationModel.js reviewboard/static/rb/css/images/ui-bg_inset-hard_100_f5f8f9_1x100.png reviewboard/static/rb/js/extensionbrowser.js reviewboard/static/rb/css/images/ui-bg_glass_85_dfeffc_1x400.png reviewboard/static/rb/css/images/ui-icons_6da8d5_256x240.png reviewboard/static/rb/css/images/ui-icons_cd0a0a_256x240.png reviewboard/static/rb/css/images/ui-bg_flat_55_fbec88_40x100.png reviewboard/static/rb/css/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png reviewboard/static/rb/js/views/extensionBrowserView.js reviewboard/static/rb/css/images/ui-bg_flat_0_aaaaaa_40x100.png reviewboard/static/rb/css/images/animated-overlay.gif reviewboard/static/rb/css/images/ui-bg_glass_75_d0e5f5_1x400.png
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
One thing that strikes me is that when you switch from tab to tab, the size of the modal changes, and so the tabs move. This is not ideal. What we should do is size the modal to fit the largest tab content, and stick to that size, so that we're not resizing on the fly.
-
-
reviewboard.extensionbrowser isn't being recognized as a module because there's no __init__.py under reviewboard/extensionbrowser. You probably have one locally, but haven't included it. You need to include it.
-
"Keywords" should maybe be wrapped in an underscore function. Also, not sure "Keywords" is the right word to use here. Makes me think of AOL. Let's leave it for now, but maybe worth revisiting later on.
-
-
Mind if I ask why a <table> wasn't used here instead? I know we didn't want it to *look* like a table, but a table, semantically speaking, is what it is...
-
We use 2 spaces indentation in our .css, and I think you've used tabs. Also, please put your properties in alphabetical order, and always make sure there is a space before {. I'm a bit worried that some of these hard-coded widths and heights might be a little fragile... Also, it might be worth looking into converting this into a .less file. See http://lesscss.org/
-
-
-
-
Modals are not usually the best way to handle things. We have a thing that drops down from the top of the screen that says "Loading" when doing an AJAX request, and if something goes wrong, that Loading banner becomes an error that stays put. Maybe use that instead.
-
-
I wonder if instead of tossing this into the view, we render this as a hidden node in the page. That'd give us trans tags too.
-
-
-
-
-
-
-
-
Again, I wonder if these should be in the rendered HTML instead, in something like this: <script type="text/template" id="itemViewTemplate"> <div class="extension_info_wrapper"> ... </div> </script> Instead, for translation, and to keep our HTML (even our templates) a little more separated from our JS.
-
[] as opposed to new Array. Also, this looks related to the array on line 91. If we end up going with the embedded template route, maybe this object have an object property, like: target_templates: { 'ext-information': 'info_template', 'ext-screenshots': 'screenshots' } etc, where 'info_template' and 'screenshots' could be the template IDs. Just an idea, to reduce duplication.
-
These should be in alphabetical order, so DOES_NOT_EXIST, EXTENSION_INSTALLED, INVALID_FORM_DATA, NOT_LOGGED_IN, PERMISSION_DENIED.
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
The patch is now out of a WIP. Changes: Fixed fatal bug invovling installation. Updated the UI to reflect a successful installation. Restricted access to the administrators for the new resources created in webAPI (equivalent to @staff_member_required). Added pagination support for the search results. Some tweaks on the UI. Ported the extension browser css file to .less. Accomodated changes from previous reviews.
- Summary:
-
[WIP] Extension browser module with search/install feature from a remote store.Extension browser module with search/install feature from a remote store.
- Diff:
-
Revision 3 (+1316 -3)
- Description:
-
Extension browser module - Supports searching and installing extensions. Extensions are retrieved from a remote extension store and are accessed through the store's API. JSON responses are expected back.
~ This review request follows: http://www.youtube.com/watch?v=Xvntl7ksjPA&hd=1
~ This review request follows: http://www.youtube.com/watch?v=Xvntl7ksjPA&hd=1 (partially).
~ Change is also dependant on a modification to djblets/extensions/base.py -- method which performs an installation through easy_install given a remote archive containting an egg.
~ Change is also dependant on a modification to djblets/extensions/base.py -- method which performs an installation through easy_install given a remote archive containting an egg -- as on /r/3973
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/settings.py reviewboard/webapi/resources.py reviewboard/__init__.py reviewboard/extensionbrowser/base.py reviewboard/extensionbrowser/forms.py reviewboard/extensionbrowser/views.py reviewboard/urls.py reviewboard/extensionbrowser/urls.py Ignored Files: reviewboard/static/rb/css/images/ui-icons_2e83ff_256x240.png reviewboard/static/rb/css/images/ui-bg_glass_95_fef1ec_1x400.png reviewboard/static/rb/css/images/ui-icons_469bdd_256x240.png reviewboard/static/rb/css/images/ui-bg_inset-hard_100_fcfdfd_1x100.png reviewboard/static/rb/css/images/ui-icons_f9bd01_256x240.png reviewboard/static/rb/css/extensionbrowser.less reviewboard/static/rb/css/images/ui-icons_d8e7f3_256x240.png reviewboard/static/rb/css/jquery-ui-1.10.1.custom.css reviewboard/extensionbrowser/templates/extensionbrowser/extension_browser.html reviewboard/static/rb/js/models/extensionInformationModel.js reviewboard/static/rb/css/images/ui-bg_inset-hard_100_f5f8f9_1x100.png reviewboard/static/rb/js/extensionbrowser.js reviewboard/static/rb/css/images/ui-bg_flat_0_aaaaaa_40x100.png reviewboard/static/rb/css/images/ui-bg_glass_85_dfeffc_1x400.png reviewboard/static/rb/css/images/ui-icons_6da8d5_256x240.png reviewboard/static/rb/css/images/ui-icons_cd0a0a_256x240.png reviewboard/static/rb/css/images/ui-bg_flat_55_fbec88_40x100.png reviewboard/static/rb/css/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png reviewboard/static/rb/css/images/ui-bg_glass_75_d0e5f5_1x400.png reviewboard/static/rb/css/images/ui-icons_217bc0_256x240.png reviewboard/static/rb/css/images/animated-overlay.gif reviewboard/static/rb/js/views/extensionBrowserView.js
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Diff:
-
Revision 4 (+1310 -3)
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/settings.py reviewboard/webapi/resources.py reviewboard/extensionbrowser/views.py reviewboard/__init__.py reviewboard/extensionbrowser/forms.py reviewboard/extensionbrowser/base.py reviewboard/urls.py reviewboard/extensionbrowser/urls.py Ignored Files: reviewboard/static/rb/css/images/ui-icons_2e83ff_256x240.png reviewboard/static/rb/css/images/ui-bg_glass_95_fef1ec_1x400.png reviewboard/static/rb/css/images/ui-icons_469bdd_256x240.png reviewboard/static/rb/css/images/ui-bg_inset-hard_100_fcfdfd_1x100.png reviewboard/static/rb/css/images/ui-icons_f9bd01_256x240.png reviewboard/static/rb/css/extensionbrowser.less reviewboard/static/rb/css/images/ui-icons_d8e7f3_256x240.png reviewboard/static/rb/css/jquery-ui-1.10.1.custom.css reviewboard/extensionbrowser/templates/extensionbrowser/extension_browser.html reviewboard/static/rb/js/models/extensionInformationModel.js reviewboard/static/rb/css/images/ui-bg_inset-hard_100_f5f8f9_1x100.png reviewboard/static/rb/js/extensionbrowser.js reviewboard/static/rb/css/images/ui-bg_flat_0_aaaaaa_40x100.png reviewboard/static/rb/css/images/ui-bg_glass_85_dfeffc_1x400.png reviewboard/static/rb/css/images/ui-icons_6da8d5_256x240.png reviewboard/static/rb/css/images/ui-icons_cd0a0a_256x240.png reviewboard/static/rb/css/images/ui-bg_flat_55_fbec88_40x100.png reviewboard/static/rb/css/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png reviewboard/static/rb/css/images/ui-bg_glass_75_d0e5f5_1x400.png reviewboard/static/rb/css/images/ui-icons_217bc0_256x240.png reviewboard/static/rb/css/images/animated-overlay.gif reviewboard/static/rb/js/views/extensionBrowserView.js
-
-
-
-
-
-
-
-
-
-
-
- Diff:
-
Revision 5 (+963 -32)
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/settings.py reviewboard/webapi/resources.py reviewboard/extensionbrowser/views.py reviewboard/__init__.py reviewboard/extensionbrowser/forms.py reviewboard/extensionbrowser/base.py reviewboard/urls.py reviewboard/extensionbrowser/urls.py Ignored Files: reviewboard/static/rb/css/images/ui-icons_2e83ff_256x240.png reviewboard/static/rb/css/images/ui-bg_glass_95_fef1ec_1x400.png reviewboard/static/rb/css/images/ui-icons_469bdd_256x240.png reviewboard/static/rb/css/images/ui-bg_inset-hard_100_fcfdfd_1x100.png reviewboard/static/rb/css/images/ui-icons_f9bd01_256x240.png reviewboard/static/rb/css/extensionbrowser.less reviewboard/static/rb/css/images/ui-icons_d8e7f3_256x240.png reviewboard/static/rb/css/common.less reviewboard/extensionbrowser/templates/extensionbrowser/extension_browser.html reviewboard/static/rb/js/models/extensionInformationModel.js reviewboard/static/rb/css/images/ui-bg_inset-hard_100_f5f8f9_1x100.png reviewboard/static/rb/js/extensionbrowser.js reviewboard/static/rb/css/jquery-ui-1.7.1.custom.css reviewboard/static/rb/css/defs.less reviewboard/static/rb/css/images/ui-bg_flat_0_aaaaaa_40x100.png reviewboard/static/rb/css/images/ui-bg_glass_85_dfeffc_1x400.png reviewboard/static/rb/css/images/ui-icons_6da8d5_256x240.png reviewboard/static/rb/css/images/ui-icons_cd0a0a_256x240.png reviewboard/static/rb/css/images/ui-bg_flat_55_fbec88_40x100.png reviewboard/static/rb/css/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png reviewboard/static/rb/js/views/extensionBrowserView.js reviewboard/static/rb/css/images/ui-icons_217bc0_256x240.png reviewboard/static/rb/css/images/animated-overlay.gif reviewboard/static/rb/css/images/ui-bg_glass_75_d0e5f5_1x400.png
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Diff:
-
Revision 6 (+964 -32)
- Removed Files:
- Added Files:
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/settings.py reviewboard/webapi/resources.py reviewboard/extensionbrowser/views.py reviewboard/__init__.py reviewboard/extensionbrowser/forms.py reviewboard/extensionbrowser/base.py reviewboard/urls.py reviewboard/extensionbrowser/urls.py Ignored Files: reviewboard/static/rb/css/images/ui-icons_2e83ff_256x240.png reviewboard/static/rb/css/images/ui-bg_glass_95_fef1ec_1x400.png reviewboard/static/rb/css/images/ui-icons_469bdd_256x240.png reviewboard/static/rb/css/images/ui-bg_inset-hard_100_fcfdfd_1x100.png reviewboard/static/rb/css/images/ui-icons_f9bd01_256x240.png reviewboard/static/rb/css/extensionbrowser.less reviewboard/static/rb/css/images/ui-icons_d8e7f3_256x240.png reviewboard/static/rb/css/common.less reviewboard/extensionbrowser/templates/extensionbrowser/extension_browser.html reviewboard/static/rb/js/models/extensionInformationModel.js reviewboard/static/rb/css/images/ui-bg_inset-hard_100_f5f8f9_1x100.png reviewboard/static/rb/js/extensionbrowser.js reviewboard/static/rb/css/jquery-ui-1.7.1.custom.css reviewboard/static/rb/css/defs.less reviewboard/static/rb/css/images/ui-bg_flat_0_aaaaaa_40x100.png reviewboard/static/rb/css/images/ui-bg_glass_85_dfeffc_1x400.png reviewboard/static/rb/css/images/ui-icons_6da8d5_256x240.png reviewboard/static/rb/css/images/ui-icons_cd0a0a_256x240.png reviewboard/static/rb/css/images/ui-bg_flat_55_fbec88_40x100.png reviewboard/static/rb/css/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png reviewboard/static/rb/js/views/extensionBrowserView.js reviewboard/static/rb/css/images/ui-icons_217bc0_256x240.png reviewboard/static/rb/css/images/animated-overlay.gif reviewboard/static/rb/css/images/ui-bg_glass_75_d0e5f5_1x400.png
-
-
-
-
-
-
-
-
-
-
-
This is looking great! First off, r.rb.org is misbehaving, and I seem to be unable to delete comments - thus, I've edited them to say [comment deleted]. Ech. I've refrained from poking too much at the CSS and interface stuff, since, as you mention, it'll likely change a lot over the next little while, and we just want to get it in a testable state while we develop the store. Basically, I think this looks really good! I have one concern about the JSONDecodeError (see below), and a few general nits. But otherwise, I like the look of this. -Mike
-
-
-
On attempting a search with this latest patch, I'm getting this trace: http://pastie.org/7308158 Apparently, json.JSONDecodeError doesn't exist for my version of the Django simplejson library (I'm on Django 1.4.5). If this exception is a recent addition to the library, we should check to see if we need to bump our Django requirements. Alternatively, we could throw a ValueError exception here.
-
-
-
-
-
-
-
-
-
-
-
- Diff:
-
Revision 7 (+963 -32)
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/settings.py reviewboard/webapi/resources.py reviewboard/extensionbrowser/views.py reviewboard/__init__.py reviewboard/extensionbrowser/forms.py reviewboard/extensionbrowser/base.py reviewboard/urls.py reviewboard/extensionbrowser/urls.py Ignored Files: reviewboard/static/rb/css/images/ui-icons_2e83ff_256x240.png reviewboard/static/rb/css/images/ui-bg_glass_95_fef1ec_1x400.png reviewboard/static/rb/css/images/ui-icons_469bdd_256x240.png reviewboard/static/rb/css/images/ui-bg_inset-hard_100_fcfdfd_1x100.png reviewboard/static/rb/css/images/ui-icons_f9bd01_256x240.png reviewboard/static/rb/css/extensionbrowser.less reviewboard/static/rb/css/images/ui-icons_d8e7f3_256x240.png reviewboard/static/rb/css/common.less reviewboard/extensionbrowser/templates/extensionbrowser/extension_browser.html reviewboard/static/rb/js/models/extensionInformationModel.js reviewboard/static/rb/css/images/ui-bg_inset-hard_100_f5f8f9_1x100.png reviewboard/static/rb/js/extensionbrowser.js reviewboard/static/rb/css/jquery-ui-1.7.1.custom.css reviewboard/static/rb/css/defs.less reviewboard/static/rb/css/images/ui-bg_flat_0_aaaaaa_40x100.png reviewboard/static/rb/css/images/ui-bg_glass_85_dfeffc_1x400.png reviewboard/static/rb/css/images/ui-icons_6da8d5_256x240.png reviewboard/static/rb/css/images/ui-icons_cd0a0a_256x240.png reviewboard/static/rb/css/images/ui-bg_flat_55_fbec88_40x100.png reviewboard/static/rb/css/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png reviewboard/static/rb/js/views/extensionBrowserView.js reviewboard/static/rb/css/images/ui-icons_217bc0_256x240.png reviewboard/static/rb/css/images/animated-overlay.gif reviewboard/static/rb/css/images/ui-bg_glass_75_d0e5f5_1x400.png
-
-
-
-
-
-
-
-
-
-
-
-
Can we pull this out into its own patch? I'd like to get it into a release. Also, I think you can just use settings.LOCAL_ROOT instead of figuring it out from settings_local.
-
-
-
-
-
-
-
-
-
Kind of awkwardly formatted. I'd prefer: response[1][....] = \ package_name in self.installed_extension
-
-
IDs like "results" make me nervous. Far too generic. Prefixing a lot of these IDs with something to make them pretty unique would be good.
-
These should be indented relative to other template tags. They're too far indented right now. Same with the other nearby tags.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
The name should be a bit more specific, name-wise. I'd also feel better with this file not being here in the root (we're trying to empty out the js/ directory and keep things in subdirs). I'd prefer all this code be on a view that is instantiated inside the HTML of a page.
-
-
-
-
-
-
-
-
-
-
I'm not sure we need this. I'd prefer not using _bindAll unless we have specific uses. In general, we should be calling render() with the right context.
-
-
One var statement per function, at the top of the function, with each parameter being on its own line, comma-separated. For the _.template, this should be created on the class itself.
-
Should be: this.$el .html(template) .modalBox(); As for the class, that should go in the className field at the top of the class.
-
-
-
-
-
-
render shouldn't take an ID. I think if we have this one thing representing different tabs, we should really just have each tab subclass this and provide their own template/events.
-
-
-
-
The dictionary fields should be indented 1 level from the "var extension_install". Also, extension_install should be extensionInstallInfo. (No underscores in variables in the JavaScript code anywhere.)
-
No need for the 'self'. Instead, pass 'this' as the second parameter to save(), which will bind the proper context.
-
-
-
This is too generic, given the context. This file's too big. I'd recommend we start breaking this out. Maybe put this into extension_store.py.
-
-
There should be a has_access_permissions function that does this, and the get function should call that.
-
-
-
-
-
-
-
-
Alignment issue. The _entrypoint_iterator() is private and shouldn't be used. There'd need to be an accessor.
-
The wrapping is weird. You're calling get_extension_manager() a lot. Call it once and just use that variable.
-
-