-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Pull Requests API Implementation #173
Pull Requests API Implementation #173
Conversation
Still missing pull request files, commit lists and merge checks.
Still missing integration tests for Pull Requests, though. I need to do a bit more research before I can start to tackle that one.
/// <param name="name">The name of the repository</param> | ||
/// <param name="request">Used to filter and sort the list of pull requests returned</param> | ||
/// <returns></returns> | ||
IObservable<PullRequest> GetForRepository(string owner, string name, PullRequestRequest request); |
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.
PullRequestRequest
hah! I guess that's a consequence of our current naming scheme. It's fiiiiine. I just had to comment as I LOL'd.
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.
Ahaha, yeah I was wondering how you guys would react to that. I got a good laugh out of that as well :)
Thank you so much for this. This is great work. I had a few nitpicky comments. I appreciate that you remembered to add the project files to the NetCor45 project. Most people (myself included) forget. Could you also add them to: Unfortunately, I could not add these to the Solution so they're easy to miss. |
No problem! Happy to help :) Already working on patching up those little things. As for the MonoTouch and MonoAndroid projects, I see them included within the solution, but as you can see they aren't "included" yet. I can certainly add the references manually, but I figured I'd check to make sure that something hasn't gotten screwed up with my development environment. Thanks again for the great lib, you guys! Can't wait to contribute more 🤘 |
I think those project types only work in Xamarin Studio. Is that right @paulcbetts. So for now, manually editing them is our only recourse. Or installing Xamarin Studio and opening them in there. |
Manually referenced as this requires Xamarin studio to do automatically.
Ah, gotcha gotcha. That makes much more sense. |
How's this coming along? Need any help? Looks like it's out of date with upstream |
Sure do, just haven't gotten the time to dedicate to it these last couple days unfortunately. Planning on getting everything taken care of this weekend, though! |
Great! Carry on! 🍰 |
They work in Visual Studio, but only if you have a Xamarin license which costs a fair amount of 💰. Don't worry about verifying the build or anything, just add in the files. If it works in Octokit.csproj it almost certainly works in the Mono version too. |
Removed default parameter from pull request merge message according to CA1026.
Bugfix for building the merge api url, as well.
Renamed and enhanced existing Merged tests.
- Initial integration test for pull requests (can't seem to do much without the tree api) - Added Observable unit tests for the rest of the pull request client
So I'm pretty sure that this is all taken care of, but it should be noted that integration tests can't really be done until the Trees API is implemented (unless I'm missing something here). I'm a little hesitant to call this "done" until those are implemented, but as far as I can tell, I've added in everything I can. As always, feel free to let me know if I screwed up anything! |
Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); | ||
Ensure.ArgumentNotNullOrEmptyString(name, "name"); | ||
|
||
return ApiConnection.Get<PullRequestMerge>(ApiUrls.MergePullRequest(owner, name, 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.
Merged doesn't return a response - you need to check the status code to see whether a pull request has been merged:
204 No Content
indicates it has been merged
404 Not Found
indicates it has not been merged
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.
See this code for a similar example
NewPullRequest constructor only takes required params. Each required parameter is now a readonly property.
Done and done. Loving that little utility to handle adding in all of the referenced .cs files! Very handy. 👍 |
@jpsullivan don't thank us, thank @forki! 😀 |
@forki you're doing the Lords work, my son. 🍻 |
@@ -204,4 +204,4 @@ public Task<string> GetReadmeHtml(string owner, string name) | |||
/// </remarks> | |||
public IRepoCollaboratorsClient RepoCollaborators { get; private set; } | |||
} | |||
} |
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.
Not sure what happened here, (merging master perhaps clobbering your changes?) but I've got a compiler error here:
Octokit\Clients\RepositoriesClient.cs(15,18,15,36): error CS0535: 'Octokit.RepositoriesClient' does not implement interface member 'Octokit.IRepositoriesClient.PullRequest'
@jpsullivan I've dropped a few comments in based on my testing and review. It's coming together! |
Thanks a lot man! Sorry that it seems kinda like amateur hour up in here... I'll get these patched up pronto. |
@jpsullivan don't sweat it, take your time. |
@jpsullivan anything left on this? I'll review it the next time I have internet access but let me know if there's anything particular I should look at. |
@shiftkey Yep, still working on a few more details, particularly getting the integration tests sorted out now that I see Trees have been implemented. Will let you know when this is all ready for a review, though. |
IObservable<PullRequest> Create(string owner, string name, NewPullRequest newPullRequest); | ||
|
||
/// <summary> | ||
/// Creates a pull request for the specified repository. |
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.
Shouldn't it be `Updates a pull request..``?
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.
@nulltoken yes, yes it should
Attempting to take a stab at #135.
Basic functionality for Pull Requests is in place. As of now, the only things missing from this are:
Otherwise, to me this seems like a good starting point. Don't hold back if I screwed up something! 👍