Webapi Resource for integrations
Review Request #7105 — Created March 23, 2015 and discarded
This provides the webapi resource and the views for the integration admin page.
The webapi resource for both Integration and ConfiguredIntegration are provided here. The Integration resource allows for getting the list of Integrations that implements the class and hook defined in review 6918.
The ConfiguredIntegration resource allows GET, PUT and DELETE call to manage individual configured integration.
Unit test done.
Tested with WebapiResource test for both integrations and configuredIntegration resource.
Description | From | Last Updated |
---|---|---|
'PERMISSION_DENIED' imported but unused |
reviewbot | |
'NOT_LOGGED_IN' imported but unused |
reviewbot | |
'webapi_response_errors' imported but unused |
reviewbot | |
'webapi_login_required' imported but unused |
reviewbot | |
'webapi_check_local_site' imported but unused |
reviewbot | |
local variable 'manager' is assigned to but never used |
reviewbot | |
'IntegrationManager' imported but unused |
reviewbot | |
This function needs a docstring. |
brennie | |
This function needs a docstring. |
brennie | |
Please alphabetize these. |
brennie | |
Undo this change. |
brennie | |
This method isn't called from anywhere. |
brennie | |
This will raise an exception if integration_class is None. You should define integration as None before the if integration_class block. |
brennie | |
ConfiguredIntegration. |
brennie | |
This docstring will end up in public facing documentation. It should not mention class names of RB-specific things (e.g., ConfiguredIntegration). … |
brennie | |
ConfiguredIntegration |
brennie | |
integration-id |
brennie | |
When is_list is false, this will return a list. Shouldn't it return a single instance? |
brennie | |
Can we change this to use integration-id ? |
brennie | |
See previous comment about docstrings. |
brennie | |
You can use enabled as a key-word argument to the function to not have to look into kwargs. |
brennie | |
"Delete a configured integration." |
brennie | |
Can we just do the call to get_integration_manager inside the class's __init__ method? Are we ever expecting to instantiate this … |
brennie | |
Can we pull the query set out into a variable? |
brennie | |
Same comment here re: integration managers as in the previous resource. |
brennie | |
No blank line here. |
david | |
All str in here should be six.text_type for future Python 3 compatibility. Here and below. |
david | |
I think I'd prefer if these conditionals were switched: if config and config.integration: return config.integration.name else: return None |
david | |
Same as above. |
david | |
Same as above. |
david | |
Same as above. |
david | |
This should have a docstring. |
david | |
This should have a docstring. |
david | |
No blank line here. |
david | |
All str items in here should be six.text_type |
david | |
Please switch the conditional to test if integration: and return None in the else clause. |
david | |
This should have a docstring. |
david |
- Summary:
-
[WIP] Webapi Resource for integrationsWebapi Resource for integrations
- Testing Done:
-
~ Unit test done.
~ Unit test done.
+ Tested with WebapiResource test for both integrations and configuredIntegration resource. - Diff:
-
Revision 2 (+594 -2)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/root.py reviewboard/integrations/urls.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_configured_integration.py reviewboard/integrations/views.py reviewboard/webapi/resources/configured_integration.py reviewboard/webapi/resources/integration.py reviewboard/urls.py reviewboard/webapi/tests/test_integration.py reviewboard/integrations/admin.py Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/root.py reviewboard/integrations/urls.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_configured_integration.py reviewboard/integrations/views.py reviewboard/webapi/resources/configured_integration.py reviewboard/webapi/resources/integration.py reviewboard/urls.py reviewboard/webapi/tests/test_integration.py reviewboard/integrations/admin.py
-
-
-
-
-
- Change Summary:
-
Remove redundant code.
- Diff:
-
Revision 3 (+572 -2)
-
Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/root.py reviewboard/integrations/urls.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_configured_integration.py reviewboard/integrations/views.py reviewboard/webapi/resources/configured_integration.py reviewboard/webapi/resources/integration.py reviewboard/urls.py reviewboard/webapi/tests/test_integration.py reviewboard/integrations/admin.py Tool: Pyflakes Processed Files: reviewboard/webapi/resources/root.py reviewboard/integrations/urls.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_configured_integration.py reviewboard/integrations/views.py reviewboard/webapi/resources/configured_integration.py reviewboard/webapi/resources/integration.py reviewboard/urls.py reviewboard/webapi/tests/test_integration.py reviewboard/integrations/admin.py
- Diff:
-
Revision 4 (+577 -2)
-
Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/root.py reviewboard/integrations/urls.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_configured_integration.py reviewboard/integrations/views.py reviewboard/webapi/resources/configured_integration.py reviewboard/webapi/resources/integration.py reviewboard/urls.py reviewboard/webapi/tests/test_integration.py reviewboard/integrations/admin.py Tool: Pyflakes Processed Files: reviewboard/webapi/resources/root.py reviewboard/integrations/urls.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_configured_integration.py reviewboard/integrations/views.py reviewboard/webapi/resources/configured_integration.py reviewboard/webapi/resources/integration.py reviewboard/urls.py reviewboard/webapi/tests/test_integration.py reviewboard/integrations/admin.py
-
- Diff:
-
Revision 5 (+576 -2)
-
Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/root.py reviewboard/integrations/urls.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_configured_integration.py reviewboard/integrations/views.py reviewboard/webapi/resources/configured_integration.py reviewboard/webapi/resources/integration.py reviewboard/urls.py reviewboard/webapi/tests/test_integration.py reviewboard/integrations/admin.py Tool: Pyflakes Processed Files: reviewboard/webapi/resources/root.py reviewboard/integrations/urls.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_configured_integration.py reviewboard/integrations/views.py reviewboard/webapi/resources/configured_integration.py reviewboard/webapi/resources/integration.py reviewboard/urls.py reviewboard/webapi/tests/test_integration.py reviewboard/integrations/admin.py
-
- Diff:
-
Revision 6 (+575 -2)
-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/root.py reviewboard/integrations/urls.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_configured_integration.py reviewboard/integrations/views.py reviewboard/webapi/resources/configured_integration.py reviewboard/webapi/resources/integration.py reviewboard/urls.py reviewboard/webapi/tests/test_integration.py reviewboard/integrations/admin.py Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/root.py reviewboard/integrations/urls.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_configured_integration.py reviewboard/integrations/views.py reviewboard/webapi/resources/configured_integration.py reviewboard/webapi/resources/integration.py reviewboard/urls.py reviewboard/webapi/tests/test_integration.py reviewboard/integrations/admin.py
- Change Summary:
-
Fix review issues
- Diff:
-
Revision 7 (+583 -1)
-
Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/root.py reviewboard/integrations/urls.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_configured_integration.py reviewboard/integrations/views.py reviewboard/webapi/resources/configured_integration.py reviewboard/webapi/resources/integration.py reviewboard/urls.py reviewboard/webapi/tests/test_integration.py reviewboard/integrations/admin.py Tool: Pyflakes Processed Files: reviewboard/webapi/resources/root.py reviewboard/integrations/urls.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_configured_integration.py reviewboard/integrations/views.py reviewboard/webapi/resources/configured_integration.py reviewboard/webapi/resources/integration.py reviewboard/urls.py reviewboard/webapi/tests/test_integration.py reviewboard/integrations/admin.py
-
-
This will raise an exception if
integration_class
isNone
. You should defineintegration
asNone
before theif integration_class
block. -
-
This docstring will end up in public facing documentation. It should not mention class names of RB-specific things (e.g., ConfiguredIntegration). Instead it should just refer to, e.g., "configuration integration".
-
-
-
-
-
-
-
-
Can we just do the call to
get_integration_manager
inside the class's__init__
method?Are we ever expecting to instantiate this with a different integration manager?
-
-
- Diff:
-
Revision 8 (+583 -1)
-
Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/root.py reviewboard/integrations/urls.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_configured_integration.py reviewboard/integrations/views.py reviewboard/webapi/resources/configured_integration.py reviewboard/webapi/resources/integration.py reviewboard/urls.py reviewboard/webapi/tests/test_integration.py reviewboard/integrations/admin.py Tool: Pyflakes Processed Files: reviewboard/webapi/resources/root.py reviewboard/integrations/urls.py reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_configured_integration.py reviewboard/integrations/views.py reviewboard/webapi/resources/configured_integration.py reviewboard/webapi/resources/integration.py reviewboard/urls.py reviewboard/webapi/tests/test_integration.py reviewboard/integrations/admin.py