Add an API resource for hosting services.
Review Request #5882 — Created May 26, 2014 and submitted
Information | |
---|---|
chipx86 | |
Review Board | |
master | |
|
|
b163f12... | |
Reviewers | |
reviewboard | |
This introduces
/api/hosting-services/
, which provides basic information
on the hosting services supported by Review Board.The resource does not expose all the information on a
HostingService
.
Right now, I'm keeping to the basic information, such as the name and
capabilities, until I determine what we're going to want to use for the
new repository configuration UI. This UI may impact howHostingService
itself structures data down the road, so it's not worth baking anything
related to that into the API yet.This work is loosely based on Olessia's UCOSP work, though many
changes were made to better fit in with other resources, to take
advantage of whatWebAPIResource
provides, and to make use of the new
LocalDataQuerySet
(which greatly reduces the amount of code).
Fetched the list resource and compared the output to the values from
the HostingServices.Followed links to the item resources. Saw those being fetched as well,
with the correct data.Tested that things like pagination worked (had to limit the number of
results for this).Unit tests passed.
Description | From | Last Updated |
---|---|---|
'webapi_response_errors' imported but unused |
![]() |
|
'webapi_request_fields' imported but unused |
![]() |
|
'webapi_login_required' imported but unused |
![]() |
|
'PERMISSION_DENIED' imported but unused |
![]() |
|
'DOES_NOT_EXIST' imported but unused |
![]() |
|
'NOT_LOGGED_IN' imported but unused |
![]() |
|
'get_hosting_service' imported but unused |
![]() |
|
'webapi_check_login_required' imported but unused |
![]() |
|
'webapi_check_local_site' imported but unused |
![]() |
|
Hmm. Can we clarify this somehow? "Whether creating review requests for committed changes is supported through the web UI?" |
|

-
This is a review from Review Bot. Tool: Pyflakes Processed Files: reviewboard/webapi/tests/test_hosting_service.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/urls.py reviewboard/webapi/resources/hosting_service.py reviewboard/webapi/tests/mimetypes.py Ignored Files: docs/manual/webapi/2.0/resources/hosting-service-list.rst docs/manual/webapi/2.0/resources/hosting-service.rst docs/manual/webapi/2.0/resources/index.rst
-
reviewboard/webapi/resources/hosting_service.py (Diff revision 1) 'webapi_response_errors' imported but unused
-
reviewboard/webapi/resources/hosting_service.py (Diff revision 1) 'webapi_request_fields' imported but unused
-
reviewboard/webapi/resources/hosting_service.py (Diff revision 1) 'webapi_login_required' imported but unused
-
reviewboard/webapi/resources/hosting_service.py (Diff revision 1) 'PERMISSION_DENIED' imported but unused
-
reviewboard/webapi/resources/hosting_service.py (Diff revision 1) 'DOES_NOT_EXIST' imported but unused
-
reviewboard/webapi/resources/hosting_service.py (Diff revision 1) 'NOT_LOGGED_IN' imported but unused
-
reviewboard/webapi/resources/hosting_service.py (Diff revision 1) 'get_hosting_service' imported but unused
-
reviewboard/webapi/resources/hosting_service.py (Diff revision 1) 'webapi_check_login_required' imported but unused
-
reviewboard/webapi/resources/hosting_service.py (Diff revision 1) 'webapi_check_local_site' imported but unused
Change Summary:
Fixed unused imports.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+220) |

-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/tests/test_hosting_service.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/urls.py reviewboard/webapi/resources/hosting_service.py reviewboard/webapi/tests/mimetypes.py Ignored Files: docs/manual/webapi/2.0/resources/hosting-service-list.rst docs/manual/webapi/2.0/resources/hosting-service.rst docs/manual/webapi/2.0/resources/index.rst

-
This is a review from Review Bot. Tool: Pyflakes Processed Files: reviewboard/webapi/tests/test_hosting_service.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/urls.py reviewboard/webapi/resources/hosting_service.py reviewboard/webapi/tests/mimetypes.py Ignored Files: docs/manual/webapi/2.0/resources/hosting-service-list.rst docs/manual/webapi/2.0/resources/hosting-service.rst docs/manual/webapi/2.0/resources/index.rst
-
-
reviewboard/webapi/resources/hosting_service.py (Diff revision 2) Hmm. Can we clarify this somehow? "Whether creating review requests for committed changes is supported through the web UI?"
Change Summary:
Improved the wording of the
supports_post_commit
capability.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+221) |

-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/tests/test_hosting_service.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/urls.py reviewboard/webapi/resources/hosting_service.py reviewboard/webapi/tests/mimetypes.py Ignored Files: docs/manual/webapi/2.0/resources/hosting-service-list.rst docs/manual/webapi/2.0/resources/hosting-service.rst docs/manual/webapi/2.0/resources/index.rst

-
This is a review from Review Bot. Tool: Pyflakes Processed Files: reviewboard/webapi/tests/test_hosting_service.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/urls.py reviewboard/webapi/resources/hosting_service.py reviewboard/webapi/tests/mimetypes.py Ignored Files: docs/manual/webapi/2.0/resources/hosting-service-list.rst docs/manual/webapi/2.0/resources/hosting-service.rst docs/manual/webapi/2.0/resources/index.rst
-
-
reviewboard/webapi/resources/hosting_service.py (Diff revisions 2 - 3) This is still not great, since rbtools can "post an existing commit through the API". That said, I'm struggling to come up with anything better, and I doubt anyone will actually use this anyway.
Change Summary:
Removed the
supports_post_commit
capability in the API until we know what we want to do here.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 4 (+214) |

-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/tests/test_hosting_service.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/urls.py reviewboard/webapi/resources/hosting_service.py reviewboard/webapi/tests/mimetypes.py Ignored Files: docs/manual/webapi/2.0/resources/hosting-service-list.rst docs/manual/webapi/2.0/resources/hosting-service.rst docs/manual/webapi/2.0/resources/index.rst

-
This is a review from Review Bot. Tool: Pyflakes Processed Files: reviewboard/webapi/tests/test_hosting_service.py reviewboard/webapi/resources/root.py reviewboard/webapi/tests/urls.py reviewboard/webapi/resources/hosting_service.py reviewboard/webapi/tests/mimetypes.py Ignored Files: docs/manual/webapi/2.0/resources/hosting-service-list.rst docs/manual/webapi/2.0/resources/hosting-service.rst docs/manual/webapi/2.0/resources/index.rst