Implement post-commit review request support for GitLab
Review Request #6872 — Created Feb. 1, 2015 and submitted
Add post-commit review request support GitLab
In /r/new/, you can manually view or add review requests for changes already being pushed to remote repository, which is called 'post-commit'. But Reviewboard previously does not support GitLab for this functionality. This project is to add the 'post-commit' review request support for GitLab.
With this implementation, users can retrieve GitLab hosting service information to do 'post-commit' review request operations. Specifically, we can get branches, commits belong to the particular branch, and changes have been made in commits from repositories on GitLab.
There are three general steps are involved. First, we send an API request to GitLab then retrieve a list of branches. Second, we send another API request to get a list of commits with specified branch. After that, when the user clicks on one commit from the page, we send a HTTP request instead of using GitLab API url format to get the diff.
The reason we don't use GitLab API request url to retrieve the diff is the returned value is not what we expect and there are no indices in it. The url format we are using is
https://gitlab.com/<user-name>/<project-name>/commit/<revision>.diff
- Tested on local server, ran as expected.
-- Created a test GitLab repository, successfully fetched branches and commits information in /r/new.
-- New page of commits are displayed normally after scrolling down, pagination is working correctly.
-- Commit diffs can be viewed by clicking commits in the GitLab repository. - Unit tests passed.
-- test_get_branches()
-- test_get_commits()
-- test_get_change()
Description | From | Last Updated |
---|---|---|
Col: 47 E127 continuation line over-indented for visual indent |
reviewbot | |
That's a GitHub-specific thing. |
chipx86 | |
Col: 5 E265 block comment should start with '# ' |
reviewbot | |
Col: 6 W291 trailing whitespace |
reviewbot | |
Make sure all trailing whitespace is cleaned up. |
chipx86 | |
If functions aren't being used, we don't want to introduce them yet, even in commented-out form. |
chipx86 | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 5 E303 too many blank lines (2) |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
None of these functions are doing anything. Having them here is just going to add confusion. Make sure we're only … |
chipx86 | |
Col: 28 E241 multiple spaces after ',' |
reviewbot | |
Col: 35 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 35 E128 continuation line under-indented for visual indent |
reviewbot | |
These are all missing docstrings. |
chipx86 | |
Col: 49 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 35 E703 statement ends with a semicolon |
reviewbot | |
Col: 13 E113 unexpected indentation |
reviewbot | |
Col: 47 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 5 E265 block comment should start with '# ' |
reviewbot | |
Col: 6 W291 trailing whitespace |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 5 E303 too many blank lines (2) |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 72 W291 trailing whitespace |
reviewbot | |
Col: 28 E241 multiple spaces after ',' |
reviewbot | |
Col: 31 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 35 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 35 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 73 W291 trailing whitespace |
reviewbot | |
Col: 35 E703 statement ends with a semicolon |
reviewbot | |
Col: 13 E113 unexpected indentation |
reviewbot | |
Col: 47 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 5 E265 block comment should start with '# ' |
reviewbot | |
Col: 6 W291 trailing whitespace |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 72 W291 trailing whitespace |
reviewbot | |
Col: 28 E241 multiple spaces after ',' |
reviewbot | |
Col: 31 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 73 W291 trailing whitespace |
reviewbot | |
Col: 35 E703 statement ends with a semicolon |
reviewbot | |
Col: 13 E113 unexpected indentation |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 6 W291 trailing whitespace |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
'cache' imported but unused |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 6 W291 trailing whitespace |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
undefined name 'HTTPERRor' |
reviewbot | |
undefined name 'logging' |
reviewbot | |
undefined name 'SCMError' |
reviewbot | |
undefined name 'logging' |
reviewbot | |
undefined name 'logging' |
reviewbot | |
undefined name 'SCMError' |
reviewbot | |
undefined name 'logging' |
reviewbot | |
undefined name 'SCMError' |
reviewbot | |
local variable 'gitlab_msg' is assigned to but never used |
reviewbot | |
undefined name 'ref_name' |
reviewbot | |
'cache' imported but unused |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
undefined name 'HTTPERRor' |
reviewbot | |
undefined name 'logging' |
reviewbot | |
undefined name 'SCMError' |
reviewbot | |
undefined name 'logging' |
reviewbot | |
undefined name 'logging' |
reviewbot | |
undefined name 'SCMError' |
reviewbot | |
undefined name 'logging' |
reviewbot | |
undefined name 'SCMError' |
reviewbot | |
local variable 'gitlab_msg' is assigned to but never used |
reviewbot | |
undefined name 'ref_name' |
reviewbot | |
'cache' imported but unused |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
A lot of the functions you have in GitLabClient are unneccessary. I'm mostly referring to the http_get(), http_post() ones, but … |
JY jyuen | |
This is a GitHub private function, I don't believe we need to check rate limits for GitLab APIs, at least … |
JY jyuen | |
This is redundant with _api_get() that already exists. This will actually not work because GitLab APIs require authentication, see the … |
JY jyuen | |
Why not just if branch: since you do start = branch right before? |
JY jyuen | |
local variable 'response_info' is assigned to but never used |
reviewbot | |
Col: 45 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 17 E113 unexpected indentation |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
'urllib2' imported but unused |
reviewbot | |
Please use %-formatting. |
brennie | |
Blank line between these. |
brennie | |
This should be combined into one: repo_api_url = '%s/repository/commits?private_token=%s' % (self._get_repo_api_url(repository), self._get_private_token()) |
brennie | |
Blank line between these. |
brennie | |
No comma on the last line -- it is a function call, not a list/dict |
brennie | |
I don't think these comments are needed since the code does a good job of explaining it already. |
JY jyuen | |
Blank line between these. |
brennie | |
This seems like good information for the function docstring. |
brennie | |
Blank line between these. |
brennie | |
Can we combine these? commit_api_url = '%s/repository/commits/%s?private_token=%s' % (repo_api_url, revision, private_token) |
JY jyuen | |
Have you tried this for the case where the current revision has no parents (i.e., it is the initial commit … |
brennie | |
local variable 'repo_id' is assigned to but never used |
reviewbot | |
Can we also combine these? |
JY jyuen | |
Col: 24 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 61 W291 trailing whitespace |
reviewbot | |
Col: 30 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 30 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 76 W291 trailing whitespace |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 17 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 17 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 17 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 34 E226 missing whitespace around arithmetic operator |
reviewbot | |
Alphabetize these. |
brennie | |
This sentence doesn't really add anything to the docstring. |
brennie | |
See my previous comment. Also instead of saying "The start" you should say "The start parameter". |
brennie | |
"The branch is optional. If it is not given, use the default branch." |
brennie | |
Just curious, but why are we only getting the first element of this response? This should be documented. |
brennie | |
Is item ever not a dict? If it is something else, what is it and why do we ignore it. … |
brennie | |
These comments don't really add anything. |
brennie | |
I mentioned this in a previous review, but there should be a blank line between these. It is a style … |
brennie | |
Reword this. You should mention that a long SHA (capitalized) is 40 characters. |
brennie | |
emove this line. |
brennie | |
Use all available line width (up to 79 characters). |
brennie | |
Can we use repo_api_url as an argument in the %-formatting expression? |
brennie | |
"a diff" |
brennie | |
Can you use < and > instead of " and " here? |
brennie | |
Can we use a %-formatting expression here? |
brennie | |
This seems like an issue prone way to strip the last two lines. Can we do a reverse search from … |
brennie | |
Blank line between these. |
brennie | |
This isn't a necessary comment. |
brennie | |
These comments don't add a lot to the code. |
brennie | |
See previous issues re: comments. |
brennie | |
See previous issues re: comments. |
brennie | |
This seems like a pretty critical problem. We need to start logging at 'start' if it's present, and 'branch' if … |
david | |
Col: 77 W291 trailing whitespace |
reviewbot | |
"commit ID". Remove "in here" |
brennie | |
No blank line here. |
brennie | |
This should be "Get a list" |
david | |
Should use single quotes. |
david | |
What else can ref be if it doesn't have a 'name' entry? |
brennie | |
Should be "Get a list" |
david | |
"commit ID" Remove "in here" |
brennie | |
Should use single quotes. |
david | |
Comments should start with a capital letter. We also don't "pretend it as a branch name", we use that SHA … |
david | |
Should use single quotes. |
david | |
Remove this blank line. |
david | |
Your first sentence here is run-on. Please change it to "The branch is optional. If it is not given..." |
david | |
Should use single quotes. |
david | |
The comma at the end of this line should be a period, and the next line should start a new … |
david | |
paginates -> paginate. |
david | |
"In prevent of removing the initial commit" is bad grammar. How about "To prevent removing the initial commit"? |
david | |
Can we define a constant for the page size? |
david | |
Can page_size be a constant on the class, like COMMITS_PER_PAGE ? |
brennie | |
Should be "Get the diff" |
david | |
Remove "In this function" Change "stands for the" to "is a" "commit ID" "(which is a long SHA) and consists … |
brennie | |
Your grammar here is a little off ("which is a long sha consists of 40 characters") -> should probably be … |
david | |
"SHA" |
david | |
Should use single quotes. |
david | |
"namespace" is one word. |
david | |
Should use single quotes. |
david | |
Should use single quotes. |
david | |
This comment doesn't really add anything, and it's the sort of thing which is likely to get out of date … |
david | |
This should define the string as bytes (prefix with a 'b' character) |
david | |
Comments should start with a capital letter. |
david | |
Comments should start with a capital letter. |
david | |
Comments should start with a capital letter. |
david | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 E101 indentation contains mixed spaces and tabs |
reviewbot | |
Col: 1 E101 indentation contains mixed spaces and tabs |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 1 E101 indentation contains mixed spaces and tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 E101 indentation contains mixed spaces and tabs |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 30 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 32 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
I don't think we need the note about "headers"--it's obvious from looking at the code, and this sort of comment … |
david | |
Add a period at the end of this comment. |
david | |
I don't think we need this comment. |
david | |
undefined name 'page_size' |
reviewbot | |
Can we change COMMITS_PER_PAGE to be 20, and then check if len(commits) == self.COMMITS_PER_PAGE? I think the "19" number can … |
david | |
In the case where there are only 20 commits in the repository, you WILL remove the initial commit. This needs … |
brennie | |
Christian suggested that this comment be: # The maximum number of commits returned from each call to get_commits() |
david | |
How about: # Ask GitLab for 21 commits per page. GitLab's API doesn't # include the parent IDs, so we … |
david | |
If you make the change I suggested to the comment text to page_size above, you can remove all but the … |
david |
- Groups:
-
Looks like there's still a bit of work to do here. Aside from the comments listed below, this still needs a rewrite of the description, fully-comprehensive unit tests, and information on every real-world test you ran against a live GitLab server.
-
-
-
-
None of these functions are doing anything. Having them here is just going to add confusion. Make sure we're only including what's necessary in this change for post-commit review to work.
-
-
Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/github.py reviewboard/hostingsvcs/gitlab.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Commit:
-
4a9b2f0e759e80e06bbbfad0e0d32d60472674299498fec9d0b43a49ddabe537b857d065acc9a0e6
- Diff:
-
Revision 4 (+266 -1)
- Commit:
-
9498fec9d0b43a49ddabe537b857d065acc9a0e695b53a8df7df6802070499382e038efbf1cca971
- Diff:
-
Revision 5 (+241 -1)
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Commit:
-
95b53a8df7df6802070499382e038efbf1cca9716ff27f8fe0e1eeabfecabef5b084d75592c99f09
- Diff:
-
Revision 6 (+240 -1)
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py
-
-
-
-
-
-
-
-
-
-
-
-
- Commit:
-
6ff27f8fe0e1eeabfecabef5b084d75592c99f09e1935dc402c5706fbc22d938854254b0f9844ba3
- Diff:
-
Revision 7 (+241 -2)
-
-
A lot of the functions you have in GitLabClient are unneccessary. I'm mostly referring to the http_get(), http_post() ones, but I don't think you need to get the tree either for these APIs to work.
-
This is a GitHub private function, I don't believe we need to check rate limits for GitLab APIs, at least not to implement post commit APIs.
-
This is redundant with _api_get() that already exists. This will actually not work because GitLab APIs require authentication, see the PRIVATE-TOKEN in _api_get(). I suggest calling that instead.
-
- Description:
-
~ [WIP] Implement post-commit for GitLab
~ [WIP] Implement post-commit review request support for GitLab
+ + In /r/new/, you can mannualy add review requests for changes already being pused to remote repository. But Reviewboard currently does not support GitLab. This project is to add the support for GitLab.
+ + Will modify the description after the coding is finished.
- Commit:
-
e1935dc402c5706fbc22d938854254b0f9844ba38a3b50f6487dc01d9eca2fabb02cd9bee669d222
- Diff:
-
Revision 8 (+219 -2)
- Testing Done:
-
~ Not yet
~ - Tested on local server, ran as expected.
+ - Unit tests are coming.
- Commit:
-
8a3b50f6487dc01d9eca2fabb02cd9bee669d222f939e3ee98b5c73da52fa0f7f8225cff2cf8a3b5
- Diff:
-
Revision 9 (+100)
- Summary:
-
[WIP] Implement post-commit review request support for GitLabImplement post-commit review request support for GitLab
- Description:
-
~ [WIP] Implement post-commit review request support for GitLab
~ In /r/new/, you can mannualy view or add review requests for changes already being pused to remote repository. But Reviewboard currently does not support GitLab. This project is to add the support for GitLab.
~ In /r/new/, you can mannualy add review requests for changes already being pused to remote repository. But Reviewboard currently does not support GitLab. This project is to add the support for GitLab.
~ ~ Will modify the description after the coding is finished.
~ There functions are added in this implementation, also a flag
support_post_commit
is set to true.~ Functions are: ~ - get_branches() # returns a list of branchs + - get_commits() # returns a list of commits + - get_change() # return a commit with diff - Testing Done:
-
- Tested on local server, ran as expected.
~ - Unit tests are coming.
~ - Unit tests passed.
+ - test_get_branches()
+ - test_get_commits()
+ - test_get_change()
- Commit:
-
f939e3ee98b5c73da52fa0f7f8225cff2cf8a3b520f335faba8139b58bc629656563012d6c9353a1
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py
-
-
-
-
-
-
-
-
-
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py
- Testing Done:
-
- Tested on local server, ran as expected.
~ - Unit tests passed.
~ - Unit tests passed.
-- test_get_branches()
-- test_get_commits()
-- test_get_change()
- - test_get_branches()
- - test_get_commits()
- - test_get_change()
- Commit:
-
fee44c0ddd9ca4eeb29fd34a6feec13cb41406c8c049b6416729429539ff3e1a9cf936b2cdfde8e7
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py
-
<p>So summary and testing done should be really high level descriptions of the changes in the code, e.g. "Previously it was the case that X. Nowe we have corrected that to Y. We chose Y because Z." It usually shouldn't go into the classes/fields/functions modified.</p>
<p>As an example, you can say something like "The GitLab hosting service is now able to retrieve branches and commits" instead of listing the <code>get_changes</code> and <code>get_branches</code>.</p>
<p>Have a look at <a href="https://www.reviewboard.org/docs/codebase/dev/writing-good-descriptions/">Writing Good Descriptions</a> in the codebase docs if you need more information or feel free to respond to this comment.</p> -
-
-
-
-
Is
item
ever not adict
? If it is something else, what is it and why do we ignore it. This seems like a good thing to document with comments.If
not isinstance(item, dict)
is indicative of an error, we should log something. -
-
I mentioned this in a previous review, but there should be a blank line between these. It is a style consistency thing.
-
-
-
-
-
-
-
This seems like an issue prone way to strip the last two lines. Can we do a reverse search from the end of the
diff
for the newline character and then strip the rest of the string? Or do anrsplit
withmaxsep=2
andsep='\n'
and only keep the first part? -
-
-
-
-
- Description:
-
~ In /r/new/, you can mannualy view or add review requests for changes already being pused to remote repository. But Reviewboard currently does not support GitLab. This project is to add the support for GitLab.
~ Add post-commit review request support GitLab
~ There functions are added in this implementation, also a flag
support_post_commit
is set to true.~ Functions are: ~ - get_branches() # returns a list of branchs ~ - get_commits() # returns a list of commits ~ - get_change() # return a commit with diff ~ In /r/new/, you can mannualy view or add review requests for changes already being pused to remote repository, which is called 'post-commit'. But Reviewboard previously does not support GitLab for this functionality. This project is to add the 'post-commit' review request support for GitLab.
~ ~ With this implementation, users can retriev GitLab hosting service information to do 'post-commit' review request operations. Specifically, we can get branches, commits belong to the particular branch, and changes have been made in commits from repositories on GitLab.
~ ~ There are three general steps are involved. First, we send an API request to GitLab then retrieve a list of branches. Second, we send another API request to get a list of commits with secified branch. After that, when the user clicks on one commit from the page, we send a HTTP request instead of using GitLab API url format to get the diff.
+ + The reason we don't use GitLab API request url to retrieve the diff is the returned value is not what we expect and there are no indices in it. The url format we are using is
https://gitlab.com/<user-name>/<project-name>/commit/<revision>.diff
- Commit:
-
61fafa0dbe3e5d924e0dc9e81feb1a37cebd86ab06b61c10ad0b7465edae5b354ccf3d1906160c55
-
Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py
-
Oops, forgot to edit my last review!
This is looking really good, but I'm going to wait on a second opinion before I sign off on it because I'm not intimately familiar with hosting services.
I do have one little nit, though. The summary will be the first line of the commit message once it lands so the first line of your description is redundant. No big deal.
- Description:
-
Add post-commit review request support GitLab
~ In /r/new/, you can mannualy view or add review requests for changes already being pused to remote repository, which is called 'post-commit'. But Reviewboard previously does not support GitLab for this functionality. This project is to add the 'post-commit' review request support for GitLab.
~ In /r/new/, you can manually view or add review requests for changes already being pushed to remote repository, which is called 'post-commit'. But Reviewboard previously does not support GitLab for this functionality. This project is to add the 'post-commit' review request support for GitLab.
~ With this implementation, users can retriev GitLab hosting service information to do 'post-commit' review request operations. Specifically, we can get branches, commits belong to the particular branch, and changes have been made in commits from repositories on GitLab.
~ With this implementation, users can retrieve GitLab hosting service information to do 'post-commit' review request operations. Specifically, we can get branches, commits belong to the particular branch, and changes have been made in commits from repositories on GitLab.
~ There are three general steps are involved. First, we send an API request to GitLab then retrieve a list of branches. Second, we send another API request to get a list of commits with secified branch. After that, when the user clicks on one commit from the page, we send a HTTP request instead of using GitLab API url format to get the diff.
~ There are three general steps are involved. First, we send an API request to GitLab then retrieve a list of branches. Second, we send another API request to get a list of commits with specified branch. After that, when the user clicks on one commit from the page, we send a HTTP request instead of using GitLab API url format to get the diff.
The reason we don't use GitLab API request url to retrieve the diff is the returned value is not what we expect and there are no indices in it. The url format we are using is
https://gitlab.com/<user-name>/<project-name>/commit/<revision>.diff
- Commit:
-
ca7ef6e93cd6f52fdebce0d17a94ef50e27f90638b0e37d617e87178a2f0206c7607a7428f3a4927
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py
-
-
-
-
-
-
Comments should start with a capital letter.
We also don't "pretend it as a branch name", we use that SHA as the latest commit to log from.
-
-
-
Your first sentence here is run-on. Please change it to "The branch is optional. If it is not given..."
-
-
The comma at the end of this line should be a period, and the next line should start a new sentence.
-
-
"In prevent of removing the initial commit" is bad grammar. How about "To prevent removing the initial commit"?
-
-
-
Your grammar here is a little off ("which is a long sha consists of 40 characters") -> should probably be "consisting". Also please capitalize "SHA"
-
-
-
-
-
-
This comment doesn't really add anything, and it's the sort of thing which is likely to get out of date if we change the
get_commits
implementation. -
-
-
-
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py
-
-
-
-
-
-
-
-
-
-
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py
-
This is looking very complete! I have just a few comments on your comments.
Also, in your testing done, you say "Tested on local server, ran as expected." Please be specific about which manual test-cases you went through.
-
I don't think we need the note about "headers"--it's obvious from looking at the code, and this sort of comment can get out of date if we make a change to start using it.
-
-
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py
-
Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py
-
Still waiting on this comment from a previous review:
In your testing done, you say "Tested on local server, ran as expected." Please be specific about which manual test-cases you went through.
- Testing Done:
-
~ - Tested on local server, ran as expected.
~ - Tested on local server, ran as expected.
-- Created a test GitLab repository, successfully fetched branches and commits information in /r/new.
-- New page of commits are displayed normally after scrolling down, pagination is working correctly.
-- Commit diffs can be viewed by clicking commits in the GitLab repository.
- Unit tests passed.
-- test_get_branches()
-- test_get_commits()
-- test_get_change()
- Commit:
-
7fda4775166c70fce1038e71f7e2ae2ddd4d537fa33b3ff3665e97d0a3dfe30fb727e74427727652
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py
-
Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py
-
-
Christian suggested that this comment be:
# The maximum number of commits returned from each call to get_commits()
-
How about:
# Ask GitLab for 21 commits per page. GitLab's API doesn't # include the parent IDs, so we use subsequent commits to fill # them in (allowing us to return 20 commits with parent IDs).
-
If you make the change I suggested to the comment text to
page_size
above, you can remove all but the first line of this comment.
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/gitlab.py reviewboard/hostingsvcs/tests.py