-
-
Notifications
You must be signed in to change notification settings - Fork 598
add support for the pull request reviews API #517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -127,7 +127,7 @@ public function __construct(Builder $httpClientBuilder = null, $apiVersion = nul | |||
))); | |||
|
|||
$this->apiVersion = $apiVersion ?: 'v3'; | |||
$builder->addHeaders(['Accept' => sprintf('application/vnd.github.%s+json', $this->apiVersion)]); | |||
$builder->addHeaderValue('Accept', sprintf('application/vnd.github.%s+json', $this->apiVersion)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise we wouldn't be able to add the custom Accept
header value without having to repeat Accept
header values passed by this builder.
@m1guelpf Can you explain why this would break Laravel Github? |
@m1guelpf I don't see why that should break. Which error message do you get? |
@xabbuh Forget it, I reinstalled everything and now it works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I think it all looks good. I just had some minor things.
Is there any reson why you left Get comments for single review for a future update?
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($pullRequest).'/comments'); | ||
} | ||
|
||
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/comments'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is not really a part of the PR, right?
Let's keep it anyways (for this time)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it's there to allow https://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository which is not directly related to the reviews, but needed if you want to fully leverage the reviews API. But I can move it to its own PR nonetheless. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okey, I stand corrected.
Lets keep it.
/** | ||
* Get a listing of a pull request's reviews by the username, repository and pull request number. | ||
* | ||
* @link http://developer.github.com/v3/pulls/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** | ||
* Get a single pull request review by the username, repository, pull request number and the review id. | ||
* | ||
* @link http://developer.github.com/v3/pulls/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* | ||
* @param string $username the username | ||
* @param string $repository the repository | ||
* @param array $pullRequest the pull request number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be int
.
* | ||
* @param string $username the username | ||
* @param string $repository the repository | ||
* @param array $pullRequest the pull request number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be int
.
* | ||
* @param string $username the username | ||
* @param string $repository the repository | ||
* @param array $pullRequest the pull request number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int
/** | ||
* Submit a pull request review by the username, repository, pull request number and the review id. | ||
* | ||
* @link http://developer.github.com/v3/pulls/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* | ||
* @param string $username the username | ||
* @param string $repository the repository | ||
* @param array $pullRequest the pull request number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int
/** | ||
* Dismiss a pull request review by the username, repository, pull request number and the review id. | ||
* | ||
* @link http://developer.github.com/v3/pulls/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* | ||
* @param string $username the username | ||
* @param string $repository the repository | ||
* @param array $pullRequest the pull request number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int
Oh no, that was not intended, but just an oversight. I'll look into it tonight. |
I changed the |
There is still one bug (I think), changing the headers doesn't reset the HttpClient with |
No description provided.