Review Board Gateway hosting service integration
Review Request #6850 — Created Jan. 31, 2015 and submitted
This is the Hosting Service that is meant to support rb-gateway.
Review Board Gateway is meant to be an easy to deploy hosting service that the repository owner can self host. It is supposed to provide an API in front of repositories that works closely with Review Board for retrieving files, checking file existance, etc. It also currently supports Review Board's Post Commit UI which includes the ability to get commits, get branches, and get a commit diff (change).
I added a git repository using the hosting service form on my local instance of review board of type 'Review Board Gateway', called rbgateway-test (with the authorized credentials). I then added a .reviewboardrc to my local repository pointing to rbgateway-test. I typed 'rbt post' and it successfully posted to my local instance under rbgateway-test. I also checked rbt post, and rbt post -u on updating an existing file, and successfully saw GET requests in rb-gateway server for requesting file blob when viewing the diff; successfully viewed the diff. Post Commit UI was also verified to work, as seen in the screenshot. When clicking on one of the commits in the Post Commit UI, a new review request was opened successfully.
Added unit tests that passed for:
- checking whether ReviewBoardGateway can find the repository
- checking whether authorization sends the expected data
- checking the service support capabilities
- checking the repository field values
- checking the get_branches function
- checking the get_commits function
- checking the get_change function
Description | From | Last Updated |
---|---|---|
Is it possible to hide this checkbox? I don't believe rb-gateway's current scope includes hosting an issue tracker. |
brennie | |
Col: 6 W292 no newline at end of file |
reviewbot | |
'is_release' imported but unused |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
It probably goes > 79 characters, but I think we should keep this on one line. |
david | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
'six' imported but unused |
reviewbot | |
'URLError' imported but unused |
reviewbot | |
Col: 32 E226 missing whitespace around arithmetic operator |
reviewbot | |
undefined name 'ugettext' |
reviewbot | |
undefined name 'ugettext' |
reviewbot | |
undefined name 'ugettext' |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
This should end in a period. |
david | |
Can we stick this in an else clause? |
david | |
We should log unexpected errors. |
david | |
We should log unexpected errors. |
david | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
undefined name 'url' |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
This isn't correct. |
david | |
This should probably be "Review Board Gateway" |
david | |
Checks -> Check |
david | |
Authorizes -> Authorize. |
david | |
Determines -> Determine |
david | |
Gets -> Get |
david | |
Checks -> Check |
david | |
This should be "Get" rather than "Gets" |
david | |
The summary part of the docstring should fit on one line. It should also be written using the imperative mood … |
david | |
Same comments here. |
david | |
Returns -> Return |
david | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Can you add a docstring for this class? |
david | |
This should use is_new rather than _, since you're naming the gettext import _. |
david | |
We should probably distinguish between 404 (which should return FileNotFoundError) and other errors (which should log and return a generic … |
david | |
We should probably distinguish between 404 (which should return FileNotFoundError) and other errors (which should log and return a generic … |
david | |
I'm not sure we really care to log 404s, either. |
david | |
We definitely don't care about 404s here. |
david | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 19 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 19 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 15 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Blank line between these. |
brennie | |
Blank line between these. |
brennie | |
Blank line between these. |
brennie | |
Surround this with parenthesis and you won't need the backslashes. Also, you should be using the bytestring literal (b'') because … |
brennie | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Blank line between these. |
brennie | |
Blank line between these. |
brennie | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Probably you should write doc strings in thrid person when you describe what the function does. |
Chester | |
I would recommend if not start: |
Chester | |
You could add one more parameter raw_content into the definition, when it is False, return data, headers directly, otherwise return … |
Chester | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot |
- Change Summary:
-
Style issues, forgot about review bot :)
- Commit:
-
8fc6d45b364c1451debc042913c6fa770fe20ccf4525497ff69b5cea31f5622d0760e2afff635675
- Diff:
-
Revision 2 (+39 -1)
-
Tool: Pyflakes Processed Files: setup.py reviewboard/hostingsvcs/rbgateway.py Tool: PEP8 Style Checker Processed Files: setup.py reviewboard/hostingsvcs/rbgateway.py
- Change Summary:
-
Path URL fixes
- Commit:
-
4525497ff69b5cea31f5622d0760e2afff635675dd7e9e3f8e914cc180d9cc61c14ca5a9929d2f62
- Diff:
-
Revision 3 (+40 -1)
- Change Summary:
-
Fixed the path for the rb-gateway hosting service
- Description:
-
~ This is a super basic hosting service set up for rb-gateway. Still a lot of work and testing to be done. I am just submitting it as a WIP for the weekly status report.
~ This is a WIP for the Hosting Service that is meant to support rb-gateway.
+ + Currently when you add a repository in the UI, of type 'Review Board Gateway' it will send a GET request to localhost:8888 (configuration to be added) to get the repository.
+ + TODO:
+ - Support more than Git + - Hosting Service Subclass in need of more implementations. - Testing Done:
-
+ I added a git repository using my local instance of review board of type 'Review Board Gateway' called rbgateway-test. I then added a .reviewboardrc to my local repository pointing to rbgateway-test. I typed 'rbt post' and it successfully posted to my local instance under rbgateway-test.
- Commit:
-
dd7e9e3f8e914cc180d9cc61c14ca5a9929d2f624c033c7050b1690a80578befc1bd2597c937675b
- Diff:
-
Revision 4 (+44 -1)
- Change Summary:
-
Cleaned up the form, added authentication handling
- Summary:
-
[WIP] rb-gateway integration into Review Board[WIP] Review Board Gateway hosting service implementation
- Description:
-
This is a WIP for the Hosting Service that is meant to support rb-gateway.
~ Currently when you add a repository in the UI, of type 'Review Board Gateway' it will send a GET request to localhost:8888 (configuration to be added) to get the repository.
~ Review Board Gateway is meant to be an easy to deploy hosting service that the repository owner can self host.
- - TODO:
- - Support more than Git - - Hosting Service Subclass in need of more implementations. - Commit:
-
4c033c7050b1690a80578befc1bd2597c937675bccab2dae926df9f6a05e210600560b5def7bac6e
- Diff:
-
Revision 5 (+108 -1)
- Added Files:
-
Tool: PEP8 Style Checker Processed Files: setup.py reviewboard/hostingsvcs/rbgateway.py Tool: Pyflakes Processed Files: setup.py reviewboard/hostingsvcs/rbgateway.py
-
-
-
-
-
-
-
- Change Summary:
-
Added test cases for existing functionality
- Testing Done:
-
~ I added a git repository using my local instance of review board of type 'Review Board Gateway' called rbgateway-test. I then added a .reviewboardrc to my local repository pointing to rbgateway-test. I typed 'rbt post' and it successfully posted to my local instance under rbgateway-test.
~ I added a git repository using the hosting service form on my local instance of review board of type 'Review Board Gateway', called rbgateway-test (with the authorized credentials). I then added a .reviewboardrc to my local repository pointing to rbgateway-test. I typed 'rbt post' and it successfully posted to my local instance under rbgateway-test.
+ + Feb.9:
+ Added unit tests that passed for: + - checking whether ReviewBoardGateway can find the repository + - checking whether authorization sends the expected data + - checking the service support capabilities + - checking the repository field values - Commit:
-
ccab2dae926df9f6a05e210600560b5def7bac6efcf9522ca7bf67b384c0c07f9ed8d82df33f5346
- Change Summary:
-
get_file and get_file_exists implementations to hosting service subclass.
- Testing Done:
-
I added a git repository using the hosting service form on my local instance of review board of type 'Review Board Gateway', called rbgateway-test (with the authorized credentials). I then added a .reviewboardrc to my local repository pointing to rbgateway-test. I typed 'rbt post' and it successfully posted to my local instance under rbgateway-test.
Feb.9:
Added unit tests that passed for: - checking whether ReviewBoardGateway can find the repository - checking whether authorization sends the expected data - checking the service support capabilities - checking the repository field values + + Feb.12:
+ - checked rbt post, and rbt post -u on updating an existing file, successfully saw GET requests in rb-gateway server for requesting file blob when viewing the diff. Successfully viewed the diff. - Commit:
-
fcf9522ca7bf67b384c0c07f9ed8d82df33f5346c835ac9bb7e6ee0391101868b6ebee8c437a7cdc
- Change Summary:
-
Minor updates to description / removed WIP
- Summary:
-
[WIP] Review Board Gateway hosting service implementationReview Board Gateway hosting service implementation
- Description:
-
~ This is a WIP for the Hosting Service that is meant to support rb-gateway.
~ This is a Hosting Service that is meant to support rb-gateway.
~ Review Board Gateway is meant to be an easy to deploy hosting service that the repository owner can self host.
~ Review Board Gateway is meant to be an easy to deploy hosting service that the repository owner can self host. It is supposed to provide an API that works closely with Review Board.
- Testing Done:
-
I added a git repository using the hosting service form on my local instance of review board of type 'Review Board Gateway', called rbgateway-test (with the authorized credentials). I then added a .reviewboardrc to my local repository pointing to rbgateway-test. I typed 'rbt post' and it successfully posted to my local instance under rbgateway-test.
~ Feb.9:
~ Added unit tests that passed for:
- Added unit tests that passed for: - checking whether ReviewBoardGateway can find the repository - checking whether authorization sends the expected data - checking the service support capabilities ~ - checking the repository field values ~ - checking the repository field values - - Feb.12:
- checked rbt post, and rbt post -u on updating an existing file, successfully saw GET requests in rb-gateway server for requesting file blob when viewing the diff. Successfully viewed the diff.
- Change Summary:
-
Applying David's suggestions.
- Commit:
-
c835ac9bb7e6ee0391101868b6ebee8c437a7cdc272528186b89cef286f44ad67a77ffc11046dd27
-
Tool: PEP8 Style Checker Processed Files: setup.py reviewboard/hostingsvcs/rbgateway.py reviewboard/hostingsvcs/tests.py Tool: Pyflakes Processed Files: setup.py reviewboard/hostingsvcs/rbgateway.py reviewboard/hostingsvcs/tests.py
-
-
- Change Summary:
-
Very minor change to address Review Bot's issue.
- Commit:
-
272528186b89cef286f44ad67a77ffc11046dd2721857c6dadb16bc0d615d3d6a2fdd2cd17b96555
- Change Summary:
-
Updating comments
- Commit:
-
21857c6dadb16bc0d615d3d6a2fdd2cd17b96555c3f53e35c09f3644e5809a1a7f88ea2765a8983b
- Change Summary:
-
Fixing above issues, changing URLs to follow review request #7006, verified 'Testing Done' still works.
- Testing Done:
-
I added a git repository using the hosting service form on my local instance of review board of type 'Review Board Gateway', called rbgateway-test (with the authorized credentials). I then added a .reviewboardrc to my local repository pointing to rbgateway-test. I typed 'rbt post' and it successfully posted to my local instance under rbgateway-test.
Added unit tests that passed for:
- checking whether ReviewBoardGateway can find the repository - checking whether authorization sends the expected data - checking the service support capabilities ~ - checking the repository field values ~ - checking the repository field values + + Additional tests:
- checked rbt post, and rbt post -u on updating an existing file, successfully saw GET requests in rb-gateway server for requesting file blob when viewing the diff. Successfully viewed the diff. - Depends On:
-
- Commit:
c3f53e35c09f3644e5809a1a7f88ea2765a8983b08d1ac72ad859bd472192328e66967d13d469883
- Change Summary:
-
Post commit functions, screenshot. Changing to WIP because I want to add unit tests for post commit next week.
- Commit:
-
08d1ac72ad859bd472192328e66967d13d4698834481ebd133db341762882a9873d3470bac8d5691
- Diff:
-
Revision 12 (+348 -1)
- Added Files:
-
Tool: Pyflakes Processed Files: setup.py reviewboard/hostingsvcs/rbgateway.py reviewboard/hostingsvcs/tests.py Tool: PEP8 Style Checker Processed Files: setup.py reviewboard/hostingsvcs/rbgateway.py reviewboard/hostingsvcs/tests.py
-
-
-
-
- Change Summary:
-
Minor cleanup
- Commit:
-
4481ebd133db341762882a9873d3470bac8d569187afbb268eabf66368eef59f0ab6f4097798856a
- Change Summary:
-
Added Post Commit unit testing, minor cleanups, update desc. & testing done.
- Summary:
-
[WIP] Review Board Gateway hosting service implementationReview Board Gateway hosting service integration
- Description:
-
~ This is a Hosting Service that is meant to support rb-gateway.
~ This is the Hosting Service that is meant to support rb-gateway.
~ Review Board Gateway is meant to be an easy to deploy hosting service that the repository owner can self host. It is supposed to provide an API that works closely with Review Board.
~ Review Board Gateway is meant to be an easy to deploy hosting service that the repository owner can self host. It is supposed to provide an API in front of repositories that works closely with Review Board for retrieving files, checking file existance, etc. It also currently supports Review Board's Post Commit UI which includes the ability to get commits, get branches, and get a commit diff (change).
- Testing Done:
-
~ I added a git repository using the hosting service form on my local instance of review board of type 'Review Board Gateway', called rbgateway-test (with the authorized credentials). I then added a .reviewboardrc to my local repository pointing to rbgateway-test. I typed 'rbt post' and it successfully posted to my local instance under rbgateway-test.
~ I added a git repository using the hosting service form on my local instance of review board of type 'Review Board Gateway', called rbgateway-test (with the authorized credentials). I then added a .reviewboardrc to my local repository pointing to rbgateway-test. I typed 'rbt post' and it successfully posted to my local instance under rbgateway-test. I also checked rbt post, and rbt post -u on updating an existing file, and successfully saw GET requests in rb-gateway server for requesting file blob when viewing the diff; successfully viewed the diff. Post Commit UI was also verified to work, as seen in the screenshot. When clicking on one of the commits in the Post Commit UI, a new review request was opened successfully.
Added unit tests that passed for:
- checking whether ReviewBoardGateway can find the repository - checking whether authorization sends the expected data - checking the service support capabilities ~ - checking the repository field values ~ ~ Additional tests:
~ - checked rbt post, and rbt post -u on updating an existing file, successfully saw GET requests in rb-gateway server for requesting file blob when viewing the diff. Successfully viewed the diff. ~ - checking the repository field values ~ - checking the get_branches function ~ - checking the get_commits function ~ - checking the get_change function - Commit:
-
87afbb268eabf66368eef59f0ab6f4097798856ad725370303096f2d28e0dbce3b2be1579edcf651
- Change Summary:
-
Addressing style issues Barret suggested.
- Commit:
-
d725370303096f2d28e0dbce3b2be1579edcf651bcc00683f8e7e76548306631681085c5c498d811
- Change Summary:
-
More styling fixes
- Commit:
-
bcc00683f8e7e76548306631681085c5c498d8116878be814aebd3f36f73d6403a0b5732dbf400ba
-
-
-
-
You could add one more parameter
raw_content
into the definition, when it is False, return data, headers directly, otherwise returnjson.loads(data, headers)
. Because you only need raw data inget_file()
, other function calls are all required to returned json formatted string, setraw_content
default to False would save you more lines of code. Therefore, you don't need to do exception ever time you call_api_get()
.